mirror of
https://github.com/LukeHagar/sailpoint-cli.git
synced 2025-12-06 04:21:15 +00:00
Updated list command with table and docs
This commit is contained in:
@@ -7,6 +7,7 @@ import (
|
||||
sailpoint "github.com/sailpoint-oss/golang-sdk"
|
||||
"github.com/sailpoint-oss/golang-sdk/beta"
|
||||
"github.com/sailpoint-oss/sailpoint-cli/internal/config"
|
||||
"github.com/sailpoint-oss/sailpoint-cli/internal/output"
|
||||
"github.com/sailpoint-oss/sailpoint-cli/internal/sdk"
|
||||
"github.com/sailpoint-oss/sailpoint-cli/internal/util"
|
||||
"github.com/spf13/cobra"
|
||||
@@ -36,7 +37,12 @@ func newListCommand() *cobra.Command {
|
||||
return sdk.HandleSDKError(resp, clustersErr)
|
||||
}
|
||||
|
||||
cmd.Println(util.PrettyPrint(clusters))
|
||||
var entries [][]string
|
||||
for _, cluster := range clusters {
|
||||
entries = append(entries, []string{*cluster.Name, *cluster.Org, cluster.Id})
|
||||
}
|
||||
|
||||
output.WriteTable(cmd.OutOrStdout(), []string{"Name", "Org", "ID"}, entries)
|
||||
|
||||
return nil
|
||||
},
|
||||
|
||||
@@ -1,7 +1,15 @@
|
||||
==Long==
|
||||
# List
|
||||
|
||||
List all clusters from IdentityNow
|
||||
|
||||
## API References:
|
||||
- https://developer.sailpoint.com/idn/api/beta/get-managed-clusters
|
||||
|
||||
====
|
||||
|
||||
==Example==
|
||||
|
||||
```bash
|
||||
sail cluster list
|
||||
```
|
||||
====
|
||||
Reference in New Issue
Block a user