You need to enable JavaScript to run this app.
文档中心
复制全文
下载 pdf
云控制API
资源类型和元数据
复制全文
下载 pdf
资源类型和元数据
资源类型​
资源类型(ResourceType)是一种对云资源的抽象描述,包括用户购买的虚拟化资源如 ECS 实例、TOS 桶,也包括用户为了管理虚拟化资源引入的辅助管理资源,比如 ECS 安全组,IAM 子用户等。您可以调用 ListResourceTypes 获取 CloudControl API支持的资源类型清单。​
资源元数据​
资源元数据描述了资源类型的属性、约束和行为等信息,它定义了如何组织和表示资源的数据,使得不同的应用程序和系统可以共享和解释这些资源。所有的 CloudControl API 都是基于资源元数据进行的操作,您可以通过 DescribeResourceType 查询资源元数据详情。​
资源元数据结构​
DescribeResourceType 返回结果的 Schema 结构体为核心的资源元数据信息,包括以下属性类型:​
​
元数据类型​
字段名称​
字段类型​
说明​
基础信息​
typeName​
​
string​
资源类型的抽象描述,格式为Volcengine::服务名称::资源名称,如Volcengine::ECS::Instance​
​
description​
string​
资源类型的描述​
属性配置​
definitions​
​
object​
较为复杂的资源属性结构,可以被资源属性通过"$ref": "#/definitions/资源属性结构"的方式引用​
​
properties​
object​
资源的属性集合,包括属性描述、类型、约束等内容,是资源元数据的核心信息,不支持嵌套属性​
​
primaryIdentifier​
string array​
资源实例的唯一标识符,标识符可以由单个或多个属性组成​
​
additionalProperties​
boolean​
资源元数据中是否允许存在非显示声明的属性,false 为严格模式,不允许设置未被定义成 property 的属性​
属性约束​
required​
string array​
资源创建过程中所必须指定的属性信息​
​
readOnlyProperties​
string array​
read或list请求可以返回,但用户只能查看,不能主动设置的资源属性​
​
writeOnlyProperties​
string array​
可由用户create或update,但不能由read或list请求返回的资源属性。只写属性通常用于包含密码、机密或其他敏感数据。​
​
createOnlyProperties​
string array​
​
只能由用户在资源创建期间设置的资源属性,创建后不支持被update​
接口权限​
​
handlers​
object​
通过 CloudControl API 执行资源 CRUD-L 操作时必须要具备的 OpenAPI 权限​
标签操作​
taggable​
boolean​
此资源类型是否支持标签操作​
​
tagOnCreate​
boolean​
是否支持在资源创建时管理标签​
​
tagUpdatable​
boolean​
是否支持在资源更新时管理标签​
​
资源元数据结构示例​
​
{​
"typeName": "Volcengine::VPC::VPC",​
"description": "私有网络为云上资源构建隔离的、自主配置的虚拟网络环境。可以在私有网络中自定义IP地址段、安全组、路由策略等网络特性,简单高效安全地管理云上资源。",​
"tagging": {​
"taggable": true,​
"tagOnCreate": true,​
"tagUpdatable": true​
},​
"definitions": {​
"AssociateCen": {​
"description": "VPC关联的CEN信息。",​
"properties": {​
"CenId": {​
"description": "CEN的ID。",​
"type": "string"​
},​
"CenOwnerId": {​
"description": "CEN的用户ID。",​
"type": "string"​
},​
"CenStatus": {​
"description": "VPC在CEN中的状态。Attaching:加载中,Attached:已加载",​
"type": "string",​
"enum": [​
"Attaching",​
"Attached"​
]​
}​
},​
"type": "object"​
},​
"Tag": {​
"description": "资源标签。",​
"required": [​
"Key",​
"Value"​
],​
"properties": {​
"Key": {​
"description": "标签键。",​
"type": "string"​
},​
"Value": {​
"description": "标签值。",​
"type": "string"​
}​
},​
"type": "object"​
}​
},​
"properties": {​
"AccountId": {​
"description": "VPC所属账号的ID。",​
"type": "string"​
},​
"AssociateCens": {​
"description": "VPC关联的CEN信息。",​
"uniqueItems": true,​
"type": "array",​
"items": {​
"$ref": "#/definitions/AssociateCen"​
},​
"insertionOrder": false​
},​
"CidrBlock": {​
"description": "VPC的IPv4网段。您可以使用以下网段或其子集作为VPC的IPv4网段:192.168.0.0/16 ~ 24、10.0.0.0/8 ~ 24、172.16.0.0/12 ~ 24。",​
"type": "string"​
},​
"CreationTime": {​
"description": "创建VPC的时间。",​
"type": "string",​
"semantic": "createdTime"​
},​
"Description": {​
"description": "VPC的描述信息。长度限制为0~ 255个字符。不填默认为空字符串。需要以字母、中文或数字开头。可包含英文逗号(,)、点号(.)、下划线(_)、空格( )、等号(=)、短横线(-)、中文逗号(,)、中文句号(。)。不能以http://或https://开头。",​
"maxLength": 255,​
"minLength": 0,​
"type": "string",​
"semantic": "description"​
},​
"DnsServers": {​
"description": "VPC的DNS服务器地址。单次调用数量上限为5个,每个DnsServer必须以合法IP形式给出。多个IP之间用&分隔。不填则配置为默认DNS服务器地址。",​
"maxItems": 5,​
"uniqueItems": true,​
"type": "array",​
"items": {​
"type": "string"​
},​
"insertionOrder": false​
},​
"EnableIpv6": {​
"description": "是否开启IPv6网段。false(默认值):不开启。true:开启。",​
"type": "boolean"​
},​
"Ipv4GatewayId": {​
"description": "VPC 绑定的 IPv4 网关的 ID。",​
"type": "string"​
},​
"Ipv6CidrBlock": {​
"description": "VPC的IPv6网段。传入此参数后,参数Ipv6MaskLen不生效。参数Ipv6Isp传入非BGP后,参数Ipv6MaskLen和参数Ipv6CidrBlock二者必须传入一个。参数Ipv6Isp未传或传入BGP,此参数未传,则由系统自动分配IPv6网段。",​
"type": "string"​
},​
"IsDefault": {​
"description": "该VPC是否为默认VPC。true:默认VPC,表示该VPC是创建ECS实例时系统自动创建的VPC。false:非默认VPC,表示该VPC是用户手动创建的。",​
"type": "boolean"​
},​
"NatGatewayIds": {​
"description": "VPC中创建的NAT网关的ID。",​
"uniqueItems": true,​
"type": "array",​
"items": {​
"type": "string"​
},​
"insertionOrder": false​
},​
"NetworkAclNum": {​
"description": "VPC中的网络ACL的数量。",​
"type": "string"​
},​
"ProjectName": {​
"description": "VPC所属项目的名称。不填默认加入default项目。",​
"type": "string",​
"semantic": "projectName"​
},​
"RouteTableIds": {​
"description": "VPC关联的路由表ID。",​
"uniqueItems": true,​
"type": "array",​
"items": {​
"type": "string"​
},​
"insertionOrder": false​
},​
"SecondaryCidrBlocks": {​
"description": "VPC的辅助网段。",​
"uniqueItems": true,​
"type": "array",​
"items": {​
"type": "string"​
},​
"insertionOrder": false​
},​
"SecurityGroupIds": {​
"description": "VPC中安全组的列表。",​
"uniqueItems": true,​
"type": "array",​
"items": {​
"type": "string"​
},​
"insertionOrder": false​
},​
"Status": {​
"description": "VPC的状态。Creating:创建中。Pending:已创建。Available:可用。",​
"type": "string",​
"enum": [​
"Creating",​
"Pending",​
"Available"​
],​
"semantic": "status"​
},​
"SubnetIds": {​
"description": "VPC中子网的列表。",​
"uniqueItems": true,​
"type": "array",​
"items": {​
"type": "string"​
},​
"insertionOrder": false​
},​
"SupportIpv4Gateway": {​
"description": "VPC 是否启用 IPv4 网关。false(默认值):不启用。true:启用。",​
"type": "boolean"​
},​
"Tags": {​
"description": "私有网络绑定的标签。",​
"uniqueItems": true,​
"type": "array",​
"items": {​
"$ref": "#/definitions/Tag"​
},​
"insertionOrder": false,​
"semantic": "tags"​
},​
"UpdateTime": {​
"description": "更新VPC的时间。",​
"type": "string",​
"semantic": "updatedTime"​
},​
"UserCidrBlocks": {​
"description": "VPC的用户网段。",​
"uniqueItems": true,​
"type": "array",​
"items": {​
"type": "string"​
},​
"insertionOrder": false​
},​
"VpcId": {​
"description": "VPC的ID。",​
"type": "string",​
"semantic": "resourceId"​
},​
"VpcName": {​
"description": "VPC的名称。长度限制为1 ~ 128个字符。需要以字母、中文或数字开头,可包含点号(.)、下划线(_)和短横线(-)。不填默认为VPC实例的ID。不能以http://或https://开头。",​
"maxLength": 128,​
"minLength": 1,​
"type": "string",​
"semantic": "resourceName"​
}​
},​
"readOnlyProperties": [​
"/properties/VpcId",​
"/properties/CreationTime",​
"/properties/UpdateTime",​
"/properties/Status",​
"/properties/AccountId",​
"/properties/IsDefault",​
"/properties/NetworkAclNum"​
],​
"createOnlyProperties": [​
"/properties/ClientToken",​
"/properties/CidrBlock",​
"/properties/ProjectName",​
"/properties/SupportIpv4Gateway",​
"/properties/Ipv4GatewayId"​
],​
"primaryIdentifier": [​
"/properties/VpcId"​
],​
"additionalProperties": false,​
"handlers": {​
"create": {​
"permissions": [​
"vpc:CreateVpc",​
"vpc:DescribeVpcAttributes",​
"vpc:DisassociateVpcCidrBlock",​
"vpc:AssociateVpcCidrBlock"​
]​
},​
"delete": {​
"permissions": [​
"vpc:DeleteVpc",​
"vpc:DescribeVpcAttributes"​
]​
},​
"list": {​
"permissions": [​
"vpc:DescribeVpcs"​
]​
},​
"read": {​
"permissions": [​
"vpc:DescribeVpcAttributes"​
]​
},​
"update": {​
"permissions": [​
"vpc:DescribeVpcAttributes",​
"vpc:DisassociateVpcCidrBlock",​
"vpc:AssociateVpcCidrBlock",​
"vpc:UntagResources",​
"vpc:TagResources",​
"vpc:ModifyVpcAttributes"​
]​
}​
}​
}​
​
最近更新时间:2025.09.25 16:37:12
这个页面对您有帮助吗?
有用
有用
无用
无用