Help Center/ Auto Scaling/ CLI Reference/ CLI Command Reference
Updated on 2026-09-10 GMT+08:00

CLI Command Reference

Scaling Action Logs

API Name

Command

Description

Operation

Querying Scaling Action Logs

hcloud AS ListScalingActivityLogs

This API is used to query scaling action logs based on search criteria. The results are displayed by page.

  • Search criteria can be the start time, end time, start line number, and number of records.
  • If no search criteria are specified, a maximum of 20 scaling action logs can be queried by default.

Debug

Querying Scaling Action Logs (V2)

hcloud AS ListScalingActivityV2Logs

This API is used to query scaling action logs based on search criteria. The scaling actions include increasing or decreasing instances, load balancer migration, and setting instances to the standby mode. The results are displayed by page.

  • The difference between the V2 and V1 APIs for querying scaling action logs is that V2 displays more detailed action logs, such as load balancer migration logs and instance standby logs.
  • Search criteria can be the start time, end time, start line number, number of records, and scaling action type.
  • If no search criteria are specified, a maximum of 20 scaling action logs can be queried by default.

Debug

AS Policy Execution Logs

API Name

Command

Description

Operation

Querying AS Policy Execution Logs

hcloud AS ListScalingPolicyExecuteLogs

This API is used to query the historical records of AS policy execution based on search criteria. The results are displayed by page.

  • Search criteria can be the log ID, AS resource type, AS resource ID, policy execution type, start time, end time, start line number, and number of records.
  • If no search criteria are specified, a maximum of 20 AS policy execution logs can be queried by default.

Debug

API Version Query

API Name

Command

Description

Operation

Querying API Versions

hcloud AS ListApiVersions

This API is used to query all API versions of the AS service.

Debug

Querying an API Version

hcloud AS ShowApiVersion

This API is used to query a specified API version of the AS service.

Debug

Instances

API Name

Command

Description

Operation

Querying Instances in an AS Group

hcloud AS ListScalingInstances

This API is used to query instances in an AS group based on search criteria. The results are displayed by page.

  • Search criteria can be the instance lifecycle status in the AS group, instance health status, instance protection status, start line number, and number of records.
  • If no search criteria are specified, a maximum of 20 instances in an AS group can be queried by default.

Debug

Removing an Instance from an AS Group

hcloud AS DeleteScalingInstance

This API is used to remove a specified instance from an AS group.

  • You can remove instances only in INSERVICE state and only when the number of instances after the removal is no less than the minimum number of instances allowed.
  • You can remove instances from an AS group only when no scaling action is in progress.

Debug

Batch Adding Instances

hcloud AS BatchAddScalingInstances

This API is used to add instances to an AS group in a batch.

Debug

Batch Removing Instances

hcloud AS BatchRemoveScalingInstances

This API is used to remove instances from an AS group in a batch.

Debug

Batch Enabling Instance Protection

hcloud AS BatchProtectScalingInstances

This API is used to enable protection for instances in an AS group in a batch.

Debug

Batch Disabling Instance Protection

hcloud AS BatchUnprotectScalingInstances

This API is used to disable protection for instances in an AS group in a batch.

Debug

Batch Setting Instances to Standby

hcloud AS BatchSetScalingInstancesStandby

This API is used to set instances in an AS group to the standby mode in a batch.

Debug

Batch Canceling Standby Mode for Instances

hcloud AS BatchUnsetScalingInstancesStantby

This API is used to cancel the standby mode for instances in an AS group in a batch.

Debug

AS Policies

API Name

Command

Description

Operation

Creating an AS Policy

hcloud AS CreateScalingPolicy

This API is used to create an AS policy.

  • An AS policy defines whether to increase or decrease the number of instances in an AS group. If the number and the expected number of instances in an AS group are different due to the execution of the AS policy, AS automatically adjusts the number of instances to the expected.
  • AS supports the following policies: alarm-triggered policy, periodic policy, and scheduled policy.
  • In an AS policy, you can set the number of instances to be scaled or configure a scaling action based on a specified percentage.

Debug

Querying Details About an AS Policy

hcloud AS ShowScalingPolicy

This API is used to query details about a specified AS policy.

Debug

Modifying an AS Policy

