This topic describes how to use Alibaba Cloud CLI version 3.0.25 or later to call API operations related to resources.

GetResourceType

You can call this operation to query details about a resource type.

Parameter Type Required Example Description
--ResourceType String Yes ALIYUN::ROS::WaitConditionHandle

The type of the resource.

Sample requests

aliyun ros GetResourceType --ResourceType ALIYUN::ECS::VPC

Sample success responses

{
        "Attributes": {
                "RouteTableId": {
                        "Description": "The router table id of created VPC."
                },
                "VRouterId": {
                        "Description": "Router id of created VPC."
                },
                "VpcId": {
                        "Description": "Id of created VPC."
                }
        },
        "ResourceType": "ALIYUN::ECS::VPC",
        "RequestId": "8A897F64-6A61-446A-A913-30CA572EE181",
        "Properties": {
                "CidrBlock": {
                        "Required": false,
                        "Description": "The IP address range of the VPC in the CIDR block form. You can use the following IP address ranges and their subnets:\n10.0.0.0/8\n172.16.0.0/12 (Default)\n192.168.0.0/16",
                        "Immutable": true,
                        "Type": "string",
                        "Constraints": [
                                {
                                        "CustomConstraint": "vpc.cidr"
                                }
                        ],
                        "UpdateAllowed": false
                },
                "VpcName": {
                        "Required": false,
                        "Description": "Display name of the vpc instance, [2, 128] English or Chinese characters, must start with a letter or Chinese in size, can contain numbers, '_' or '.', '-'",
                        "Immutable": false,
                        "Type": "string",
                        "Constraints": [
                                {
                                        "CustomConstraint": "ecs.name"
                                }
                        ],
                        "UpdateAllowed": false
                },
                "Description": {
                        "Required": false,
                        "Description": "Description of the vpc, [2, 256] characters. Do not fill or empty, the default is empty.",
                        "Immutable": false,
                        "Type": "string",
                        "Constraints": [
                                {
                                        "CustomConstraint": "ecs.description"
                                }
                        ],
                        "UpdateAllowed": false
                },
                "ResourceGroupId": {
                        "Description": "Resource group id.",
                        "Required": false,
                        "Immutable": false,
                        "Type": "string",
                        "UpdateAllowed": false
                }
        }
}

GetResourceTypeTemplate

You can call this operation to query the template of a resource by resource type.

Parameter Type Required Example Description
--ResourceType String Yes ALIYUN::ECS::VPC

The type of the resource.

Sample requests

aliyun ros GetResourceTypeTemplate --ResourceType ALIYUN::ECS::VPC

Sample success responses

{
        "TemplateBody": {
                "Outputs": {
                        "RouteTableId": {
                                "Value": {
                                        "Fn::GetAtt": [
                                                "Vpc",
                                                "RouteTableId"
                                        ]
                                },
                                "Description": "The router table id of created VPC."
                        },
                        "VRouterId": {
                                "Value": {
                                        "Fn::GetAtt": [
                                                "Vpc",
                                                "VRouterId"
                                        ]
                                },
                                "Description": "Router id of created VPC."
                        },
                        "VpcId": {
                                "Value": {
                                        "Fn::GetAtt": [
                                                "Vpc",
                                                "VpcId"
                                        ]
                                },
                                "Description": "Id of created VPC."
                        }
                },
                "Parameters": {
                        "CidrBlock": {
                                "Description": "The IP address range of the VPC in the CIDR block form. You can use the following IP address ranges and their subnets:\n10.0.0.0/8\n172.16.0.0/12 (Default)\n192.168.0.0/16",
                                "Type": "String"
                        },
                        "VpcName": {
                                "Description": "Display name of the vpc instance, [2, 128] English or Chinese characters, must start with a letter or Chinese in size, can contain numbers, '_' or '.', '-'",
                                "Type": "String"
                        },
                        "Description": {
                                "Description": "Description of the vpc, [2, 256] characters. Do not fill or empty, the default is empty.",
                                "Type": "String"
                        },
                        "ResourceGroupId": {
                                "Description": "Resource group id.",
                                "Type": "String"
                        }
                },
                "ROSTemplateFormatVersion": "2015-09-01",
                "Resources": {
                        "Vpc": {
                                "Type": "ALIYUN::ECS::VPC",
                                "Properties": {
                                        "CidrBlock": {
                                                "Ref": "CidrBlock"
                                        },
                                        "VpcName": {
                                                "Ref": "VpcName"
                                        },
                                        "Description": {
                                                "Ref": "Description"
                                        },
                                        "ResourceGroupId": {
                                                "Ref": "ResourceGroupId"
                                        }
                                }
                        }
                }
        },
        "RequestId": "F79C5749-A43E-4915-9FF1-60BD760E822B"
}

