Updated list command with table and docs

This commit is contained in:
luke-hagar-sp
2023-08-18 08:43:59 -05:00
parent d14f3755fe
commit c9fbb06551
2 changed files with 16 additions and 2 deletions

View File

@@ -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
},

View File

@@ -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
```
====