All Products
Search
Document Center

Elastic Compute Service:ModifyInstanceAttachmentAttributes

Last Updated:Dec 17, 2024

The type of the new private pool.

Operation description

A private pool is generated after an elasticity assurance or a capacity reservation is created. The private pool is associated with information about the instances that are created by using the resources in the private pool. When you create ECS instances, you can configure the instances to use private pool resources, matching them to active elasticity assurances or capacity reservations.

  • This operation does not require you to restart the instances for the changes to take effect.

  • When you call the following operations on an instance, the system attempts to match the instance with active private pools. If the instance is configured to a specific private pool. the call may fail because the private pool is no longer active or does not have sufficient resources. If the call fails, call the ModifyInstanceAttachmentAttributes operation to change the match mode of the private pool to Open.

    • StartInstance: starts an instance that is stopped in economical mode.
    • ReActivateInstances
    • ModifyInstanceChargeType
    • ModifyPrepayInstanceSpec
    • ReplaceSystemDisk

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:
    • The required resource types are displayed in bold characters.
    • 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:ModifyInstanceAttachmentAttributesupdate
*All Resources
*
    none
none

Request parameters

ParameterTypeRequiredDescriptionExample
RegionIdstringYes

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

cn-hangzhou
InstanceIdstringYes

The ID of the instance for which you want to modify the attributes of the private pool.

i-bp67acfmxazb4****
PrivatePoolOptions.MatchCriteriastringYes

The match mode of the private pool. Valid values:

  • Open: open private pool. The system matches the instance with open private pools.
  • Target: specified private pool. You must set the PrivatePoolOptions.Id parameter to specify the ID of a private pool.
  • None: no private pool. The instance starts normally without using private pools.
Open
PrivatePoolOptions.IdstringNo

The ID of the private pool. Set the value to the ID of the elasticity assurance or capacity reservation that generates the private pool.

  • This parameter is required when PrivatePoolOptions.MatchCriteria is set to Target.
  • This parameter must be empty when PrivatePoolOptions.MatchCriteria is set to Open or None.
eap-bp67acfmxazb4****

Response parameters

ParameterTypeDescriptionExample
object
RequestIdstring

The ID of the request.

473469C7-AA6F-4DC5-B3DB-A3DC0DE3C83E

Examples

Sample success responses

JSONformat

{
  "RequestId": "473469C7-AA6F-4DC5-B3DB-A3DC0DE3C83E"
}

Error codes

