Querying AS configurations

Function

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

URI

GET /autoscaling-api/v1/{project_id}/scaling_configuration

You can type the question mark (?) and ampersand (&) at the end of the URI to define multiple search criteria. AS configurations can be searched by all optional parameters in the following table. For details, see the example request.

Table 1 Parameter description

Parameter

Mandatory

Type

Description

project_id

Yes

String

Specifies the project ID.

scaling_configuration_name

No

String

Specifies the AS configuration name.

Supports fuzzy search.

image_id

No

String

Specifies the image ID. It is same as imageRef.

start_number

No

Integer

Specifies the start line number. The default value is 0. The minimum parameter value is 0.

limit

No

Integer

Specifies the number of query records. The default value is 20. The value range is 0 to 100.

Request

None

Example Request

This example queries the AS configurations with image ID 37ca2b35-6fc7-47ab-93c7-900324809c5c.

GET https://{Endpoint}/autoscaling-api/v1/{project_id}/scaling_configuration?image_id=37ca2b35-6fc7-47ab-93c7-900324809c5c

Response

Table 2 Response parameters

Parameter

Type

Description

total_number

Integer

Specifies the total number of query records.

start_number

Integer

Specifies the start line number.

limit

Integer

Specifies the number of query records.

scaling_configurations

Array of scaling_configurations objects

Specifies the AS configuration list.

Table 3 scaling_configurations field description

Parameter

Type

Description

scaling_configuration_id

String

Specifies the AS configuration ID. This parameter is globally unique.

tenant

String

Specifies the tenant ID.

scaling_configuration_name

String

Specifies the AS configuration name.

Supports fuzzy search.

instance_config

instance_config object

Specifies the information about instance configurations.

create_time

String

Specifies the time when AS configurations are created. The time format complies with UTC.

scaling_group_id

String

Specifies the ID of the AS group to which the AS configuration is bound.

Table 4 instance_config field description

Parameter

Type

Description

flavorRef

String

Specifies the ECS flavor ID.

imageRef

String

Specifies the image ID. It is same as image_id.

disk

Array of disk objects

Specifies the disk group information.

key_name

String

Specifies the name of the SSH key pair used to log in to the ECS.

key_fingerprint

String

Specifies the fingerprint of the SSH key pair used to log in to the ECS.

instance_name

String

This parameter is reserved.

NOTE:

When you call APIs to query the details about an AS configuration created from an ECS or to list such AS configurations, instance_name is empty in the response.

instance_id

String

This parameter is reserved.

adminPass

String

This parameter is reserved.

personality

Array of personality objects

Specifies information about the injected file.

public_ip

public_ip object

Specifies the EIP of the ECS.

user_data

String

Specifies the Cloud-Init user data, which is encoded using Base64.

metadata

metadata object

Specifies the ECS metadata. For details, see Table 11.

security_groups

Array of security_groups objects

Specifies the security group information.

server_group_id

String

This parameter is reserved.

tenancy

String

This parameter is reserved.

dedicated_host_id

String

This parameter is reserved.

market_type

String

This parameter is reserved.

multi_flavor_priority_policy

String

This parameter is reserved.

Table 5 disk field description

Parameter

Type

Description

size

Integer

Specifies the disk size. The unit is GB.

volume_type

String

Specifies the disk type.

disk_type

String

Specifies whether the disk is a system disk or a data disk. DATA indicates a data disk. SYS indicates a system disk.

data_disk_image_id

String

Specifies the ID of the data disk image for creating a data disk.

snapshot_id

String

Specifies the disk backup snapshot ID.

metadata

metadata object

Specifies the metadata for creating disks. For details, see Table 6.

Table 6 metadata Field Description for Creating Disks

Parameter

Type

Description

__system__encrypted

String

Specifies encryption in metadata. The value can be 0 (encryption disabled) or 1 (encryption enabled).

If this parameter does not exist, the disk will not be encrypted by default.

__system__cmkid

String

Specifies the CMK ID, which indicates encryption in metadata. This parameter is used with __system__encrypted.

NOTE:

For details about how to obtain the CMK ID, see "Querying the List of CMKs" in Key Management Service API Reference.

Table 7 personality field description

Parameter

Type

Description

path

String

Specifies the path of the injected file.

content

String

Specifies the content of the file to be injected. The file content is encoded using Base64.

Table 8 public_ip field description

Parameter

Type

Description

eip

eip object

Specifies the automatically assigned EIP.

Table 9 eip field description

Parameter

Type

Description

ip_type

String

Specifies the IP address type.

bandwidth

bandwidth object

Specifies the bandwidth of an IP address.

Table 10 bandwidth field description

Parameter

Type

Description

size

Integer

Specifies the bandwidth (Mbit/s).

share_type

String

Specifies the bandwidth sharing type.

Enumerated values of the sharing type:

  • PER: dedicated

charging_mode

String

Specifies the bandwidth billing mode.

  • traffic: billed by traffic.
Table 11 metadata field description

Parameter

Type

Description

admin_pass

String

Specifies the password of the Administrator account for a Windows ECS.

Table 12 security_groups field description

Parameter

Type

Description

id

String

Specifies the security group ID.

Example Response

{
    "limit": 20,
    "total_number": 2,
    "start_number": 0,
    "scaling_configurations": [
        {
            "tenant": "ce061903a53545dcaddb300093b477d2",
            "scaling_configuration_id": "6afe46f9-7d3d-4046-8748-3b2a1085ad86",
            "scaling_configuration_name": " config_name_1",
            "instance_config": {
                "disk": [
                    {
                        "size": 40,
                        "volume_type": "SATA",
                        "disk_type": "SYS"
                    },
                    {
                        "size": 100,
                        "volume_type": "SATA",
                        "disk_type": "DATA"
                    }
                ],
                "personality": null,
                "instance_name": null,
                "instance_id": null,
                "flavorRef": "103",
                "imageRef": "37ca2b35-6fc7-47ab-93c7-900324809c5c",
                "key_name": "keypair01",
                "key_fingerprint" : "SHA256:qlvdUkYgSjKUxcr2uJgJJRMCKMLkJO5BPLooBcgsF8k",
                "public_ip": null,
                "user_data": null,
                "metadata": {},
                "security_groups": [{
                     "id": "6c22a6c0-b5d2-4a84-ac56-51090dcc33be"
                }],
            },
            "create_time": "2015-07-23T01:04:07Z"
        },
        {
            "tenant": "ce061903a53545dcaddb300093b477d2",
            "scaling_configuration_id": "24a8c5f3-c713-4aba-ac29-c17101009e5d",
            "scaling_configuration_name": "config_name_2",
            "instance_config": {
                "disk": [
                    {
                        "size": 40,
                        "volume_type": "SATA",
                        "disk_type": "SYS"
                    }
                ],
                "personality": null,
                "instance_name": null,
                "instance_id": null,
                "flavorRef": "103",
                "imageRef": "37ca2b35-6fc7-47ab-93c7-900324809c5c",
                "key_name": "keypair01",
                "key_fingerprint" : "SHA256:qlvdUkYgSjKUxcr2uJgJJRMCKMLkJO5BPLooBcgsF8k",
                "public_ip": null,
                "user_data": null,
                "metadata": {},
                "security_groups": [{
                     "id": "6c22a6c0-b5d2-4a84-ac56-51090dcc33be"
                }],
                "multi_flavor_priority_policy": "PICK_FIRST"
            },
            "create_time": "2015-07-22T01:08:41Z"
        }
    ]
}

Returned Values

Error Codes

See Error Codes.