Forcibly call an API operation
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:
Cloud service code: You can use the
--helpoption to obtain the list of supported services.Names and parameters of API operations: You can use the
--helpoption to obtain the list of operations of a service and obtain the parameters of an API operation.API version: When you use the
--forceoption, you must also use the--versionoption to specify the API version.Endpoint: Use the
--endpointoption to specify the product endpoint. If you do not specify this option, the endpoint is retrieved from the built-in data of Alibaba Cloud CLI.
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.

Sample command
Run the following command to forcibly call the
QueryMetricListoperation of the2017-03-01version:aliyun cms QueryMetricList --Project acs_ecs_dashboard --Metric cpu_idle --version 2017-03-01 --forceReturn value