GetStackResource

You can call this operation to query information about a resource in a specific stack.

Parameter Type Required Example Description
--RegionId String Yes cn-hangzhou

The region ID of the stack. You can call the DescribeRegions operation to query the most recent region list.

--StackId String Yes 4a6c9851-3b0f-4f5f-b4ca-a14bf691****

The ID of the stack.

--LogicalResourceId String Yes WebServer

The logical resource ID defined in the template.

--ShowResourceAttributes Boolean No true

Specifies whether to query resource attributes.

--ClientToken String No 123e4567-e89b-12d3-a456-42665544****

The client token that is used to ensure the idempotence of the request. You can use the client to generate the value, but you must ensure that it is unique among different requests. The token can contain only letters, digits, hyphens (-), and underscores (_) and cannot exceed 64 characters in length. For more information, see How to ensure idempotence.

Sample requests

aliyun ros GetStackResource --RegionId cn-beijing --StackId bd98e636-68e9-4632-82df-ce2aba56**** --LogicalResourceId Test-VPC

Sample success responses

{
        "LogicalResourceId": "Test-VPC",
        "Description": "",
        "StackId": "bd98e636-68e9-4632-82df-ce2aba56****",
        "UpdateTime": "2019-09-04T13:22:54",
        "StackName": "CLI-Test-VPC",
        "StatusReason": "state changed",
        "Status": "CREATE_COMPLETE",
        "PhysicalResourceId": "vpc-2ze4leztt48nn5u3o****",
        "ResourceType": "ALIYUN::ECS::VPC",
        "RequestId": "686DC916-FF92-42E1-A9CA-63B811ACDF88",
        "CreateTime": "2019-09-04T13:22:51",
        "Metadata": {}
}

ListStackResources

You can call this operation to query the resource list of a specific stack.

Parameter Type Required Example Description
--RegionId String Yes cn-hangzhou

The region ID of the stack. You can call the DescribeRegions operation to query the most recent region list.

--StackId String Yes 4a6c9851-3b0f-4f5f-b4ca-a14bf691****

The ID of the stack.

Sample requests

aliyun ros ListStackResources --RegionId cn-beijing --StackId bd98e636-68e9-4632-82df-ce2aba56****

Sample success responses

{
        "RequestId": "F6D7A5E4-E557-4A8D-A2EF-96036E22BD77",
        "Resources": [
                {
                        "StatusReason": "state changed",
                        "Status": "CREATE_COMPLETE",
                        "PhysicalResourceId": "vpc-2ze4leztt48nn5u3o****",
                        "LogicalResourceId": "MyVPC",
                        "ResourceType": "ALIYUN::ECS::VPC",
                        "StackId": "bd98e636-68e9-4632-82df-ce2aba56****",
                        "CreateTime": "2019-09-04T13:22:51",
                        "UpdateTime": "2019-09-04T13:22:54",
                        "StackName": "CLI-Test-VPC"
                }
        ]
}

ListResourceTypes

You can call this operation to query the list of supported resource types.

Sample requests

aliyun ros ListResourceTypes

Sample success responses

