Querying the KMS Key Bound to a Topic
Function
This API is used to query the ID of the key bound to a topic. Before binding a KMS key, create an agency named smn_kms_agency on IAM and assign resource operation permissions to SMN. SMN uses this agency to query key information.
Calling Method
For details, see Calling APIs.
Authorization Information
Each account has all the permissions required to call all APIs, but IAM users must be assigned the required permissions.
- If you are using role/policy-based authorization, see Permissions Policies and Supported Actions for details on the required permissions.
- If you are using identity policy-based authorization, the following identity policy-based permissions are required.
Action
Access Level
Resource Type (*: required)
Condition Key
Alias
Dependencies
smn:topic:getKmsKey
List
topic *
-
g:EnterpriseProjectId
-
g:ResourceTag/<tag-key>
-
smn:topic:get
-
URI
GET /v2/{project_id}/notifications/topics/{topic_urn}/kms
|
Parameter |
Mandatory |
Type |
Description |
|---|---|---|---|
|
project_id |
Yes |
String |
The project ID. For details about how to obtain the project ID, see Obtaining a Project ID. |
|
topic_urn |
Yes |
String |
The unique resource identifier of a topic. To obtain the resource identifier, see Querying Topics. |
Request Parameters
|
Parameter |
Mandatory |
Type |
Description |
|---|---|---|---|
|
X-Auth-Token |
Yes |
String |
Specifies a user token. It can be obtained by calling an IAM API. The value of X-Subject-Token in the response header is the user token. |
Response Parameters
Status code: 200
|
Parameter |
Type |
Description |
|---|---|---|
|
key_id |
String |
The ID of the customer master key created on DEW. For details, see Creating a Key. |
|
status |
String |
The key status. Options:
|
|
id |
String |
The resource ID corresponding to the key. It is generated by SMN. |
|
request_id |
String |
Specifies the request ID, which is unique. |
Status code: 403
|
Parameter |
Type |
Description |
|---|---|---|
|
request_id |
String |
Specifies the request ID, which is unique. |
|
code |
String |
Specifies the error code. |
|
message |
String |
Describes the error message. |
Status code: 404
|
Parameter |
Type |
Description |
|---|---|---|
|
request_id |
String |
Specifies the request ID, which is unique. |
|
code |
String |
Specifies the error code. |
|
message |
String |
Describes the error message. |
Status code: 500
|
Parameter |
Type |
Description |
|---|---|---|
|
request_id |
String |
Specifies the request ID, which is unique. |
|
code |
String |
Specifies the error code. |
|
message |
String |
Describes the error message. |
Example Requests
Example for a successful request
https://{SMN_Endpoint}/v2/{project_id}/notifications/topics/urn:smn:regionId:44ef0bd78eb24f02b40614fe85a7d234:topic_05721ee8904211f0871f84a93e8ae4b6/kms
Example Responses
Status code: 200
Response body returned when the request succeeded.
{
"key_id" : "9a618041-a917-49e0-bb3a-1a90163e97fe",
"status" : "ENABLED",
"id" : "d39453da9d6c4026ba0bb3ed1a6efc2d",
"request_id" : "c16810962f1140da82abcd9e783cf4e2"
}
Status code: 403
Forbidden
{
"request_id" : "c7da9c96193c4017b6d2250477107416",
"code" : "SMN.0001",
"message" : "No permission to request resources."
}
Status code: 404
Not Found
{
"request_id" : "135be5478b594200be295f6603f223bd",
"error_code" : "SMN.00010008",
"error_msg" : "Topic information is not found."
}
Status Codes
|
Status Code |
Description |
|---|---|
|
200 |
Response body returned when the request succeeded. |
|
403 |
Forbidden |
|
404 |
Not Found |
|
500 |
Internal Server Error |
Error Codes
See Error Codes.
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
For any further questions, feel free to contact us through the chatbot.
Chatbot