Modifique os roles ou a descrição da chave de API da organização especificada.
Ao modificar os roles de uma chave de API da organização com esse comando, os valores especificados substituem os roles existentes atribuídos à chave de API.
Para visualizar possíveis valores para o argumento apiKeyId, execute a Atlas organização apiKeys list.
Para usar esse comando, você deve se autenticar com uma conta de usuário ou uma chave de API com a role de administrador do usuário da organização.
Sintaxe
atlas organizations apiKeys assign <apiKeyId> [options]
argumentos
Nome | Tipo | Obrigatório | Descrição |
---|---|---|---|
apiKeyId | string | true | Sequência única de 24 dígitos que identifica sua chave API. |
Opções
Nome | Tipo | Obrigatório | Descrição |
---|---|---|---|
--desc | string | false | Descrição da chave API. |
-h, --help | false | ajuda para atribuir | |
--orgId | string | false | ID da organização a ser usada. Esta opção substitui as configurações no arquivo de configuração ou variável de ambiente. |
-o, --output | string | false | Formato de saída. Os valores válidos são JSON, json-path, go-template ou go-template-file. Para ver o resultado completo, use a opção -o JSON. |
--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. For the full list of accepted values, see the Items Enum for the corresponding Atlas API endpoint: https://www.mongodb.com/pt-br/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. |
Opções herdadas
Nome | Tipo | Obrigatório | Descrição |
---|---|---|---|
-P, --profile | string | false | Nome do perfil a ser usado no arquivo de configuração. Para saber mais sobre perfis para o Atlas CLI, consulte https://dochub.mongodb.org/core/atlas-cli-save-connection-settings. |
Saída
Se o comando for bem-sucedido, a CLI retornará uma saída semelhante à amostra a seguir. Os valores entre colchetes representam seus valores.
API Key '<Id>' successfully updated.
Exemplos
# Modify the role and description for the API key with the ID 5f24084d8dbffa3ad3f21234 for the organization with the ID 5a1b39eec902201990f12345: atlas organizations apiKeys assign 5f24084d8dbffa3ad3f21234 --role ORG_MEMBER --desc "User1 Member Key" --orgId 5a1b39eec902201990f12345 --output json