文档

使用ECS镜像公共参数

更新时间:

获取ECS镜像公共参数

ECS Linux和Windows镜像公共参数可以通过如下路径获取:

  • Linux:aliyun/services/ecs/images/linux

  • Windows: aliyun/services/ecs/images/windows

公共参数结构详解:

以ECS为例

公共参数 aliyun/services/ecs/images/linux/centos-latest/centos_8_5_64

公共参数的前缀 aliyun/services/ecs 表示ECS下的公共参数。

下一级目录/images 表示镜像

下一级目录 /linux 代表操作系统类型

下一级目录 /centos-latest 代表centos最新的镜像

最后的centos_8_5_64则是代表具体的centos8的ImageFamily

其中aliyun/services/ecs/images/linux/centos-latest/ 是这个参数的路径

centos_8_5_64则是具体的某个参数值

获取Linux操作系统镜像公共参数

获取支持的Linux发行版本

如果想获取aliyun/services/ecs/images/下所有Linux系统的类型,可以使用GetParametersByPath,运行以下命令:

aliyun oos GetParametersByPath --Path aliyun/services/ecs/images/linux/

返回:

{
    "MaxResults": 10,
    "Parameters": [
    {
    "Constraints": "",
    "CreatedBy": "ACS",
    "CreatedDate": "2023-05-17T06:21:15Z",
    "Description": "",
    "Id": "p-b3881d719f624e56b0ea",
    "Name": "aliyun/services/ecs/images/linux/almalinux-latest",
    "ParameterVersion": 1,
    "ShareType": "Public",
    "Tags": {},
    "Type": "String",
    "UpdatedBy": "ACS",
    "UpdatedDate": "2023-05-17T06:21:15Z",
    "Value": "almalinux-latest"
    },
    {
    "Constraints": "",
    "CreatedBy": "ACS",
    "CreatedDate": "2023-05-17T06:21:15Z",
    "Description": "",
    "Id": "p-d8d12d8734924cd8800e",
    "Name": "aliyun/services/ecs/images/linux/debian-latest",
    "ParameterVersion": 1,
    "ShareType": "Public",
    "Tags": {},
    "Type": "String",
    "UpdatedBy": "ACS",
    "UpdatedDate": "2023-05-17T06:21:15Z",
    "Value": "debian-latest"
    },
    {
    "Constraints": "",
    "CreatedBy": "ACS",
    "CreatedDate": "2023-05-17T06:21:14Z",
    "Description": "",
    "Id": "p-1469bd95f1fa4676a7a9",
    "Name": "aliyun/services/ecs/images/linux/rockylinux-latest",
    "ParameterVersion": 1,
    "ShareType": "Public",
    "Tags": {},
    "Type": "String",
    "UpdatedBy": "ACS",
    "UpdatedDate": "2023-05-17T06:21:14Z",
    "Value": "rockylinux-latest"
    }
    ],
    "RequestId": "xxxxxxxxxxxxxx"
}

获取Linux发行版本下的镜像公共参数

使用GetParametersByPath获取aliyun/services/ecs/images/linux/aliyun-latest/路径下所有的公共参数,也即最新的alibaba cloud linux镜像

aliyun oos GetParametersByPath --Path aliyun/services/ecs/images/linux/aliyun-latest/

返回

