Viewing operations with the service's resources
All actions with Key Management Service resources are logged as a list of operations. Each operation is assigned a 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 service resources.
-
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 command line interface yet, install and initialize it.
The folder specified in the CLI profile is used by default. You can specify a different folder using the --folder-name
or --folder-id
parameter.
To get a list of operations for a 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, information about operations is provided as text. To get detailed information, specify the yaml
or json
output data format using the --format
flag:
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 detailed information about an operation
-
Get a list of operations for the resource.
-
Copy the ID of the operation.
-
Get detailed information about the operation:
CLIAPIIf you do not have the Yandex Cloud command line interface yet, install and initialize it.
The folder specified in the CLI profile is used by default. You can specify a different folder 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.