edit-icon download-icon

Complex commands instructions

Last Updated: Dec 19, 2017

RDS complex commands

The example of the DescribeSlowLogs command is as follows.

  1. aliyuncli rds DescribeSlowLogs --DBInstanceId xxxxx --StartTime 2015-09-24Z --EndTime 2015-09-24Z --DBName hms --PageSize 30 --PageNumber 1

Note: The incorrect time format cannot be identified. The PageSize parameter is used to specify the number of data items displayed on each page, and only several fixed values are allowed.

ECS complex commands

The examples of the AddBackendServers command are as follows. Notice the parameter forms following InstanceIds.

  1. aliyuncli ecs DescribeInstances --RegionId cn-hangzhou --InstanceIds "['i-23hello']"
  1. aliyuncli ecs DescribeInstances --RegionId cn-hangzhou --InstanceIds "['i-23hello','i-34hello']"

SLB complex commands

The example of the AddBackendServers command is shown as follows. Notice the parameter forms following BackendServers.

  1. aliyuncli slb AddBackendServers --LoadBalancerId 14fd07a7569-cn-ningxia-am7-c01 --BackendServers "[{'ServerId':'i-21os1d7jr'},{'ServerId':'i-21h2knaxy'}]"

The example of the RemoveBackendServers command is shown as follows. Notice the parameter forms following BackendServers.

  1. aliyuncli slb RemoveBackendServers --LoadBalancerId 14ffe8a7a47-cn-hangzhou-dg-a01 --BackendServers "['i-23glad1uz','i-236tbrnzn']"

CMS complex commands

The example of the DescribeMetricDatum command is shown as follows.

  1. aliyuncli cms DescribeMetricDatum --MetricName MySQL_CpuUsage --StartTime 2015-10-08T00:00:00Z --EndTime 2015-10-08T00:01:00Z --Dimensions "{instanceId:'rds2izeze2izeze'}" --Period 5m --NextToken 1 --Length 100

Note:

  • CMS has only one action. All parameter obtaining is determined according to the incoming parameters such as Dimensions "{instanceId:'rds2izeze2izeze'}", and the incoming time is GTM time CMS.

  • The preceding command returns both CPU and memory information. When a certain information item is needed, you can use the Dimensions "{instanceId:'rds445qv67ce32y4v1gi', type:'cpuusage'}" parameter to filter.

Multiple profile usage

To use the corresponding configuration of profile, you must include the profile XXX parameter, for example:

  1. aliyuncli ecs DescribeInstanceStatus

In this case, the default configuration is used, which is also the global configuration.

  1. aliyuncli ecs DescribeInstanceStatus –-profile test

In this case, the configuration under test is used, which takes effect for one time.

Thank you! We've received your feedback.