hcloud AS UpdateScalingPolicy

This API is used to modify a specified AS policy.

Debug

Deleting an AS Policy

hcloud AS DeleteScalingPolicy

This API is used to delete a specified AS policy.

Debug

Querying AS Policies

hcloud AS ListScalingPolicies

This API is used to query AS policies based on search criteria. The results are displayed by page. Search criteria can be the AS policy name, policy type, policy ID, start line number, and number of records. If no search criteria are specified, a maximum of 20 AS policies for a specified AS group can be queried for a tenant by default.

Debug

Batch Deleting AS Policies

hcloud AS BatchDeleteScalingPolicies

This API is used to delete AS policies in a batch. A maximum of 20 AS policies can be deleted in a batch at a time.

Debug

Batch Disabling AS Policies

hcloud AS BatchPauseScalingPolicies

This API is used to disable AS policies in a batch. A maximum of 20 AS policies can be disabled in a batch at a time.

Debug

Batch Enabling AS Policies

hcloud AS BatchResumeScalingPolicies

This API is used to enable AS policies in a batch. A maximum of 20 AS policies can be enabled in a batch at a time.

Debug

Executing an AS Policy

hcloud AS ExecuteScalingPolicy

This API is used to execute a specified AS policy immediately. An AS policy can be executed only when the AS group and AS policy are in the INSERVICE state. Otherwise, the execution fails.

Debug

Enabling an AS Policy

hcloud AS ResumeScalingPolicy

This API is used to enable a specified AS policy immediately. An AS policy can be executed only when the AS group and AS policy are in the INSERVICE state. Otherwise, the execution fails.

Debug

Disabling an AS Policy

hcloud AS PauseScalingPolicy

This API is used to disable a specified AS policy immediately. An AS policy can be executed only when the AS group and AS policy are in the INSERVICE state. Otherwise, the execution fails.

Debug

AS Policies (V2)

API Name

Command

Description

Operation

Querying All AS Policies (V2)

hcloud AS ListAllScalingV2Policies

This API is used to query all AS policies for a tenant based on search criteria. The results are displayed by page.

Search criteria can be the AS resource ID, AS resource type, AS policy name, AS policy ID, alarm ID, enterprise project ID, start line number, number of records, and sorting method.

If no search criteria are specified, a maximum of 20 AS policies can be queried for a tenant by default.

Debug

Creating an AS Policy (V2)

hcloud AS CreateScalingV2Policy

This API is used to create an AS policy for an AS group or bandwidth. The difference between the V2 and V1 APIs for creating an AS policy is that V2 supports creating an AS policy for adjusting bandwidth and differentiating scaling resources by their types.

Debug

Querying Details About an AS Policy (V2)

hcloud AS ShowScalingV2Policy

This API is used to query details about a specified AS policy.

Debug

Modifying an AS Policy (V2)

hcloud AS UpdateScalingV2Policy

This API is used to modify a specified AS policy. The difference between the V2 and V1 APIs for modifying an AS policy is that V2 supports modifying a scaling resource type.

Debug

Querying AS Policies (V2)

hcloud AS ListScalingV2Policies

This API is used to query AS policies based on search criteria. The results are displayed by page. The difference between the V2 and V1 APIs for querying AS policies is that V2 contains scaling resource types in response messages. Search criteria can be the AS policy name, policy type, policy ID, start line number, and number of records. If no search criteria are specified, a maximum of 20 AS policies for specified resources can be queried for a tenant by default.

Debug

AS Groups

API Name

Command

Description

Operation

Querying AS Groups

hcloud AS ListScalingGroups

This API is used to query AS groups based on search criteria. The results are displayed by page. Search criteria can be the AS group name, AS configuration ID, AS group status, enterprise project ID, start line number, and number of records. If no search criteria are specified, a maximum of 20 AS groups can be queried by default.

Debug

Creating an AS Group

hcloud AS CreateScalingGroup

An AS group is a collection of instances that are used in the same scenario. It is the basis for enabling or disabling AS policies and performing scaling actions. An AS group specifies parameters, such as the maximum number of instances, expected number of instances, minimum number of instances, VPC, subnet, and load balance settings. By default, a maximum of 10 AS groups can be created.

