All Products
Search
Document Center

Bastionhost:ImportKMSSecretsForHost

Last Updated:Mar 30, 2026

Imports KMS secrets for a specified host.

Try it now

Try this API in OpenAPI Explorer, no manual signing needed. Successful calls auto-generate SDK code matching your parameters. Download it with built-in credential security for local usage.

Test

RAM authorization

No authorization for this operation. If you encounter issues with this operation, contact technical support.

Request syntax

POST  HTTP/1.1

Request parameters

Parameter

Type

Required

Description

Example

InstanceId

string

No

The ID of the Bastionhost instance.

Note

You can call the DescribeInstances operation to obtain this parameter.

bastionhost-cn-st220aw****

RegionId

string

No

The region ID of the Bastionhost instance.

Note

For more information about region IDs and names, see Regions and availability zones.

cn-hangzhou

Secrets

array<object>

No

The KMS secrets to import.

object

No

SecretName

string

No

The name of the KMS secret.

secret

SecretType

string

No

The type of the KMS secret. Valid values:

  • ECS: an ECS credential.

ECS

HostId

integer

Yes

The ID of the host to import the KMS secrets to.

Note

Only ECS hosts can import KMS secrets. You can call the ListHosts operation to obtain this parameter.

1

Response elements

Element

Type

Description

Example

object

The data returned by the request.

RequestId

string

The request ID.

EC9BF0F4-8983-491A-BC8C-1B4DD94976DE

SuccessCount

integer

The number of secrets that were successfully imported.

1

Results

array<object>

The import result for each secret.

object

The import result for the secret.

SecretName

string

The name of the secret.

test1

Code

string

The status code.

200

Message

string

The result message.

success

Examples

Success response

JSON format

{
  "RequestId": "EC9BF0F4-8983-491A-BC8C-1B4DD94976DE",
  "SuccessCount": 1,
  "Results": [
    {
      "SecretName": "test1",
      "Code": "200",
      "Message": "success"
    }
  ]
}

Error codes

See Error Codes for a complete list.

Release notes

See Release Notes for a complete list.