This topic describes the force function of Alibaba Cloud CLI.

--force overview

The metadata of APIs and parameters for several of the products and services of Alibaba Cloud are integrated into Alibaba Cloud CLI. When you call an API, Alibaba Cloud CLI automatically checks the validity of that API and related parameters. However, the metadata related to products and APIs may be incomplete or limited. If you use an API or a parameter that is not found in the metadata integrated in Alibaba Cloud CLI, an error message of unknown api or unknown parameter is returned. In such situation, you can use the --force to skip API and parameter checking process, and force APIs or parameters outside the metadata list to be called. Before you force call an API, we recommend that you confirm the accuracy of the following information:
  • Alibaba Cloud Product code
  • API name and parameters
  • API version
  • Endpoint information

When using the --force, you must specify the --version to specify the API version. For example, the ECS version is 2014-05-26. You can also specify --endpoint to specify the product access address. If it is not specified, it is obtained from the built-in data of Alibaba Cloud CLI.


  • Scenario:

    With the CMS product, there is an API is used to describe MetricList. In the Alibaba Cloud CLI version 3.0.16, the API version of the CMS is 2019-01-01, and the interface name is DescribeMetricList. However, In the Alibaba Cloud CLI version 2017-03-01, the interface name is QueryMetricList.

  • Solution:
    Run the following command, force to call the 2017-03-01 version of the QueryMetricList interface.
    aliyun cms QueryMetricList [api parameters] --force --version 2017-03-01