You need to enable JavaScript to run this app.
Elastic Compute Service

Elastic Compute Service

Copy page
Download PDF
Instances
ModifyInstanceMetadataOptions - Modifies the access mode of instance metadata
Copy page
Download PDF
ModifyInstanceMetadataOptions - Modifies the access mode of instance metadata
Call the ModifyInstanceMetadataOptions operation to modify the access mode of instance metadata.​
Request description​
When you call this operation, if you do not pass in optional parameters, the original configuration is retained.​
Request parameters​
Only the request parameters specific to this operation and some common parameters are listed below. For more information, refer to Common parameters.​
Action string required Sample value: ModifyInstanceMetadataOptions​
The action that you want to perform. Value: ModifyInstanceMetadataOptions.​
​
Version string required Sample value:2020-04-01​
The API version. Value: 2020-04-01.​
​
HttpTokens string Optional Sample value: optional​
The access mode of instance metadata. You can set whether to enable the security hardening mode. Value:​
  • optional: Not mandatory (Normal Mode and Security Hardening Mode). This allows instance metadata access either directly through the standard method or via the token-based authentication method.​
  • required: Mandatory (Security Hardening Mode). This only allows accessing instance metadata through a token-based authentication method.​
tip​
  • Security Hardening Mode is currently in Beta. If you need a trial, please contact your account manager to apply.​
​
InstanceId string required Sample value: i-3tigy72q3u3vj0x2****​
The specified instance ID.​
​
​
​
Response parameters​
This operation has no specific response parameters. For more information, refer to Response structure.​
Sample request​
​
GET /?Action=ModifyInstanceMetadataOptions&Version=2020-04-01&InstanceId=i-3tigy72q3u3vj0x2****&HttpTokens=optional HTTP/1.1​
Host: ecs.cn-beijing.volcengineapi.com​
Region: cn-beijing​
Service: ecs​
​
Sample response​
​
{​
"ResponseMetadata": {​
"RequestId": "20211104180426010194099035220C****",​
"Action": "ModifyInstanceMetadataOptions",​
"Version": "2020-04-01",​
"Service": "ecs",​
"Region": "cn-beijing"​
},​
"Result": {}​
}​
​
​
Error codes​
The table below lists the business-related error codes of the operation. For more information, refer to Common error codes.​
​
Status code​
Error codes​
Error message​
Description​
400​
InvalidHttpTokens.Malformed​
The specified HttpTokens is malformed, you can use optional(default) or required.​
The specified value for HttpTokens is invalid. Please use optional (default) or required.​
400​
InvalidInstanceId.Malformed​
The specified InstanceId is malformed.​
The specified instance ID is invalid.​
400​
InvalidModifyInstanceMetadataOptions.Unsupported​
Modify instance metadata option is not supported.​
This feature has not been enabled for your account. Please contact your account manager to apply for allowlist access.​
400​
MissingParameter.InstanceId​
The required parameter InstanceId is not supplied.​
The parameter InstanceIds cannot be left empty.​
404​
InvalidInstance.NotFound​
The specified instance does not exist.​
The specified instance does not exist.​
​
Last updated: 2026.06.18 17:48:27