Skip to content

Commit

Permalink
(DOCSP-47322) [CLI] Update --role flag description to link to API doc…
Browse files Browse the repository at this point in the history
…s and User Roles page (#3689)
  • Loading branch information
elyse-mdb authored Mar 5, 2025
1 parent a2e4a5c commit 37f565e
Show file tree
Hide file tree
Showing 10 changed files with 16 additions and 14 deletions.
2 changes: 1 addition & 1 deletion docs/command/atlas-organizations-apiKeys-assign.txt
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ Options
* - --role
- strings
- false
- Role or roles that you want to assign to the API key. To assign more than one role, specify each role with a separate role flag or specify all of the roles as a comma-separated list using one role flag. To learn which values the CLI accepts, see the Items Enum for roles in the Atlas API spec: https://www.mongodb.com/docs/atlas/reference/api-resources-spec/v2/#tag/Programmatic-API-Keys/operation/createApiKey. Passing this flag replaces preexisting data.
- Role or roles that you want to assign to the API key. To assign more than one role, specify each role with a separate role flag or specify all of the roles as a comma-separated list using one role flag. For the full list of accepted values, see the Items Enum for the corresponding Atlas API endpoint: https://www.mongodb.com/docs/atlas/reference/api-resources-spec/v2/#tag/Programmatic-API-Keys/operation/updateApiKey. To learn more about organization level user roles, see: https://dochub.mongodb.org/core/atlas-org-roles. Passing this flag replaces preexisting data.

Inherited Options
-----------------
Expand Down
2 changes: 1 addition & 1 deletion docs/command/atlas-organizations-apiKeys-create.txt
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ Options
* - --role
- strings
- true
- Role or roles that you want to assign to the API key. To assign more than one role, specify each role with a separate role flag or specify all of the roles as a comma-separated list using one role flag. To learn which values the CLI accepts, see the Items Enum for roles in the Atlas API spec: https://www.mongodb.com/docs/atlas/reference/api-resources-spec/v2/#tag/Programmatic-API-Keys/operation/createApiKey.
- Role or roles that you want to assign to the API key. To assign more than one role, specify each role with a separate role flag or specify all of the roles as a comma-separated list using one role flag. For the full list of accepted values, see the Items Enum for the corresponding Atlas API endpoint: https://www.mongodb.com/docs/atlas/reference/api-resources-spec/v2/#tag/Programmatic-API-Keys/operation/createApiKey. To learn more about organization level user roles, see: https://dochub.mongodb.org/core/atlas-org-roles.

Inherited Options
-----------------
Expand Down
4 changes: 2 additions & 2 deletions docs/command/atlas-organizations-create.txt
Original file line number Diff line number Diff line change
Expand Up @@ -56,11 +56,11 @@ Options
* - --apiKeyDescription
- string
- false
- Description of the API key.Required when creating organizations authenticated with API Keys.
- Description of the API key. Required when creating organizations authenticated with API Keys.
* - --apiKeyRole
- strings
- false
- Role or roles that you want to assign to the API key. To assign more than one role, specify each role with a separate role flag or specify all of the roles as a comma-separated list using one role flag. To learn which values the CLI accepts, see the Items Enum for roles in the Atlas API spec: https://www.mongodb.com/docs/atlas/reference/api-resources-spec/v2/#tag/Programmatic-API-Keys/operation/createApiKey.Required when creating organizations authenticated with API Keys.
- Role or roles that you want to assign to the API key. To assign more than one role, specify each role with a separate role flag or specify all of the roles as a comma-separated list using one role flag. For the full list of accepted values, see the Items Enum for the corresponding Atlas API endpoint: https://www.mongodb.com/docs/atlas/reference/api-resources-spec/v2/#tag/Programmatic-API-Keys/operation/createApiKey. To learn more about organization level user roles, see: https://dochub.mongodb.org/core/atlas-org-roles. Required when creating organizations authenticated with API Keys.
* - --federationSettingsId
- string
- false
Expand Down
2 changes: 1 addition & 1 deletion docs/command/atlas-projects-apiKeys-assign.txt
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ Options
* - --role
- strings
- true
- Role or roles that you want to assign to the API key. To assign more than one role, specify each role with a separate role flag or specify all of the roles as a comma-separated list using one role flag. To learn which values the CLI accepts, see the Items Enum for roles in the Atlas API spec: https://www.mongodb.com/docs/atlas/reference/api-resources-spec/v2/#tag/Programmatic-API-Keys/operation/createProjectApiKey.
- Role or roles that you want to assign to the API key. To assign more than one role, specify each role with a separate role flag or specify all of the roles as a comma-separated list using one role flag. For the full list of accepted values, see the Items Enum for the corresponding Atlas API endpoint: https://www.mongodb.com/docs/atlas/reference/api-resources-spec/v2/#tag/Programmatic-API-Keys/operation/addProjectApiKey. To learn more about project level user roles, see: https://dochub.mongodb.org/core/atlas-proj-roles.

Inherited Options
-----------------
Expand Down
2 changes: 1 addition & 1 deletion docs/command/atlas-projects-apiKeys-create.txt
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ Options
* - --role
- strings
- true
- Role or roles that you want to assign to the API key. To assign more than one role, specify each role with a separate role flag or specify all of the roles as a comma-separated list using one role flag. To learn which values the CLI accepts, see the Items Enum for roles in the Atlas API spec: https://www.mongodb.com/docs/atlas/reference/api-resources-spec/v2/#tag/Programmatic-API-Keys/operation/createProjectApiKey.
- Role or roles that you want to assign to the API key. To assign more than one role, specify each role with a separate role flag or specify all of the roles as a comma-separated list using one role flag. For the full list of accepted values, see the Items Enum for the corresponding Atlas API endpoint: https://www.mongodb.com/docs/atlas/reference/api-resources-spec/v2/#tag/Programmatic-API-Keys/operation/createProjectApiKey. To learn more about project level user roles, see: https://dochub.mongodb.org/core/atlas-proj-roles.

Inherited Options
-----------------
Expand Down
2 changes: 1 addition & 1 deletion internal/cli/organizations/apikeys/create.go
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ func CreateBuilder() *cobra.Command {
},
}

