All Products
Search
Document Center

Elastic Compute Service:ModifyInstanceClockOptions

更新時間:Nov 26, 2025

Modifies the instance clock options.

Operation description

When you call this operation, note that:

  • This is an asynchronous operation. The ID of the asynchronous task is returned after the call. Query the asynchronous task result to determine whether the execution is complete.
  • To modify the PtpStatus parameter, you must specify the parameter. The instance types that are supported. You can query the instance type list ( DescribeInstanceTypes ).

Debugging

You can run this interface directly in OpenAPI Explorer, saving you the trouble of calculating signatures. After running successfully, OpenAPI Explorer can automatically generate SDK code samples.

Authorization information

The following table shows the authorization information corresponding to the API. The authorization information can be used in the Action policy element to grant a RAM user or RAM role the permissions to call this API operation. Description:

  • Operation: the value that you can use in the Action element to specify the operation on a resource.
  • Access level: the access level of each operation. The levels are read, write, and list.
  • Resource type: the type of the resource on which you can authorize the RAM user or the RAM role to perform the operation. Take note of the following items:
    • For mandatory resource types, indicate with a prefix of * .
    • If the permissions cannot be granted at the resource level, All Resources is used in the Resource type column of the operation.
  • Condition Key: the condition key that is defined by the cloud service.
  • Associated operation: other operations that the RAM user or the RAM role must have permissions to perform to complete the operation. To complete the operation, the RAM user or the RAM role must have the permissions to perform the associated operations.
OperationAccess levelResource typeCondition keyAssociated operation
ecs:ModifyInstanceClockOptionsupdate
*All Resources
*
    none
none

Request parameters

ParameterTypeRequiredDescriptionExample
ClientTokenstringNo

The client token that is used to ensure the idempotence of the request.

123e4567-e89b-12d3-a456-426655440000
RegionIdstringYes

The region ID of the instance. You can call the DescribeRegions operation to query the most recent region list.

cn-hangzhou
InstanceIdstringYes

The ID of the instance.

i-bp67acfmxazb4ph****
PtpStatusstringNo

PTP status value. Valid values:

  • enabled
  • disabled

Default value: disabled.

enabled
DryRunbooleanNo

Specifies whether to perform only a dry run. Valid values:

  • true: performs only a dry run. The system checks the request for potential issues, including invalid AccessKey pairs, unauthorized Resource Access Management (RAM) users, and missing parameter values. Otherwise, an error message is returned. If the request passes the dry run, the DryRunOperation error code is returned.
  • false: performs a dry run and performs the actual request. If the request passes the dry run, a 2xx HTTP status code is returned and the operation is performed.

Default value: false.

false

Response parameters

ParameterTypeDescriptionExample
object

The returned information.

RequestIdstring

The ID of the request.

473469C7-AA6F-4DC5-B3DB-A3DC0DE3C83E
TaskIdstring

The ID of the modification task.

You can call the DescribeTasks operation to query the modification results.

t-bp1hvgwromzv32iq****

Examples

Sample success responses

JSONformat

{
  "RequestId": "473469C7-AA6F-4DC5-B3DB-A3DC0DE3C83E",
  "TaskId": "t-bp1hvgwromzv32iq****"
}

Error codes

HTTP status codeError codeError messageDescription
400InvalidInstanceId.NotFoundThe specified instanceId does not exist.The specified instance does not exist.
400InvalidParameter.ClientTokenThe parameter ClientToken is invalid.The specified parameter ClientToken is invalid.
400InvalidParameter.PtpStatusThe specified parameter PtpStatus: %s is not valid.The specified parameter PtpStatus: %s is not valid.
400InvalidInstanceType.NotSupportEnablePtpThe specified instance type does not support enable PTP.The specified instance type does not support enable PTP.
403Abs.InvalidRegionId.MalFormedThe specified parameter RegionId is not valid.The specified parameter RegionId is illegal.
403InvalidOperation.PtpStatusAlreadyEnabledThe specified instance already has PTP enabled.The specified instance already has PTP enabled.
403InvalidOperation.PtpStatusAlreadyDisabledThe specified instance does not have PTP enabled.The specified instance does not have PTP enabled.
403OperationDenied.HardwareNotSupportEnablePtpThe hardware of the instance does not support enable PTP.The hardware of the specified instance does not support enabling PTP. Shut down and enable PTP before starting the instance.
403OperationDenied.ClockPtpNoStockThe resource of PTP is out of usage.The resource of PTP is out of usage.

For a list of error codes, visit the Service error codes.