Docs Menu

Atlas 조직 apiKeys 할당

지정된 조직 API 키에 대한 역할 또는 설명을 수정합니다.

이 명령으로 조직 API 키의 역할을 수정하면 지정한 값이 API 키에 할당된 기존 역할을 덮어씁니다.

apiKeyId 인수에 사용할 수 있는 값을 보려면 atlas 조직 apiKeys 목록을 실행합니다.

이 명령을 사용하려면 조직 사용자 관리자 역할이 있는 사용자 계정 또는 API 키로 인증해야 합니다.

명령 구문
atlas organizations apiKeys assign <apiKeyId> [options]
이름
유형
필수 사항
설명

apiKeyId

문자열

true

API 키를 식별하는 고유한 24자리 문자열입니다.

이름
유형
필수 사항
설명

--desc

문자열

거짓

API 키에 대한 설명입니다.

-h, --help

거짓

할당 도움말

--orgId

문자열

거짓

사용할 조직 ID입니다. 이 옵션은 구성 파일 또는 환경 변수의 설정을 재정의합니다.

-o, --output

문자열

거짓

출력 형식입니다. 유효한 값은 json, json-path, go-템플릿 또는 go-템플릿 파일입니다. 전체 출력을 보려면 -o json 옵션을 사용합니다.

--role

strings

거짓

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.

이름
유형
필수 사항
설명

-P, --profile

문자열

거짓

구성 파일에서 사용할 프로필의 이름입니다. Atlas CLI의 프로필에 대해 자세히 알아보려면 https://dochub.mongodb.org/core/atlas-cli-save-connection-settings를 참조하세요.

명령이 성공하면 Atlas CLI는 다음 샘플과 유사한 출력을 반환합니다. 괄호 안의 값은 사용자의 값을 나타냅니다.

API Key '<Id>' successfully updated.
# 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