You need to enable JavaScript to run this app.
Key Management System

Key Management System

Copy page
Download PDF
Secret manager
SetSecretValue - store secret value
Copy page
Download PDF
SetSecretValue - store secret value

store secret value

debug

request parameters

The following table lists only the request parameters specific to this interface and some common parameters. For more information, see common parameters.

const columns = [ 
  { 
    width: '20%', 
title: 'Parameter', 
    dataIndex: 'Name', 
    className: 'openapi-doc-parameter-table-name' 
  }, 
  { 
    width: 130, 
title: 'Type', 
    dataIndex: 'DataType', 
    className: 'openapi-doc-parameter-table-type' 
  }, 
  { 
    width: 90, 
title: 'Required', 
    dataIndex: 'IsRequired', 
    className: 'openapi-doc-parameter-table-required' 
  }, 
  { 
    width: '20%', 
title: 'Example Value', 
    dataIndex: 'Example', 
    className: 'openapi-doc-parameter-table-example' 
  }, 
  { 
title: 'Description', 
    dataIndex: 'Description', 
    className: 'openapi-doc-parameter-table-description' 
  }, 
]; 

const data = [ 
  { 
    rowKey: '->Action', 
    Name: 'Action', 
    DataType: 'String', 
IsRequired: 'yes', 
    Example: <RenderMd content={"SetSecretValue"} />, 
Description: <RenderMd content={"Operation to perform, value: SetSecretValue."} />, 
    children: [ 
    ] 
  }, 
  { 
    rowKey: '->Version', 
    Name: 'Version', 
    DataType: 'String', 
IsRequired: 'yes', 
    Example: <RenderMd content={"2021-02-18"} />, 
Description: <RenderMd content={"API version, value: 2021-02-18."} />, 
    children: [ 
    ] 
  }, 
  { 
    rowKey: '->SecretName', 
    Name: 'SecretName', 
    DataType: 'String', 
IsRequired: 'yes', 
    Example: <RenderMd content={"secret-9527"} />, 
Description: <RenderMd content={"secret name, length 2 to 128 characters. Valid characters: [a-zA-Z0-9/_+=.@-]"} />, 
    children: [ 
    ] 
  }, 
  { 
    rowKey: '->SecretValue', 
    Name: 'SecretValue', 
    DataType: 'String', 
IsRequired: 'yes', 
    Example: <RenderMd content={"{"username":"root","password":"123456"}"} />, 
Description: <RenderMd content={"Secret value, length not exceeding 30,720 bytes."} User-defined, recommended to use key-value pairs in JSON format. "} />, 
    children: [ 
    ] 
  }, 

]; 

return (<Table 
  rowKey="rowKey" 
  className="openapi-doc-parameter-table" 
  columns={columns} 
  data={data} 
  border={ { cell: true, wrapper: true } } 
  scroll={ { x: "auto" } } 
  pagination={false} 
/>);

Return parameters

The table below lists only the return parameters specific to this interface. For more information, see return structure.

Parameter
Type
Example Value
Description
VersionID
String

54487470-102a-4f35-bfb1-b819e78f7579

New version number of the stored secret value

VersionStage
String

CURRENT

New version label for the stored secret value

CreationDate
Long

1723104729

secret version creation time

Request example

POST /?Action=SetSecretValue&Version=2021-02-18 HTTP/1.1 
Host: kms.cn-beijing.volcengineapi.com 
Content-Type: application/json; charset=UTF-8 
X-Date: 20240811T015427Z 
X-Content-Sha256: 287e874e******d653b44d21e 
Authorization: HMAC-SHA256 Credential=Adfks******wekfwe/20240811/cn-beijing/kms/request, SignedHeaders=host;x-content-sha256;x-date, Signature=47a7d934ff7b37c03938******cd7b8278a40a1057690c401e92246a0e41085f 

{ 
  "SecretName": "secret-9527", 
  "SecretValue": "{"username":"root","password":"123456"}" 
}

Response example

{ 
  "ResponseMetadata": { 
    "RequestId": "20240811095501069218106058666D53", 
    "Action": "SetSecretValue", 
    "Version": "2021-02-18", 
    "Service": "kms", 
    "Region": "cn-beijing" 
  }, 
  "Result": { 
    "VersionID": "54487470-102a-4f35-bfb1-b819e78f7579", 
    "VersionStage": "CURRENT", 
    "CreationDate": 1723104729 
  } 
}

Error code

The table below lists error codes related to the business logic of this interface. For common error codes, refer to the Common Error Codes document.

Status Code
Error Code
Error Message
Description
400
InvalidSecretType

The secret type [%s] does not allow to perform this action.

400
InvalidParameter

The request parameter %s is invalid.

403
AccessDenied

User is not authorized to do this action

403
Reject.Throttling.Action

The request of Action: %s upper limit is exceeded.

404
Not Found

Not found %s [%s].

500
UndefinedError

Undefined Internal Error. Pls Contact With Admin.

Last updated: 2025.06.27 15:24:19