cmd.Flags().StringSliceVar(&opts.roles, flag.Role, []string{}, usage.APIKeyRoles)
cmd.Flags().StringSliceVar(&opts.roles, flag.Role, []string{}, usage.CreateAPIKeyRoles)
cmd.Flags().StringVar(&opts.desc, flag.Description, "", usage.APIKeyDescription)

opts.AddOrgOptFlags(cmd)
Expand Down
2 changes: 1 addition & 1 deletion internal/cli/organizations/apikeys/update.go
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ To view possible values for the apiKeyId argument, run atlas organizations apiKe
},
}

cmd.Flags().StringSliceVar(&opts.roles, flag.Role, []string{}, usage.APIKeyRoles+usage.UpdateWarning)
cmd.Flags().StringSliceVar(&opts.roles, flag.Role, []string{}, usage.UpdateAPIKeyRoles+usage.UpdateWarning)
cmd.Flags().StringVar(&opts.desc, flag.Description, "", usage.APIKeyDescription)

opts.AddOrgOptFlags(cmd)
Expand Down
2 changes: 1 addition & 1 deletion internal/cli/projects/apikeys/assign.go
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ To view possible values for the ID argument, run atlas organizations apiKeys lis
},
}

cmd.Flags().StringSliceVar(&opts.roles, flag.Role, []string{}, usage.ProjectAPIKeyRoles)
cmd.Flags().StringSliceVar(&opts.roles, flag.Role, []string{}, usage.AddProjectAPIKeyRoles)

opts.AddProjectOptsFlags(cmd)

Expand Down
2 changes: 1 addition & 1 deletion internal/cli/projects/apikeys/create.go
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ func CreateBuilder() *cobra.Command {
},
}

cmd.Flags().StringSliceVar(&opts.roles, flag.Role, []string{}, usage.ProjectAPIKeyRoles)
cmd.Flags().StringSliceVar(&opts.roles, flag.Role, []string{}, usage.CreateProjectAPIKeyRoles)
cmd.Flags().StringVar(&opts.description, flag.Description, "", usage.APIKeyDescription)

