File: //snap/google-cloud-cli/396/lib/surface/iam/service_accounts/keys/disable.yaml
- release_tracks: [ALPHA, BETA, GA]
help_text:
brief: Disable a service account key.
description: |
Disable a service account key.
If the service account does not exist, this command returns a `PERMISSION_DENIED` error.
examples: |
To disable a key with ID `b4f1037aeef9ab37deee9` for the service
account `my-iam-account@my-project.iam.gserviceaccount.com`, run:
{command} b4f1037aeef9ab37deee9 --iam-account=my-iam-account@my-project.iam.gserviceaccount.com
arguments:
resource:
spec: !REF googlecloudsdk.command_lib.iam.resources:iam_key
is_positional: true
help_text: |
The id of the key to disable.
request:
collection: iam.projects.serviceAccounts.keys
method: disable
modify_request_hooks:
- googlecloudsdk.command_lib.iam.hooks:EraseProjectHook
response:
modify_response_hooks:
- googlecloudsdk.command_lib.iam.hooks:DisableIamKeyConfirmation