Files
sailpoint-cli/cmd/conn_invoke_account_list.go
2022-07-21 13:21:00 -05:00

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
}