{
        "RequestId": "E78F6F42-209A-4F60-89AF-BC0BCEB3DDA5",
        "ResourceTypes": [
                "ALIYUN::ACTIONTRAIL::Trail",
                "ALIYUN::ACTIONTRAIL::TrailLogging",
                "ALIYUN::ApiGateway::Api",
                "ALIYUN::ApiGateway::App",
                "ALIYUN::ApiGateway::Authorization",
                "ALIYUN::ApiGateway::CustomDomain",
                "ALIYUN::ApiGateway::Deployment",
                "ALIYUN::ApiGateway::Group",
                "ALIYUN::ApiGateway::Signature",
                "ALIYUN::ApiGateway::SignatureBinding",
                "ALIYUN::ApiGateway::StageConfig",
                "ALIYUN::ApiGateway::TrafficControl",
                "ALIYUN::ApiGateway::TrafficControlBinding",
                "ALIYUN::ApiGateway::VpcAccessConfig",
                "ALIYUN::BSS::WaitOrder",
                "ALIYUN::CAS::Certificate",
                "ALIYUN::CDN::Domain",
                "ALIYUN::CDN::DomainConfig",
                "ALIYUN::CEN::CenBandwidthLimit",
                "ALIYUN::CEN::CenBandwidthPackage",
                "ALIYUN::CEN::CenBandwidthPackageAssociation",
                "ALIYUN::CEN::CenInstance",
                "ALIYUN::CEN::CenInstanceAttachment",
                "ALIYUN::CEN::RouteEntry",
                "ALIYUN::CMS::MonitorGroup",
                "ALIYUN::CR::Namespace",
                "ALIYUN::CR::Repository",
                "ALIYUN::CS::App",
                "ALIYUN::CS::Cluster",
                "ALIYUN::DNS::Domain",
                "ALIYUN::DNS::DomainGroup",
                "ALIYUN::DNS::DomainRecord",
                "ALIYUN::DRDS::DrdsInstance",
                "ALIYUN::ECI::ContainerGroup",
                "ALIYUN::ECS::AutoSnapshotPolicy",
                "ALIYUN::ECS::BandwidthPackage",
                "ALIYUN::ECS::Command",
                "ALIYUN::ECS::CopyImage",
                "ALIYUN::ECS::CustomImage",
                "ALIYUN::ECS::DedicatedHost",
                "ALIYUN::ECS::DeploymentSet",
                "ALIYUN::ECS::Disk",
                "ALIYUN::ECS::DiskAttachment",
                "ALIYUN::ECS::ForwardEntry",
                "ALIYUN::ECS::Instance",
                "ALIYUN::ECS::InstanceClone",
                "ALIYUN::ECS::InstanceGroup",
                "ALIYUN::ECS::InstanceGroupClone",
                "ALIYUN::ECS::Invocation",
                "ALIYUN::ECS::JoinSecurityGroup",
                "ALIYUN::ECS::LaunchTemplate",
                "ALIYUN::ECS::NatGateway",
                "ALIYUN::ECS::NetworkInterface",
                "ALIYUN::ECS::NetworkInterfaceAttachment",
                "ALIYUN::ECS::NetworkInterfacePermission",
                "ALIYUN::ECS::PrepayInstance",
                "ALIYUN::ECS::PrepayInstanceGroupClone",
                "ALIYUN::ECS::Route",
                "ALIYUN::ECS::SNatEntry",
                "ALIYUN::ECS::SSHKeyPair",
                "ALIYUN::ECS::SSHKeyPairAttachment",
                "ALIYUN::ECS::SecurityGroup",
                "ALIYUN::ECS::SecurityGroupClone",
                "ALIYUN::ECS::SecurityGroupEgress",
                "ALIYUN::ECS::SecurityGroupIngress",
                "ALIYUN::ECS::Snapshot",
                "ALIYUN::ECS::VPC",
                "ALIYUN::ECS::VSwitch",
                "ALIYUN::EMR::Cluster",
                "ALIYUN::ESS::AlarmTask",
                "ALIYUN::ESS::AlarmTaskEnable",
                "ALIYUN::ESS::LifecycleHook",
                "ALIYUN::ESS::ScalingConfiguration",
                "ALIYUN::ESS::ScalingGroup",
                "ALIYUN::ESS::ScalingGroupEnable",
                "ALIYUN::ESS::ScalingRule",
                "ALIYUN::ESS::ScheduledTask",
                "ALIYUN::ElasticSearch::Instance",
                "ALIYUN::FC::CustomDomain",
                "ALIYUN::FC::Function",
                "ALIYUN::FC::FunctionInvoker",
                "ALIYUN::FC::Service",
                "ALIYUN::FC::Trigger",
                "ALIYUN::FNF::Flow",
                "ALIYUN::KMS::Alias",
                "ALIYUN::KMS::Key",
                "ALIYUN::MEMCACHE::Instance",
                "ALIYUN::MNS::Queue",
                "ALIYUN::MNS::Subscription",
                "ALIYUN::MNS::Topic",
                "ALIYUN::MONGODB::Instance",
                "ALIYUN::MarketPlace::Image",
                "ALIYUN::MarketPlace::Order",
                "ALIYUN::NAS::AccessGroup",
                "ALIYUN::NAS::AccessRule",
                "ALIYUN::NAS::FileSystem",
                "ALIYUN::NAS::MountTarget",
                "ALIYUN::OSS::Bucket",
                "ALIYUN::OTS::Instance",
                "ALIYUN::OTS::VpcBinder",
                "ALIYUN::PVTZ::Zone",
                "ALIYUN::PVTZ::ZoneRecord",
                "ALIYUN::PVTZ::ZoneVpcBinder",
                "ALIYUN::RAM::AccessKey",
                "ALIYUN::RAM::AttachPolicyToRole",
                "ALIYUN::RAM::Group",
                "ALIYUN::RAM::ManagedPolicy",
                "ALIYUN::RAM::Role",
                "ALIYUN::RAM::User",
                "ALIYUN::RAM::UserToGroupAddition",
                "ALIYUN::RDS::Account",
                "ALIYUN::RDS::AccountPrivilege",
                "ALIYUN::RDS::DBInstance",
                "ALIYUN::RDS::DBInstanceParameterGroup",
                "ALIYUN::RDS::DBInstanceSecurityIps",
                "ALIYUN::RDS::PrepayDBInstance",
                "ALIYUN::REDIS::Instance",
                "ALIYUN::REDIS::PrepayInstance",
                "ALIYUN::ROS::Stack",
                "ALIYUN::ROS::WaitCondition",
                "ALIYUN::ROS::WaitConditionHandle",
                "ALIYUN::SAG::ACL",
                "ALIYUN::SAG::ACLAssociation",
                "ALIYUN::SAG::ACLRule",
                "ALIYUN::SAG::CloudConnectNetwork",
                "ALIYUN::SAG::SmartAccessGatewayBinding",
                "ALIYUN::SLB::AccessControl",
                "ALIYUN::SLB::BackendServerAttachment",
                "ALIYUN::SLB::BackendServerToVServerGroupAddition",
                "ALIYUN::SLB::Certificate",
                "ALIYUN::SLB::DomainExtension",
                "ALIYUN::SLB::Listener",
                "ALIYUN::SLB::LoadBalancer",
                "ALIYUN::SLB::LoadBalancerClone",
                "ALIYUN::SLB::MasterSlaveServerGroup",
                "ALIYUN::SLB::Rule",
                "ALIYUN::SLB::VServerGroup",
                "ALIYUN::SLS::ApplyConfigToMachineGroup",
                "ALIYUN::SLS::MachineGroup",
                "ALIYUN::UIS::Uis",
                "ALIYUN::UIS::UisConnection",
                "ALIYUN::UIS::UisNode",
                "ALIYUN::VPC::CustomerGateway",
                "ALIYUN::VPC::EIP",
                "ALIYUN::VPC::EIPAssociation",
                "ALIYUN::VPC::PeeringRouterInterfaceBinding",
                "ALIYUN::VPC::PeeringRouterInterfaceConnection",
                "ALIYUN::VPC::RouterInterface",
                "ALIYUN::VPC::SnatEntry",
                "ALIYUN::VPC::SslVpnClientCert",
                "ALIYUN::VPC::SslVpnServer",
                "ALIYUN::VPC::VpnConnection",
                "ALIYUN::VPC::VpnGateway"
        ]
}