{
    "MaxResults": 10,
    "Parameters": [
    {
    "Constraints": "",
    "CreatedBy": "ACS",
    "CreatedDate": "2023-05-16T02:44:25Z",
    "Description": "",
    "Id": "p-77246c47199c4a1da8bd",
    "Name": "aliyun/services/ecs/images/linux/aliyun-latest/alibaba_cloud_linux_2_1903_lts_64",
    "ParameterVersion": 1,
    "ShareType": "Public",
    "Tags": {},
    "Type": "String",
    "UpdatedBy": "ACS",
    "UpdatedDate": "2023-05-16T02:44:25Z",
    "Value": "aliyun_2_1903_x64_20G_alibase_20230327.vhd"
    },
    {
    "Constraints": "",
    "CreatedBy": "ACS",
    "CreatedDate": "2023-05-16T02:44:25Z",
    "Description": "",
    "Id": "p-0cb615ab447e43d78c8a",
    "Name": "aliyun/services/ecs/images/linux/aliyun-latest/alibaba_cloud_linux_3_2104_lts_64",
    "ParameterVersion": 1,
    "ShareType": "Public",
    "Tags": {},
    "Type": "String",
    "UpdatedBy": "ACS",
    "UpdatedDate": "2023-05-16T02:44:25Z",
    "Value": "aliyun_3_x64_20G_alibase_20230327.vhd"
    },
    {
    "Constraints": "",
    "CreatedBy": "ACS",
    "CreatedDate": "2023-05-16T02:44:24Z",
    "Description": "",
    "Id": "p-e4b81bf48c6b4a1194da",
    "Name": "aliyun/services/ecs/images/linux/aliyun-latest/alibaba_cloud_linux_3_2104_lts_64_arm",
    "ParameterVersion": 1,
    "ShareType": "Public",
    "Tags": {},
    "Type": "String",
    "UpdatedBy": "ACS",
    "UpdatedDate": "2023-05-16T02:44:24Z",
    "Value": "aliyun_3_arm64_20G_alibase_20230327.vhd"
    }
    ],
    "RequestId": "xxxxxxxxxxxxxxxx"
}

获取Linux镜像ID

如果您想查看某个具体镜像的详细信息,可以使用GetParameter,如想获取aliyun/services/ecs/images/linux/aliyun-latest/alibaba_cloud_linux_3_2104_lts_64的详细信息

aliyun oos GetParameter --Name aliyun/services/ecs/images/linux/aliyun-latest/alibaba_cloud_linux_3_2104_lts_64

返回

{
    "Parameter": {
    "Constraints": "",
    "CreatedBy": "ACS",
    "CreatedDate": "2023-05-16T02:44:25Z",
    "Description": "",
    "Id": "p-0cb615ab447e43d78c8a",
    "Name": "aliyun/services/ecs/images/linux/aliyun-latest/alibaba_cloud_linux_3_2104_lts_64",
    "ParameterVersion": 1,
    "ResourceGroupId": "",
    "ShareType": "Public",
    "Tags": {},
    "Type": "String",
    "UpdatedBy": "ACS",
    "UpdatedDate": "2023-05-16T02:44:25Z",
    "Value": "aliyun_3_x64_20G_alibase_20230327.vhd"
    },
    "RequestId": "xxxxxxxxxxxxxxxx"
}

获取Windows操作系统镜像公共参数

获取支持的Windows发行版本

如果想获取aliyun/services/ecs/images/下所有windows系统的类型,可以使用GetParametersByPath,运行以下命令:

aliyun oos GetParametersByPath --Path aliyun/services/ecs/images/windows/

返回:

{
    "MaxResults": 10,
    "Parameters": [
    {
    "Constraints": "",
    "CreatedBy": "ACS",
    "CreatedDate": "2023-05-17T06:21:12Z",
    "Description": "",
    "Id": "p-054efea36c844cd1bd13",
    "Name": "aliyun/services/ecs/images/windows/win2012r2-latest",
    "ParameterVersion": 1,
    "ShareType": "Public",
    "Tags": {},
    "Type": "String",
    "UpdatedBy": "ACS",
    "UpdatedDate": "2023-05-17T06:21:12Z",
    "Value": "win2012r2-latest"
    },
    {
    "Constraints": "",
    "CreatedBy": "ACS",
    "CreatedDate": "2023-05-17T06:21:12Z",
    "Description": "",
    "Id": "p-2739773e66cb453a8881",
    "Name": "aliyun/services/ecs/images/windows/win2019-latest",
    "ParameterVersion": 1,
    "ShareType": "Public",
    "Tags": {},
    "Type": "String",
    "UpdatedBy": "ACS",
    "UpdatedDate": "2023-05-17T06:21:12Z",
    "Value": "win2019-latest"
    },
    {
    "Constraints": "",
    "CreatedBy": "ACS",
    "CreatedDate": "2023-05-17T06:21:12Z",
    "Description": "",
    "Id": "p-dbbcc5339033469db729",
    "Name": "aliyun/services/ecs/images/windows/win2022-latest",
    "ParameterVersion": 1,
    "ShareType": "Public",
    "Tags": {},
    "Type": "String",
    "UpdatedBy": "ACS",
    "UpdatedDate": "2023-05-17T06:21:12Z",
    "Value": "win2022-latest"
    }
    ],
    "RequestId": "xxxxxxxxxxxxxxxx"
}

