mirror of
https://github.com/LukeHagar/sailpoint-cli.git
synced 2025-12-06 04:21:15 +00:00
34 lines
681 B
Go
34 lines
681 B
Go
// Copyright (c) 2021, SailPoint Technologies, Inc. All rights reserved.
|
|
package cmd
|
|
|
|
import (
|
|
"fmt"
|
|
|
|
"github.com/sailpoint/sp-cli/client"
|
|
"github.com/spf13/cobra"
|
|
)
|
|
|
|
func newConnInvokeAccountListCmd(client client.Client) *cobra.Command {
|
|
cmd := &cobra.Command{
|
|
Use: "account-list",
|
|
Short: "Invoke a std:account:list command",
|
|
RunE: func(cmd *cobra.Command, args []string) error {
|
|
ctx := cmd.Context()
|
|
cc, err := connClient(cmd, client)
|
|
if err != nil {
|
|
return err
|
|
}
|
|
|
|
_, rawResponse, err := cc.AccountList(ctx)
|
|
if err != nil {
|
|
return err
|
|
}
|
|
|
|
_, _ = fmt.Fprintln(cmd.OutOrStdout(), string(rawResponse))
|
|
return nil
|
|
},
|
|
}
|
|
|
|
return cmd
|
|
}
|