Viewing operations with Key Management Service resources
The system logs all actions with Key Management Service resources as a list of operations. Each operation gets its own unique ID.
Getting a list of operations
Below, you can learn how to get a list of operations for a symmetric key. The same steps apply to other resources as well.
-
In the management console
, open the folder containing the symmetric key. -
Select Key Management Service.
-
In the left-hand panel, select
Symmetric keys. -
Select the key you need.
-
Go to the
Operations panel for the selected key.You will see a list of operations with the selected symmetric key.
If you do not have the Yandex Cloud CLI installed yet, install and initialize it.
By default, the CLI uses the folder specified when creating the profile. To change the default folder, use the yc config set folder-id <folder_ID>
command. You can also set a different folder for any specific command using the --folder-name
or --folder-id
parameter.
To get the list of operations for the Key Management Service resource, run this command:
yc kms <resource_type> list-operations <resource_name_or_ID>
Example
Getting a list of operations for the symmetric key:
yc kms symmetric-key list-operations epdplu8jn7sr********
Result:
+----------------------+---------------------+----------------------+---------------------+--------+----------------------+
| ID | CREATED AT | CREATED BY | MODIFIED AT | STATUS | DESCRIPTION |
+----------------------+---------------------+----------------------+---------------------+--------+----------------------+
| abji19ucm6b1******** | 2024-03-26 10:33:12 | aje9k8luj4qf******** | 2024-03-26 10:33:12 | DONE | update key |
| abjluv2sk1sp******** | 2024-03-26 10:19:52 | aje9k8luj4qf******** | 2024-03-26 10:19:52 | DONE | create symmetric key |
+----------------------+---------------------+----------------------+---------------------+--------+----------------------+
By default, operation information is displayed as text. To get more detailed information, specify the yaml
or json
output data format using the --format
parameter:
yc kms symmetric-key list-operations epdplu8jn7sr******** --format yaml
Result:
- id: abji19ucm6b1********
description: update key
created_at: "2024-03-26T10:33:12.360289758Z"
created_by: aje9k8luj4qf********
modified_at: "2024-03-26T10:33:12.360314054Z"
done: true
metadata:
'@type': type.googleapis.com/yandex.cloud.kms.v1.UpdateSymmetricKeyMetadata
key_id: abjip2tl1frh********
response:
'@type': type.googleapis.com/google.protobuf.Empty
value: {}
- id: abjluv2sk1sp********
description: create symmetric key
created_at: "2024-03-26T10:19:52.794225911Z"
created_by: aje9k8luj4qf********
modified_at: "2024-03-26T10:19:52.794265993Z"
done: true
metadata:
'@type': type.googleapis.com/yandex.cloud.kms.v1.CreateSymmetricKeyMetadata
key_id: abjip2tl1frh********
primary_version_id: abjg82vbog68********
response:
'@type': type.googleapis.com/google.protobuf.Empty
value: {}
Use the listOperations
REST API method for the relevant resource or the <service>/ListOperations
gRPC API call.
For example, to obtain a list of operations for a symmetric key, use either the REST API listOperations for the SymmetricKey resource or the SymmetricKeyService/ListOperations gRPC API call.
Getting operation details
-
Get a list of operations for the resource.
-
Copy the operation ID.
-
Get operation details:
CLIAPIIf you do not have the Yandex Cloud CLI installed yet, install and initialize it.
By default, the CLI uses the folder specified when creating the profile. To change the default folder, use the
yc config set folder-id <folder_ID>
command. You can also set a different folder for any specific command using the--folder-name
or--folder-id
parameter.Run this command:
yc operation get <operation_ID>
Result:
id: abji19ucm6b1******** description: update key created_at: "2024-03-26T10:33:12.360Z" created_by: aje9k8luj4qf******** modified_at: "2024-03-26T10:33:12.360Z" done: true metadata: '@type': type.googleapis.com/yandex.cloud.kms.v1.UpdateSymmetricKeyMetadata key_id: abjip2tl1frh******** response: '@type': type.googleapis.com/yandex.cloud.kms.v1.SymmetricKey id: abjip2tl1frh******** folder_id: b1g681qpemb4******** created_at: "2024-03-26T10:19:52Z" name: sym-key status: ACTIVE primary_version: id: abjg82vbog68kv5jvj6s key_id: abjip2tl1frh******** status: ACTIVE algorithm: AES_256 created_at: "2024-03-26T10:19:52Z" primary: true default_algorithm: AES_192
Use the OperationService/Get gRPC API call.