Debug

Querying Details About an AS Group

hcloud AS ShowScalingGroup

This API is used to query details about a specified AS group.

Debug

Modifying an AS Group

hcloud AS UpdateScalingGroup

This API is used to modify a specified AS group.

  • When the AS configuration of an AS group is changed, the existing instances created using the original AS configuration are not affected.
  • If no scaling action is being performed, you can modify its subnet, AZ, and ELB.
  • Changing the number of expected instances in an AS group will trigger a scaling action to add or remove instances to or from the AS group. The number of expected instances must be greater than or equal to the minimum number of instances and less than or equal to the maximum number of instances.

Debug

Deleting an AS Group

hcloud AS DeleteScalingGroup

This API is used to delete a specified AS group.

Debug

Enabling an AS Group

hcloud AS ResumeScalingGroup

This API is used to enable a specified AS group.

Debug

Disabling an AS Group

hcloud AS PauseScalingGroup

This API is used to disable a specified AS group. For a disabled AS group, AS does not automatically trigger any scaling actions. When an AS group has an in-progress scaling action, the scaling action does not stop immediately after the AS group is disabled.

Debug

Querying Details About a Warm Pool

hcloud AS ShowWarmPool

This API is used to query details about a warm pool.

Debug

Enabling a Warm Pool

hcloud AS PutWarmPool

This API is used to enable and configure a warm pool.

Debug

Disabling a Warm Pool

hcloud AS CloseWarmPool

This API is used to disable the warm pool of an AS group.

Debug

Querying Instances in a Warm Pool

hcloud AS ListWarmPoolInstances

This API is used to query instances in a warm pool.

Debug

Querying Details About a Warm Pool (V2)

hcloud AS ShowWarmPoolNew

This API is used to query details about a warm pool.

Debug

Enabling a Warm Pool (V2)

hcloud AS PutWarmPoolNew

This API is used to enable and configure a warm pool.

Debug

Disabling a Warm Pool (V2)

hcloud AS CloseWarmPoolNew

This API is used to disable the warm pool of an AS group.

Debug

Querying Instances in a Warm Pool (V2)

hcloud AS ListWarmPoolInstancesNew

This API is used to query instances in a warm pool.

Debug

AS Configurations

API Name

Command

Description

Operation

Querying AS Configurations

hcloud AS ListScalingConfigs

This API is used to query AS configurations based on search criteria. The results are displayed by page.

  • Search criteria can be the AS configuration name, image ID, start line number, and number of records.
  • If no search criteria are specified, a maximum of 20 AS configurations can be queried for a tenant by default.

Debug

Creating an AS Configuration

hcloud AS CreateScalingConfig

This API is used to create an AS configuration. An AS configuration is an ECS template in the AS group, specifying specifications of the ECS to be added. The AS configuration is decoupled from the AS group. An AS configuration can be used by multiple AS groups. By default, a maximum of 100 AS configurations can be created.

Debug

Querying Details About an AS Configuration

hcloud AS ShowScalingConfig

This API is used to query details about an AS configuration based on the AS configuration ID.

Debug

Modifying an AS Configuration

hcloud AS UpdateScalingConfig

This API is used to modify an AS configuration.

Debug

Deleting an AS Configuration

hcloud AS DeleteScalingConfig

This API is used to delete a specified AS configuration.

Debug

Batch Deleting AS Configurations

hcloud AS BatchDeleteScalingConfigs

This API is used to delete AS configurations in a batch. AS configurations used by AS groups cannot be deleted. A maximum of 50 AS configurations can be deleted at a time.

Debug

Tags

API Name

Command

Description

Operation

Querying Tags

hcloud AS ListScalingTagInfosByTenantId

This API is used to query tags of a specific type of resource in a project.

Debug

Querying Tags of a Resource

hcloud AS ListScalingTagInfosByResourceId

This API is used to query tags of a specified resource in a project.

Debug

Querying Resources by Tag

hcloud AS ListResourceInstances

This API is used to query resources in a project by tag. By default, resources and resource tags are in descending order of their creation time.

Debug

Creating a Tag

hcloud AS CreateScalingTagInfo

This API is used to create a tag for a specified resource.

Debug

Deleting a Tag

