All Products
Search
Document Center

Elastic Compute Service:DescribeDedicatedHostAutoRenew

Last Updated:Nov 14, 2024

Queries the auto-renewal status of subscription dedicated hosts.

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:DescribeDedicatedHostAutoRenewget
*DedicatedHost
acs:ecs:{#regionId}:{#accountId}:ddh/{#ddhId}
    none
none

Request parameters

ParameterTypeRequiredDescriptionExample
DedicatedHostIdsstringYes

The ID of the dedicated host. You can specify up to 100 subscription dedicated host IDs. Separate multiple IDs with commas (,).

dh-bp165p6xk2tlw61e****,dh-bp1f9vxmno****
RegionIdstringYes

The ID of the region where the dedicated host resides.

cn-hangzhou

Response parameters

ParameterTypeDescriptionExample
object
RequestIdstring

The request ID.

04F0F334-1335-436C-A1D7-6C044FE73368
DedicatedHostRenewAttributesarray<object>

The array that consists of dedicated host auto-renewal attributes.

DedicatedHostRenewAttributeobject
PeriodUnitstring

The unit of the auto-renewal duration. Valid values:

  • Week
  • Month
Month
Durationinteger

The auto-renewal period.

0
DedicatedHostIdstring

The ID of the dedicated host.

dh-bp165p6xk2tlw61e****
RenewalStatusstring

Indicates whether the subscription dedicated host is automatically renewed. Valid values:

  • AutoRenewal: The dedicated host is automatically renewed.
  • Normal: The dedicated host is not automatically renewed, but renewal notifications are sent.
  • NotRenewal: The dedicated host is not automatically renewed, and no expiration notification is sent. Alibaba Cloud sends only a non-renewal notice three days before the host expires. If the renewal status of a dedicated host is NotRenewal, you can change the value to Normal and then call RenewDedicatedHosts to manually renew the dedicated host, or directly change the value to AutoRenewal.
Normal
AutoRenewEnabledboolean

Indicates whether auto-renewal is enabled. Valid values:

  • true
  • false
false
AutoRenewWithEcsstring

Indicates whether the dedicated host is automatically renewed if a subscription ECS instance it hosts, after being automatically renewed, has a new expiration time that is later than that of the dedicated host. Valid values:

  • AutoRenewWithEcs: The dedicated host is automatically renewed along with the ECS instance.
  • StopRenewWithEcs: The dedicated host is not automatically renewed along with the ECS instance.
StopRenewWithEcs

Examples

Sample success responses

JSONformat

{
  "RequestId": "04F0F334-1335-436C-A1D7-6C044FE73368",
  "DedicatedHostRenewAttributes": {
    "DedicatedHostRenewAttribute": [
      {
        "PeriodUnit": "Month",
        "Duration": 0,
        "DedicatedHostId": "dh-bp165p6xk2tlw61e****",
        "RenewalStatus": "Normal",
        "AutoRenewEnabled": false,
        "AutoRenewWithEcs": "StopRenewWithEcs"
      }
    ]
  }
}

Error codes

HTTP status codeError codeError messageDescription
403ChargeTypeViolationPay-As-You-Go dedicated host does not support this operation.-
403MissingParameter.DedicatedHostIdDedicatedHostId should not be null.The DedicatedHostId parameter is required.
403InvalidParameter.ToManyDedicatedHostIdsDedicatedHostId should be less than 100.More than 100 dedicated host IDs are specified in the DedicatedHostIds value.
403InvalidParameter.InvalidDedicatedHostId%sThe specified DedicatedHostId parameter is invalid.
403IncorrectDedicatedHostStatusThe current status of the resource does not support this operation.The resource is in a state that does not support the current operation.
403MissingParamter.InstanceIdInstanceId should not be null.The instance ID must be specified.

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

Change history

Change timeSummary of changesOperation
2023-06-13The Error code has changedView Change Details