Forcibly call an API operation

Updated at:
Copy as MD

Alibaba Cloud CLI checks the validity of parameters when you call the APIs of cloud services. Because the APIs are available in multiple versions, the built-in information about cloud services and API operations do not meet all requirements. You can forcibly call an API operation that is not in the metadata list and check the accuracy of specific information about the API operation.

Description of the --force option

In Alibaba Cloud CLI, if you call an API operation or specify a parameter that is not included in the metadata, the unknown api or unknown parameter error is reported. You can forcibly call API operations and use parameters that are not in the metadata using the --force option. To do so, make sure that the following information is accurate:

Example

Scenario

The CMS product provides an interface to describe MetricList. In version 2019-01-01 of the CMS API, this interface is named DescribeMetricList. However, in the 2017-03-01 version, the interface is named QueryMetricList. A direct call to the QueryMetricList interface causes an error in the Cloud Assistant CLI.

image

Sample command

  1. Run the following command to forcibly call the QueryMetricList operation of the 2017-03-01 version:

    aliyun cms QueryMetricList --Project acs_ecs_dashboard --Metric cpu_idle --version 2017-03-01 --force
  2. Return value

    image