ModifyDedicatedHostAutoRenewAttribute

更新时间:
复制 MD 格式

Enables or disables auto-renewal for one or more subscription dedicated hosts.

Operation description

  • If you enable auto-renewal for your subscription dedicated host, the system attempts to deduct the renewal payment at 08:00:00 (UTC+8) nine days before the dedicated host expires to renew the dedicated host. If this deduction attempt fails, the system attempt to deduct the payment at the same point in time the next day. The system attempts to deduct the payment once every day until the dedicated host expires or until the payment is deducted. Make sure that your account balance is sufficient.

  • Subscription dedicated hosts can be automatically renewed along with the subscription Elastic Compute Service (ECS) instances hosted on the dedicated hosts. For more information, see the description of the AutoRenewWithEcs parameter.

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

The table below describes the authorization required to call this API. You can define it in a Resource Access Management (RAM) policy. The table's columns are detailed below:

  • Action: The actions can be used in the Action element of RAM permission policy statements to grant permissions to perform the operation.

  • API: The API that you can call to perform the action.

  • Access level: The predefined level of access granted for each API. Valid values: create, list, get, update, and delete.

  • Resource type: The type of the resource that supports authorization to perform the action. It indicates if the action supports resource-level permission. The specified resource must be compatible with the action. Otherwise, the policy will be ineffective.

    • For APIs with resource-level permissions, required resource types are marked with an asterisk (*). Specify the corresponding Alibaba Cloud Resource Name (ARN) in the Resource element of the policy.

    • For APIs without resource-level permissions, it is shown as All Resources. Use an asterisk (*) in the Resource element of the policy.

  • Condition key: The condition keys defined by the service. The key allows for granular control, applying to either actions alone or actions associated with specific resources. In addition to service-specific condition keys, Alibaba Cloud provides a set of common condition keys applicable across all RAM-supported services.

  • Dependent action: The dependent actions required to run the action. To complete the action, the RAM user or the RAM role must have the permissions to perform all dependent actions.

Action

Access level

Resource type

Condition key

Dependent action

ecs:ModifyDedicatedHostAutoRenewAttribute

update

*DedicatedHost

acs:ecs:{#regionId}:{#accountId}:ddh/{#ddhId}

None None

Request parameters

Parameter

Type

Required

Description

Example

DedicatedHostIds

string

Yes

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

dh-bp165p6xk2tlw61e****

RegionId

string

Yes

The region ID of the dedicated host.

cn-hangzhou

Duration

integer

No

The renewal duration.

  • Valid values when PeriodUnit is set to Month: 1 and 12

  • Valid values when PeriodUnit is set to Year: 1 and 12

1

PeriodUnit

string

No

The unit of the renewal period. Valid values:

  • Month

  • Year

Default value: Month

Month

AutoRenew

boolean

No

Specifies whether to automatically renew the subscription. Valid values:

  • true

  • false

Default value: false

false

RenewalStatus

string

No

Specifies whether to automatically renew the subscription dedicated host. The RenewalStatus parameter takes precedence over the AutoRenew parameter. Valid values:

  • AutoRenewal: The dedicated hosts are automatically renewed.

  • Normal: The dedicated hosts are not automatically renewed, and renewal notifications are sent.

  • NotRenewal: The dedicated hosts are not automatically renewed, and no expiration notification is sent. A notification of no renewal is automatically sent three days before the end of the current subscription cycle. You can change the value of this parameter from NotRenewal to Normal and manually renew the dedicated hosts by calling the RenewDedicatedHosts operation. Alternatively, you can renew the dedicated hosts by setting this parameter to AutoRenewal.

Normal

AutoRenewWithEcs

string

No

Specifies whether to automatically renew the subscription dedicated hosts along with the subscription ECS instances hosted on the dedicated hosts.

If auto-renewal is enabled for the subscription ECS instances hosted on the subscription dedicated hosts, you can specify this parameter to automatically renew the dedicated hosts along with the subscription ECS instances. When the subscription ECS instances hosted on your dedicated hosts are automatically renewed, the subscription dedicated hosts are also automatically renewed if the expiration time of the dedicated hosts is earlier than the expiration time of the renewed instances. Take note of the following items:

When the subscription dedicated hosts are configured to be automatically renewed along with the subscription ECS instances hosted on the dedicated hosts, the system checks the expiration time of the renewed instances and selects a minimum renewal duration for the dedicated hosts so that the dedicated hosts are renewed by a duration that ends later than the expiration time of the renewed instances. For more information about supported renewal durations, see the descriptions of the PeriodUnit and Duration parameters.

For example, assume that a dedicated host expires on January 15 of the current year. Subscription ECS instances hosted on the dedicated host are configured to be automatically renewed to November 15 of the same year. The expiration time of the dedicated host is earlier than the expiration time of the ECS instances by 10 months. In this case, the system selects a renewal duration of 12 months (a minimum duration calculated based on a Duration value of 12 and a PeriodUnit value of Month) for the dedicated host. This ensures that the dedicated host expires later than the ECS instances.

Valid values:

  • AutoRenewWithEcs: automatically renews the subscription dedicated hosts along with the subscription ECS instances hosted on the dedicated hosts.

  • StopRenewWithEcs: does not automatically renew the subscription dedicated hosts along with the subscription ECS instances hosted on the dedicated hosts.

  • NoOperation: does not change the current settings for the dedicated hosts.

Note

If you set this parameter to AutoRenewWithEcs, make sure that AutoRenew is set to true to enable auto-renewal for the dedicated hosts. Otherwise, the subscription dedicated hosts are not automatically renewed along with the subscription ECS instances hosted on the dedicated hosts.

Default value: NoOperation.

StopRenewWithEcs

Response elements

Element

Type

Description

Example

object

RequestId

string

The request ID.

2A4EA075-CB5B-41B7-B0EB-70D339F6****

Examples

Success response

JSON format

{
  "RequestId": "2A4EA075-CB5B-41B7-B0EB-70D339F6****"
}

Error codes

HTTP status code

Error code

Error message

Description

403 MissingParameter.DedicatedHostId DedicatedHostId should not be null. The DedicatedHostId parameter is required.
403 InvalidParameter.ToManyDedicatedHostIds DedicatedHostId should be less than 100. More than 100 dedicated host IDs are specified in the DedicatedHostIds value.
403 InvalidParameter.InvalidDedicatedHostId %s The specified DedicatedHostId parameter is invalid.
403 IncorrectHostStatus The current status of the resource does not support this operation. The resource is in a state that does not support the current operation.
403 ChargeTypeViolation Pay-As-You-Go dedicated host do not support this operation.
403 InvalidParameter.Duration %s The specified Duration parameter is invalid.
403 InvalidParameter.RenewalStatus %s The specified RenewalStatus parameter is invalid.
403 InvalidPeriodUnit.ValueNotSupported The specified parameter PeriodUnit is not valid.
403 InvalidParameter.AutoRenewWithEcs The value of parameter AutoRenewWithEcs is invalid.

See Error Codes for a complete list.

Release notes

See Release Notes for a complete list.