opts.AddProjectOptsFlags(cmd)
Expand Down
10 changes: 6 additions & 4 deletions internal/usage/usage.go
Original file line number Diff line number Diff line change
Expand Up @@ -143,10 +143,12 @@ dbName and collection are required only for built-in roles.`
OrgNameFilter = "Organization name to perform a case-insensitive search for."
OrgIncludeDeleted = "Flag that indicates whether to include deleted organizations in the list. This option applies only to Ops Manager organizations. You can't return deleted Atlas or Cloud Manager organizations."
APIKeyDescription = "Description of the API key."
AtlasAPIKeyDescription = APIKeyDescription + requiredForAtlas
APIKeyRoles = "Role or roles that you want to assign to the API key. To assign more than one role, specify each role with a separate role flag or specify all of the roles as a comma-separated list using one role flag. To learn which values the CLI accepts, see the Items Enum for roles in the Atlas API spec: https://www.mongodb.com/docs/atlas/reference/api-resources-spec/v2/#tag/Programmatic-API-Keys/operation/createApiKey." //nolint:gosec // This is just a message not a credential
ProjectAPIKeyRoles = "Role or roles that you want to assign to the API key. To assign more than one role, specify each role with a separate role flag or specify all of the roles as a comma-separated list using one role flag. To learn which values the CLI accepts, see the Items Enum for roles in the Atlas API spec: https://www.mongodb.com/docs/atlas/reference/api-resources-spec/v2/#tag/Programmatic-API-Keys/operation/createProjectApiKey." //nolint:gosec // This is just a message not a credential
AtlasAPIKeyRoles = APIKeyRoles + requiredForAtlas
AtlasAPIKeyDescription = APIKeyDescription + " " + requiredForAtlas
CreateProjectAPIKeyRoles = "Role or roles that you want to assign to the API key. To assign more than one role, specify each role with a separate role flag or specify all of the roles as a comma-separated list using one role flag. For the full list of accepted values, see the Items Enum for the corresponding Atlas API endpoint: https://www.mongodb.com/docs/atlas/reference/api-resources-spec/v2/#tag/Programmatic-API-Keys/operation/createProjectApiKey. To learn more about project level user roles, see: https://dochub.mongodb.org/core/atlas-proj-roles." //nolint:gosec // This is just a message not a credential
AddProjectAPIKeyRoles = "Role or roles that you want to assign to the API key. To assign more than one role, specify each role with a separate role flag or specify all of the roles as a comma-separated list using one role flag. For the full list of accepted values, see the Items Enum for the corresponding Atlas API endpoint: https://www.mongodb.com/docs/atlas/reference/api-resources-spec/v2/#tag/Programmatic-API-Keys/operation/addProjectApiKey. To learn more about project level user roles, see: https://dochub.mongodb.org/core/atlas-proj-roles." //nolint:gosec // This is just a message not a credential
CreateAPIKeyRoles = "Role or roles that you want to assign to the API key. To assign more than one role, specify each role with a separate role flag or specify all of the roles as a comma-separated list using one role flag. For the full list of accepted values, see the Items Enum for the corresponding Atlas API endpoint: https://www.mongodb.com/docs/atlas/reference/api-resources-spec/v2/#tag/Programmatic-API-Keys/operation/createApiKey. To learn more about organization level user roles, see: https://dochub.mongodb.org/core/atlas-org-roles." //nolint:gosec // This is just a message not a credential
UpdateAPIKeyRoles = "Role or roles that you want to assign to the API key. To assign more than one role, specify each role with a separate role flag or specify all of the roles as a comma-separated list using one role flag. For the full list of accepted values, see the Items Enum for the corresponding Atlas API endpoint: https://www.mongodb.com/docs/atlas/reference/api-resources-spec/v2/#tag/Programmatic-API-Keys/operation/updateApiKey. To learn more about organization level user roles, see: https://dochub.mongodb.org/core/atlas-org-roles." //nolint:gosec // This is just a message not a credential
AtlasAPIKeyRoles = CreateAPIKeyRoles + " " + requiredForAtlas
NotificationRegion = "Region that indicates which API URL to use."
NotificationDelayMin = "Number of minutes to wait after an alert condition is detected before sending out the first notification."
NotificationEmailAddress = "Email address to which alert notifications are sent."
Expand Down

0 comments on commit 37f565e

Please sign in to comment.