Skip to content

Commit

Permalink
CLOUDP-269965: [Atlas CLI] Documentation needs to be updated for some…
Browse files Browse the repository at this point in the history
… commands (#3231)
  • Loading branch information
andreaangiolillo authored Oct 4, 2024
1 parent b90224a commit e4f4ced
Show file tree
Hide file tree
Showing 8 changed files with 27 additions and 14 deletions.
8 changes: 8 additions & 0 deletions docs/command/atlas-accessLogs-list.txt
Original file line number Diff line number Diff line change
Expand Up @@ -106,3 +106,11 @@ Examples

# Return a JSON-formatted list of all authentication requests made against the cluster named Cluster0 for the project with ID 618d48e05277a606ed2496fe:
atlas accesslogs list --output json --projectId 618d48e05277a606ed2496fe --clusterName Cluster0


.. code-block::
:copyable: false

# Return a JSON-formatted list of all authentication requests made against the hostname named atlas-dqrlj4-shard-00-00.g1nxq.mongodb-dev.net for the project stored in the profile atlas-dev:
atlas accesslogs list --hostname atlas-dqrlj4-shard-00-00.g1nxq.mongodb-dev.net --profile atlas-dev --output json

4 changes: 2 additions & 2 deletions docs/command/atlas-dataFederation-queryLimits-list.txt
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,6 @@ Examples
.. code-block::
:copyable: false

# list all data federation query limits:
atlas dataFederation queryLimits list
# list all data federation query limits for the database federated instance "myInstance":
atlas dataFederation queryLimits list --dataFederation myInstance

9 changes: 7 additions & 2 deletions internal/cli/accesslogs/list.go
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ func (opts *ListOpts) ValidateInput() error {
return nil
}

// atlas accessLogs(s) list|ls [--projectId projectId] [--clusterName clusterName] [--start start] [--end end] [--nLogs nLogs] [--ipAddress ipAddress] [--authResult success|fail].
// ListBuilder represents atlas accessLogs(s) list|ls [--projectId projectId] [--clusterName clusterName] [--start start] [--end end] [--nLogs nLogs] [--ipAddress ipAddress] [--authResult success|fail].
func ListBuilder() *cobra.Command {
opts := &ListOpts{}
cmd := &cobra.Command{
Expand All @@ -114,7 +114,11 @@ func ListBuilder() *cobra.Command {
Long: fmt.Sprintf(usage.RequiredRole, "Project Monitoring Admin"),
Args: require.NoArgs,
Example: ` # Return a JSON-formatted list of all authentication requests made against the cluster named Cluster0 for the project with ID 618d48e05277a606ed2496fe:
atlas accesslogs list --output json --projectId 618d48e05277a606ed2496fe --clusterName Cluster0`,
atlas accesslogs list --output json --projectId 618d48e05277a606ed2496fe --clusterName Cluster0
# Return a JSON-formatted list of all authentication requests made against the hostname named atlas-dqrlj4-shard-00-00.g1nxq.mongodb-dev.net for the project stored in the profile atlas-dev:
atlas accesslogs list --hostname atlas-dqrlj4-shard-00-00.g1nxq.mongodb-dev.net --profile atlas-dev --output json
`,
PreRunE: func(cmd *cobra.Command, _ []string) error {
return opts.PreRunE(
opts.ValidateInput,
Expand All @@ -136,6 +140,7 @@ func ListBuilder() *cobra.Command {
cmd.Flags().StringVar(&opts.authResult, flag.AuthResult, "", usage.AuthResult)
cmd.Flags().StringVar(&opts.ProjectID, flag.ProjectID, "", usage.ProjectID)
cmd.Flags().StringVarP(&opts.Output, flag.Output, flag.OutputShort, "", usage.FormatOut)

cmd.MarkFlagsMutuallyExclusive(flag.ClusterName, flag.Hostname)
cmd.MarkFlagsOneRequired(flag.ClusterName, flag.Hostname)

Expand Down
6 changes: 3 additions & 3 deletions internal/cli/datafederation/querylimits/list.go
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ func (opts *ListOpts) Run() error {
return opts.Print(r)
}

// atlas dataFederation queryLimits list [--projectId projectId].
// ListBuilder represents atlas dataFederation queryLimits list [--projectId projectId].
func ListBuilder() *cobra.Command {
opts := &ListOpts{}
cmd := &cobra.Command{
Expand All @@ -67,8 +67,8 @@ func ListBuilder() *cobra.Command {
Long: fmt.Sprintf(usage.RequiredRole, "Project Read Only"),
Aliases: []string{"ls"},
Args: require.NoArgs,
Example: `# list all data federation query limits:
atlas dataFederation queryLimits list
Example: `# list all data federation query limits for the database federated instance "myInstance":
atlas dataFederation queryLimits list --dataFederation myInstance
`,
PreRunE: func(cmd *cobra.Command, _ []string) error {
return opts.PreRunE(
Expand Down
4 changes: 2 additions & 2 deletions internal/cli/datalakepipelines/availableschedules/list.go
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ func (opts *ListOpts) Run() error {
return opts.Print(r)
}

// atlas dataLakePipelines availableSchedules list [--projectId projectId].
// ListBuilder represents atlas dataLakePipelines availableSchedules list [--projectId projectId].
func ListBuilder() *cobra.Command {
opts := &ListOpts{}
cmd := &cobra.Command{
Expand All @@ -67,7 +67,7 @@ func ListBuilder() *cobra.Command {
Aliases: []string{"ls"},
Args: require.NoArgs,
Example: `# list available schedules for data lake pipeline called 'Pipeline1':
atlas dataLakePipelines availableSchedules list Pipeline1
atlas dataLakePipelines availableSchedules list --pipeline Pipeline1
`,
PreRunE: func(cmd *cobra.Command, _ []string) error {
return opts.PreRunE(
Expand Down
4 changes: 2 additions & 2 deletions internal/cli/datalakepipelines/availablesnapshots/list.go
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ func (opts *ListOpts) Run() error {
return opts.Print(r)
}

// atlas dataLakePipelines availableSnapshots list [--projectId projectId].
// ListBuilder represents atlas dataLakePipelines availableSnapshots list [--projectId projectId].
func ListBuilder() *cobra.Command {
opts := &ListOpts{}
cmd := &cobra.Command{
Expand All @@ -89,7 +89,7 @@ func ListBuilder() *cobra.Command {
Aliases: []string{"ls"},
Args: require.NoArgs,
Example: `# list available backup schedules for data lake pipeline called 'Pipeline1':
atlas dataLakePipelines availableSnapshots list Pipeline1
atlas dataLakePipelines availableSnapshots list --pipeline Pipeline1
`,
PreRunE: func(cmd *cobra.Command, _ []string) error {
return opts.PreRunE(
Expand Down
4 changes: 2 additions & 2 deletions internal/cli/datalakepipelines/runs/list.go
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ func (opts *ListOpts) Run() error {
return opts.Print(r)
}

// atlas dataLakePipelines runs list [--projectId projectId].
// ListBuilder represents atlas dataLakePipelines runs list [--projectId projectId].
func ListBuilder() *cobra.Command {
opts := &ListOpts{}
cmd := &cobra.Command{
Expand All @@ -69,7 +69,7 @@ func ListBuilder() *cobra.Command {
Aliases: []string{"ls"},
Args: require.NoArgs,
Example: `# list all pipeline runs:
atlas dataLakePipelines runs list
atlas dataLakePipelines runs list --pipeline Pipeline1
`,
PreRunE: func(cmd *cobra.Command, _ []string) error {
return opts.PreRunE(
Expand Down
2 changes: 1 addition & 1 deletion internal/cli/search/nodes/list.go
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ func (opts *ListOpts) Run() error {
return opts.Print(r)
}

// atlas clusters search nodes list [--projectId projectId] [--clusterName name].
// ListBuilder represents atlas clusters search nodes list [--projectId projectId] [--clusterName name].
func ListBuilder() *cobra.Command {
opts := &ListOpts{}
cmd := &cobra.Command{
Expand Down

0 comments on commit e4f4ced

Please sign in to comment.