hcloud AS DeleteScalingTagInfo

This API is used to delete a tag from a specified resource.

Debug

Lifecycle Hooks

API Name

Command

Description

Operation

Creating a Lifecycle Hook

hcloud AS CreateLifyCycleHook

This API is used to create a lifecycle hook. You can add one or more lifecycle hooks to an AS group. A maximum of five lifecycle hooks can be added.

  • After a lifecycle hook is added to an AS group, when the AS group performs a scaling action, the lifecycle hook suspends the target instance and sets it to be in Wait (Adding to AS group) or Wait (Removing from AS group) status. This status retains until the timeout duration expires or you manually call back this status.
  • During the instance waiting duration, you can perform customized operations. For example, you can install or configure software on a newly started instance, or download the log file from the instance before the instance terminates.

Debug

Querying Lifecycle Hooks

hcloud AS ListLifeCycleHooks

This API is used to query lifecycle hooks by AS group ID.

Debug

Querying Details About a Lifecycle Hook

hcloud AS ShowLifeCycleHook

This API is used to query details about a specified lifecycle hook by AS group ID and lifecycle hook name.

Debug

Modifying a Lifecycle Hook

hcloud AS UpdateLifeCycleHook

This API is used to modify a specified lifecycle hook.

Debug

Deleting a Lifecycle Hook

hcloud AS DeleteLifecycleHook

This API is used to delete a specified lifecycle hook. When a scaling action is being performed in an AS group, the lifecycle hooks of the AS group cannot be deleted.

Debug

Calling Back a Lifecycle Hook

hcloud AS AttachCallbackInstanceLifeCycleHook

This API is used to call back the lifecycle hook specified by a scaling instance based on the lifecycle action key or based on the instance ID and lifecycle hook name.

  • If you have completed custom operations before the timeout duration expires, you can terminate or continue the lifecycle operations.
  • If you require more time to complete your custom operations, extend the timeout duration to enable the instance to remain in a wait state for an additional hour.
  • The callback operation can be performed only when the lifecycle hook of the target instance is in HANGING state.

Debug

Querying Instance Suspension

hcloud AS ListHookInstances

After a lifecycle hook is added, when an AS group performs a scaling action, the lifecycle hook suspends the target instance and sets it to be in waiting state. You can query the instance suspension based on search criteria.

  • Search instance suspension by instance ID.
  • If no search criteria are specified, the suspension about all instances in the specified AS group is queried by default.

Debug

Scheduled Tasks

API Name

Command

Description

Operation

Querying Scheduled Tasks

hcloud AS ListGroupScheduledTasks

This API is used to query scheduled tasks.

Debug

Creating a Scheduled Task

hcloud AS CreateGroupScheduledTask

This API is used to create a scheduled task.

Debug

Updating a Scheduled Task

hcloud AS UpdateGroupScheduledTask

This API is used to update a scheduled task.

Debug

Deleting a Scheduled Task

hcloud AS DeleteGroupScheduledTask

This API is used to delete a scheduled task.

Debug

Notifications

API Name

Command

Description

Operation

Querying Notifications of an AS Group

hcloud AS ListScalingNotifications

This API is used to query notifications of an AS group by group ID.

Debug

Configuring a Notification for an AS Group

hcloud AS CreateScalingNotification

This API is used to configure a notification for an AS group. Each time this API is called, the AS group adds a notification topic and scenario. A maximum of five topics can be added for each AS group. The notification topic is pre-configured and subscribed by you in SMN. When the live network complies with the notification scenario that matches the notification topic, the AS group sends a notification to your subscription endpoints.

Debug

Deleting a Notification from an AS Group

hcloud AS DeleteScalingNotification

This API is used to delete a notification from a specified AS group.

Debug

Quotas

API Name

Command

Description

Operation

Querying Quotas

hcloud AS ShowResourceQuota

This API is used to query the total quotas and used quotas of AS groups, AS configurations, bandwidth scaling policies, AS policies, and instances for a specified tenant.

Debug

Querying AS Policy and Instance Quotas

hcloud AS ShowPolicyAndInstanceQuota

This API is used to query the total quotas and used quotas of AS policies and instances of a specified AS group by group ID.

Debug