获取Windows发行版本下的镜像公共参数

使用GetParametersByPath获取aliyun/services/ecs/images/windows/win2022-latest/路径下所有的公共参数,也即最新的windows2022镜像

aliyun oos GetParametersByPath --Path aliyun/services/ecs/images/windows/win2022-latest/

返回

{
    "MaxResults": 10,
    "Parameters": [
    {
    "Constraints": "",
    "CreatedBy": "ACS",
    "CreatedDate": "2023-05-16T02:44:23Z",
    "Description": "",
    "Id": "p-135294c8fa0c468cb64c",
    "Name": "aliyun/services/ecs/images/windows/win2022-latest/win_2022_datacenter_64_en",
    "ParameterVersion": 1,
    "ShareType": "Public",
    "Tags": {},
    "Type": "String",
    "UpdatedBy": "ACS",
    "UpdatedDate": "2023-05-16T02:44:23Z",
    "Value": "win2022_21H2_x64_dtc_en-us_40G_alibase_20230413.vhd"
    },
    {
    "Constraints": "",
    "CreatedBy": "ACS",
    "CreatedDate": "2023-05-16T02:44:23Z",
    "Description": "",
    "Id": "p-c8d1adf990c64eb98426",
    "Name": "aliyun/services/ecs/images/windows/win2022-latest/win_2022_datacenter_64_ch",
    "ParameterVersion": 1,
    "ShareType": "Public",
    "Tags": {},
    "Type": "String",
    "UpdatedBy": "ACS",
    "UpdatedDate": "2023-05-16T02:44:23Z",
    "Value": "win2022_21H2_x64_dtc_zh-cn_40G_alibase_20230413.vhd"
    },
    {
    "Constraints": "",
    "CreatedBy": "ACS",
    "CreatedDate": "2023-05-16T02:44:23Z",
    "Description": "",
    "Id": "p-e139e998b54b4f60b6d5",
    "Name": "aliyun/services/ecs/images/windows/win2022-latest/win_2022_container_datacenter_64_en",
    "ParameterVersion": 1,
    "ShareType": "Public",
    "Tags": {},
    "Type": "String",
    "UpdatedBy": "ACS",
    "UpdatedDate": "2023-05-16T02:44:23Z",
    "Value": "win2022_21H2_x64_dtc_en-us_40G_container_alibase_20230413.vhd"
    }
    ],
    "RequestId": "xxxxxxxxxxxxxxxxx"
}

获取Windows镜像ID

如果您想查看某个具体镜像的详细信息,可以使用GetParameter,如想获取aliyun/services/ecs/images/windows/win2022-latest/win_2022_container_datacenter_64_en的详细信息

aliyun oos GetParameter --Name aliyun/services/ecs/images/windows/win2022-latest/win_2022_container_datacenter_64_en

返回

{
    "Parameter": {
    "Constraints": "",
    "CreatedBy": "ACS",
    "CreatedDate": "2023-05-16T02:44:23Z",
    "Description": "",
    "Id": "p-e139e998b54b4f60b6d5",
    "Name": "aliyun/services/ecs/images/windows/win2022-latest/win_2022_container_datacenter_64_en",
    "ParameterVersion": 1,
    "ResourceGroupId": "",
    "ShareType": "Public",
    "Tags": {},
    "Type": "String",
    "UpdatedBy": "ACS",
    "UpdatedDate": "2023-05-16T02:44:23Z",
    "Value": "win2022_21H2_x64_dtc_en-us_40G_container_alibase_20230413.vhd"
    },
    "RequestId": "xxxxxxxxxxxxxxxxxx"
}