This topic describes how to call the DeleteImage operation by using Alibaba Cloud CLI to delete a custom image.

Background information

We recommend that you read the description of the operation before you call the operation. For more information, see DeleteImage.

Warning For more information about precautions for deleting a custom image, see Delete a custom image.

When you call an API operation through Alibaba Cloud CLI, make sure that request parameter values of different data types are in required formats. For more information, see Parameter format overview.

Request examples

  1. Call the DescribeImages operation to query the ID of the image that you want to delete. For more information, see DescribeImages.
    In this example, the image name is used to query the ID of the image.
    aliyun ecs DescribeImages --RegionId cn-hangzhou --ImageName demoName --output cols=Images.Image[].ImageId
    Sample response:
  2. Delete the image based on the image ID.
    aliyun ecs DeleteImage --RegionId cn-hangzhou --ImageId m-bp1503ydxxrppctb**** --Force false


        "RequestId": "2A6B5473-4B15-4F1D-B454-A792770612C3"