HTTP status codeError codeError messageDescription
400MissingParameter.RegionIdThe specified RegionId should not be null.The RegionId parameter is required.
400MissingParameter.InstanceIdThe specified InstanceId should not be null.-
400InvalidResourcePackage.BizStatusThe resource package business status is not supported.-
400InvalidInstanceId.MalFormedThe specified InstanceId is not valid.-
400DedicatedHostNotSupportedDedicatedHost is not supported for PrivatePool.The private pool does not support dedicated hosts.
400SpotNotSupportedSpot is not supported for PrivatePool.The private pool does not support preemptible instances.
400ClassicNetworkNotSupportedClassic network is not supported for PrivatePool.The private pool does not support instances in the classic network.
400Invalid.InstanceIdInstance does not exist.The specified instance does not exist.
400Invalid.PrivatePoolOptions.MatchCriteriaTarget mode does not support this operation.The operation is not supported while the PrivatePoolOptions.MatchCriteria parameter is set to Target.
400MissingParameter.PrivatePoolOptions.IdThe specified PrivatePoolOptions.Id should not be null.The PrivatePoolOptions.Id parameter is required.
400Invalid.PrivatePoolOptions.IdThe PrivatePool does not exist.The private pool does not exist.
400Invalid.InstanceTypeThe InstanceType does not match the PrivatePool.The instance type and the private pool do not match.
400Invalid.InstanceChargeTypeThe InstanceChargeType does not match the PrivatePool.The instance billing method and the private pool do not match.
400Invalid.ZoneIdThe ZoneId does not match the PrivatePool.The zone and the private pool do not match.
400Invalid.PrivatePoolOptions.NoStockThe PrivatePool has been used up.-
400Invalid.PrivatePoolOptions.MatchCriteriaThe PrivatePoolOptions.MatchCriteria does not match the PrivatePool.The specified PrivatePoolOptions.MatchCriteria parameter does not match the private pool.
400InvalidPlatform.ValueNotSupportedThe Platform does not match the PrivatePool.The specified Platform parameter does not match the private pool.
400Invalid.PrivatePoolOptions.statusThe PrivatePool is expired or inactive.-
400Invalid.PrivatePoolOptions.statusThe PrivatePool status is not valid.-
400Invalid.PrivatePoolOptions.statusThe Instance should be created within 48 hours once the PrivatePool is started.-
400InvalidAliUidThe PrivatePool does not belong to the user of the Instance.The specified private pool does not belong to the user who attempted to create the instance.
400Invalid.InstanceIdThe Instance dose not attached to a PrivatePool.The instance and the private pool do not match.
400MissingParameter.PackageTypeThe specified parameter "PackageType" can not be empty.-
400MissingParameter.PrivatePoolOptions.IdsThe specified parameter "PrivatePoolOptions.Ids" can not be empty.-
400MissingParameter.PrivatePoolOptions.IdThe specified parameter "PrivatePoolOptions.Id" can not be empty.-
400MissingParameter.InstanceCpuCoreCountThe specified parameter "InstanceCpuCoreCount" can not be empty.-
400MissingParameter.InstanceAmountThe specified parameter "InstanceAmount" can not be empty.-
400MissingParameter.InstanceCpuCoreCountOrInstanceAmountThe specified parameter "InstanceCpuCoreCount" and "InstanceAmount" must not be empty at the same time.-
400Invalid.TooManyPrivatePoolOptions.IdsToo many PrivatePoolOptions.Ids in this request.The number of specified private pool IDs exceeds the upper limit.
400Invalid.TooManyZoneIdsToo many ZoneIds in the request.The number of specified zone IDs exceeds the upper limit.
400Invalid.TooManyInstanceTypesToo many InstanceTypes in the request.The number of specified instance types exceeds the upper limit.
400Invalid.TooManyUnpaidPrivatePoolToo many PrivatePools create but still unpaid.Multiple private pools are created but not paid.
400Invalid.InstanceCpuCoreCountOrInstanceAmountBoth InstanceCpuCoreCount and InstanceAmount are provided.The InstanceCpuCoreCount and InstanceAmount parameters cannot be both specified.
400Invalid.PrivatePoolOptions.IdsThe specified parameter "PrivatePoolOptions.Ids" exist invalid element Id.-
400Invalid.PackageTypeThe specified parameter "PackageType" is invalid.-
400Invalid.PrivatePool.PurchaseThe PrivatePool has already paid.The private pool is already paid.
400Invalid.AssuranceTimes.NotSupportedThe value of AssuranceTimes is not supported.The specified AssuranceTimes parameter is invalid.
400Invalid.TooManyInstanceTypesThe specified parameter "InstanceType" should only has one item.-
400Invalid.PrivatePoolOptions.MatchCriteriaThe specified parameter "PrivatePoolOptions.MatchCriteria" is invalid.-
400RepeatStartPrivatePoolPrivatePool has already been started.The private pool is already started.
400Invalid.PrivatePoolOptions.IdThe specified parameter "PrivatePoolOptions.Id" should be empty.-
400Invalid.InstanceIdModify DedicatedHost Instance's attachment attributes is not supported.-
400Invalid.InstanceIdModify Spot Instance's attachment attributes is not supported.-
400Invalid.InstanceIdModify Classic Network Instance's attachment attributes is not supported.-
400Invalid.InstanceIdThe Instance already belongs to this PrivatePool.-
400Invalid.InstanceIdThe instanceId is not found.-
500InternalErrorThe request processing has failed due to some unknown error, exception or failure.An internal error has occurred. Try again later.
500InvalidRegionId.NotFoundThe specified RegionId does not exist.The specified region ID does not exist.

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

Change history

Change timeSummary of changesOperation
No change history