华为云用户手册

  • 响应示例 { "resCode": "0", "resMsg": "成功", "result": { "tableInfo": { "id": "cust000000aKtFZpERvc", "keyPrefix": "cRvc", "name": "test__dfg__ CS T", "category": 3, "label": "dfg", "pluralLabel": "dfgs", "version": 0, "contextSetup": 0, "trackFieldHistory": false, "allowReports": false, "allowActivities": false, "allowChatter": false, "allowStreamingApiAccess": false, "allowBulkApiAccess": false, "allowSearch": false, "allowSharing": false, "sharingMode": 0, "deploymentStatus": 0, "properties": "", "status": 0, "createdBy": "10gd000000SDyqaQW6uu", "createdDate": "2020-05-28 17:01:02", "lastModifiedBy": "10gd000000SDyqaQW6uu", "lastModifiedDate": "2020-05-28 17:01:02", "description": "", "objectType": 0, "protectMode": 0, "installedPackage": "", "createdBy.name": "test0xx", "lastModifiedBy.name": "test0xx" }, "childObjects": null, "parentObjects": [ { "parentObject": "stad00000000000000GD", "cascadeDelete": false }, { "parentObject": "stad00000000000000GG", "cascadeDelete": false }, { "parentObject": "stup000000000000002I", "cascadeDelete": false }, { "parentObject": "stup000000000000003L", "cascadeDelete": false } ] } }
  • 响应参数 表2 响应参数 参数 参数类型 描述 resCode String 参数解释: 返回码。 取值范围: 如果返回“0”代表请求成功,其他错误码说明请参考错误码。 resMsg String 参数解释: 返回消息。 取值范围: 如果成功状态,通常会返回“Success”,其他情况会返回具体的错误信息。 result Object 参数解释: 成功返回对象各字段的详细信息,包含表信息,被依赖和依赖的表信息。
  • 响应参数 状态码: 200 表4 响应Body参数 参数 参数类型 描述 comments String 备注 config_key String 配置键 config_type String 配置类型 config_value String 配置值 create_time String 创建时间 create_user String 创建者 id String UUID test_service_id String 服务id update_time String 修改时间 update_user String 修改者 状态码: 401 表5 响应Body参数 参数 参数类型 描述 error_code String 错误编码 最小长度:1 最大长度:50 error_msg String 错误原因 最小长度:1 最大长度:256 状态码: 403 表6 响应Body参数 参数 参数类型 描述 error_code String 错误编码 最小长度:1 最大长度:50 error_msg String 错误原因 最小长度:1 最大长度:256 状态码: 404 表7 响应Body参数 参数 参数类型 描述 error_code String 错误编码 最小长度:1 最大长度:50 error_msg String 错误原因 最小长度:1 最大长度:256
  • 响应参数 状态码: 200 表4 响应Body参数 参数 参数类型 描述 testcases Array of TestCaseVo objects 用例详情 total_count Integer 用例总数 page_no Integer 页码 page_size Integer 每页数量 表5 TestCaseVo 参数 参数类型 描述 uri String 用例ID number String 用例编号 name String 用例名称 rank String 用例等级 dr_relation_id String 工作项id status_code String 状态ID status_name String 状态名称 author String 创建人名称 author_id String 创建人ID owner String 处理人名称 project_uuid String 项目ID test_type String 测试类型 creation_date String 创建时间 状态码: 400 表6 响应Body参数 参数 参数类型 描述 error_code String 接口调用失败错误码 error_msg String 接口调用失败错误信息 状态码: 401 表7 响应Body参数 参数 参数类型 描述 error_code String 接口调用失败错误码 error_msg String 接口调用失败错误信息 状态码: 404 表8 响应Body参数 参数 参数类型 描述 error_code String 接口调用失败错误码 error_msg String 接口调用失败错误信息 状态码: 500 表9 响应Body参数 参数 参数类型 描述 error_code String 接口调用失败错误码 error_msg String 接口调用失败错误信息
  • 响应参数 状态码: 200 表4 响应Body参数 参数 参数类型 描述 end_row Long 结束行 has_next_page Boolean 是否有下一页 has_previous_page Boolean 是否有上一页 is_first_page Boolean 是否是第一页 is_last_page Boolean 是否是最后一页 list Array of AlertTemplateVo objects 当前页面的模板 navigate_first_page Integer 导航第一页数字 navigate_last_page Integer 导航最后一页数字 navigate_pages Integer 导航页数 navigate_page_nums Array of integers 导航页数 next_page Integer 下一页 page_num Integer 多少页 page_size Integer 每页多少个 pages Integer 总页数 pre_page Integer 前面有多少页 size Integer 当前页告警模板数 start_row Long 开始行 total Long 总告警模板数 表5 AlertTemplateVo 参数 参数类型 描述 alert_levels Array of AlertLevel objects 告警级别列表 create_time String 创建时间 create_user String 创建人 id String 唯一ID,主键 name String 告警模板名称 remarks String 备注 test_service_id String 服务ID update_time String 修改时间 update_user String 更新人 表6 AlertLevel 参数 参数类型 描述 alert_channel Array of strings 告警渠道列表 alert_groups Array of AlertGroup objects 告警组列表 alert_template_id String 告警模板ID alert_times Integer 告警次数 表7 AlertGroup 参数 参数类型 描述 ding_talk_hook_url String 企业钉钉微信群聊机器人地址 group_name String 告警组名称 id String 告警组ID we_chat_work_hook_url String 企业微信群聊机器人地址 we_link_group_no String weLink群号 状态码: 401 表8 响应Body参数 参数 参数类型 描述 error_code String 错误编码 最小长度:1 最大长度:50 error_msg String 错误原因 最小长度:1 最大长度:256 状态码: 403 表9 响应Body参数 参数 参数类型 描述 error_code String 错误编码 最小长度:1 最大长度:50 error_msg String 错误原因 最小长度:1 最大长度:256 状态码: 404 表10 响应Body参数 参数 参数类型 描述 error_code String 错误编码 最小长度:1 最大长度:50 error_msg String 错误原因 最小长度:1 最大长度:256
  • 响应参数 状态码: 401 表4 响应Body参数 参数 参数类型 描述 error_code String 错误编码 最小长度:1 最大长度:50 error_msg String 错误原因 最小长度:1 最大长度:256 状态码: 403 表5 响应Body参数 参数 参数类型 描述 error_code String 错误编码 最小长度:1 最大长度:50 error_msg String 错误原因 最小长度:1 最大长度:256 状态码: 404 表6 响应Body参数 参数 参数类型 描述 error_code String 错误编码 最小长度:1 最大长度:50 error_msg String 错误原因 最小长度:1 最大长度:256
  • 请求消息头 附加请求头字段,如指定的URI和HTTP方法所要求的字段。例如,定义消息体类型的请求头“Content-Type”,请求鉴权信息等。 如下公共消息头需要添加到请求中: 名称 描述 是否必选 备注 Content-Type 消息体的类型(格式) 是 默认取值为“application/json”,有其他取值时会在具体接口中专门说明。 X-Auth-Token 用户Token 否 用户Token也就是调用获取用户Token接口的响应值,该接口是唯一不需要认证的接口。 X-Project-ID 子项目ID 否 在多项目场景中使用 X-Domain-ID 账号ID - - 公有云API同时支持使用AK/SK认证,AK/SK认证是使用SDK对请求进行签名,签名过程会自动往请求中添加Authorization(签名认证信息)和X-Sdk-Date(请求发送的时间)请求头。 AK/SK认证的详细说明请参考AK/SK认证。 对于获取用户Token接口,由于不需要认证,所以只添加“Content-Type”即可,添加消息头后的请求如下: POST https://iam.cn-north-1.myhuaweicloud.com/v3/auth/tokens Content-Type: application/json
  • 请求消息体 请求消息体通常以结构化格式发出,与请求消息头中Content-type对应,传递除请求消息头之外的内容。若请求消息体中参数支持中文,则中文字符必须为UTF-8编码。 每个接口的请求消息体内容不同,也并不是每个接口都需要有请求消息体(或者说消息体为空),GET、DELETE操作类型的接口就不需要消息体,消息体具体内容需要根据具体接口而定。 对于获取用户Token接口,您可以从接口的请求部分看到所需的请求参数及参数说明。将消息体加入后的请求如下所示,加粗的斜体字段需要根据实际值填写,其中username为用户名,domainname为用户所属的账号名称,********为用户登录密码,xxxxxxxx为project的ID,获取方法请参见获取项目ID。 scope参数定义了Token的作用域,下面示例中获取的Token仅能访问project下的资源。您还可以设置Token的作用域为某个账号下所有资源或账号的某个project下的资源,详细定义请参见获取用户Token。 POST https://iam.cn-north-1.myhuaweicloud.com/v3/auth/tokens Content-Type: application/json { "auth": { "identity": { "methods": [ "password" ], "password": { "user": { "name": "username", "password": "********", "domain": { "name": "domainname" } } } }, "scope": { "project": { id": "xxxxxxxx" } } } } 到这里为止这个请求需要的内容就具备齐全了,您可以使用curl、Postman或直接编写代码等方式发送请求调用API。对于获取用户Token接口,返回的响应消息头中“x-subject-token”就是需要获取的用户Token。有了Token之后,您就可以使用Token认证调用其他API。
  • 请求方法 HTTP请求方法(也称为操作或动词),它告诉服务你正在请求什么类型的操作。详情如下: 请求方法 说明 GET 请求服务器返回指定资源。 PUT 请求服务器更新指定资源。 POST 请求服务器新增资源或执行特殊操作。 DELETE 请求服务器删除指定资源,如删除对象等。 HEAD 请求服务器资源头部。 在获取用户Token的URI部分,若请求方法为POST,则其请求为: POST https://iam.cn-north-1.myhuaweicloud.com/v3/auth/tokens
  • 请求URI 尽管请求URI包含在请求消息头中,但大多数语言或框架都要求您从请求消息中单独传递它,所以在此单独强调。 请求URI由四部分构成:{URI-scheme} :// {Endpoint} / {resource-path} ? {query-string}。 各参数含义如下: 参数 说明 URI-scheme 表示用于传输请求的协议,当前所有API均采用HTTPS协议。 Endpoint 指定承载REST服务端点的服务器 域名 或IP,不同服务不同区域的Endpoint不同,您可以从地区和终端节点中获取。 例如, IAM 服务在华北-北京一区域的Endpoint为iam.cn-north-1.myhuaweicloud.com。 resource-path 资源路径,即API访问路径,从具体API的URI模块获取。例如,获取用户Token接口的resource-path为/v3/auth/tokens。 query-string 查询参数,是可选部分,并不是每个API都有查询参数。查询参数前面需要带一个?,形式为参数名=参数取值。例如,limit=10表示查询不超过10条数据。 例如:如果需要获取IAM在“华北-北京一”区域的Token,则需使用“华北-北京一”区域的Endpoint(iam.cn-north-1.myhuaweicloud.com),并在获取用户Token的URI部分找到resource-path(/v3/auth/tokens),拼接起来如下所示: https://iam.cn-north-1.myhuaweicloud.com/v3/auth/tokens 图1 URI示意图 为查看方便,在每个具体API的URI部分,只给出resource-path部分,并将请求方法写在一起。这是因为URI-scheme都是HTTPS,而Endpoint在同一个区域也相同,所以简洁起见将这两部分省略。
  • 响应参数 状态码: 200 表3 响应Body参数 参数 参数类型 描述 total Integer 起始记录数 大于 实际总条数时, 值为0, 分页请求才有此值 value Array of TestCaseVo objects 实际的数据类型:单个对象,集合 或 NULL reason String 业务失败的提示内容,对内接口才有此值 page_size Integer 每页展示条数 page_no Integer 页码 has_more Boolean 是否有更多 表4 TestCaseVo 参数 参数类型 描述 uri String 资源URI type String 资源类型 author String 创建人 name String 名称 rank Integer 级别 preparation String 前置条件 remark String 备注 stage String 测试阶段 activity String 测试类型 keywords String 关键词 market String apitest标记是否代码已提交 designer String 设计者 tags String 标签 execute_parameter String 执行参数 region String 逻辑region owner String 处理人id,IteratorTestCase字段 last_modifier String 最后修改人 last_modified String 最后修改时间 last_modified_timestamp Long 修改时间时间戳 last_change_time String 最后变更时间 version_uri String 版本URI origin_uri String 源资源URI parent_uri String 父资源URI parent_path String 父资源路径 creation_version_uri String 创建版本URI creation_date String 创建时间 creation_date_timestamp Long 创建时间时间戳 author_name String 创建人名称 comment String 备注 number String 编号 case_type Integer 用例类型 platform_type Integer 执行平台类型 service_type Integer 服务类型 service_type_name String 服务类型名称 test_type Integer 测试类型 test_type_name String 测试类型名称 design_note String 设计描述 test_step String 测试步骤 expect_output String 期望结果 env_type String 测试环境类型 exe_platform String 执行平台 testcase_project String 测试工程 svn_script_path String 脚本路径 map_restrict String 约束条件 network_script_name String 网络脚本名 auto_type Integer 自动化类型,非自动化:0, 是自动化:1 to_be_auto_exec Integer 被自动化执行 last_result String 最后一次结果 last_result_uri String 最后一次结果Uri feature_uri String 目录Uri feature_name String 目录名称 interface_name String 测试接口名 snp_no String 网络问题ID dr_relation_id String 关联需求编号 issue_name String 需求名称 test_base_num String 测试基数 automatically_executed Integer 是否被自动化执行 first_execute_time String 第一次执行时间 detect_type String 检测类型 execute_param String 执行参数 test_feature String 分析领域 is_contract_testcase Integer 是否是契约用例,0:表示非契约用例, 1:表示契约用例 time_cost Double 总共耗时 be_auto_type_time String 记录用例由非自动化变为自动化类型的时间 compare_number String 配对用例编号 scene_flag String 场景标识 base_flag String 场景标识 para_validator String 区别是否从yaml中生成的用例,默认false knet_node_id String knet节点id last_exe_author String 最后一次执行用户 cloud_carrier String 运营商 market_place String 应用市场 test_mind_id String 脑图id test_mind_url String 脑图url commit_url String git提交url test_pattern_number String 测试模式编号 test_factor_number String 测试因子编号 status_code String 状态Code result_code String 结果Code release_id String 迭代ID label_id String 标签ID labels String 用例标签名称列表 module_id String 模块ID module_name String 模块名称 module_path String 模块path module_path_name String 模块路径名称 execute_latest_time String 最后执行时间 execute_duration String 执行时长 execute_times Integer 执行次数 is_keyword Integer 是否关键用例 release_dev String 测试版本号 new_created String 是否用户新增用例 project_uuid String 项目ID creation_version_name String 创建版本名称,原逻辑marshall添加字段 feature_path String 特性路径,原逻辑marshall添加字段 testcase_uri String 实体用例Uri,IteratorTestCase字段 owner_name String 处理人名称 iterator_case_uri String 迭代用例Uri,IteratorTestCase字段 script_link String 脚本链接scriptLink custom_field_1 String 自定义字段1 custom_field_2 String 自定义字段2 custom_field_3 String 自定义字段3 custom_field_4 String 自定义字段4 custom_field_5 String 自定义字段5 custom_field_6 String 自定义字段6 custom_field_7 String 自定义字段7 custom_field_8 String 自定义字段8 custom_field_9 String 自定义字段9 custom_field_10 String 自定义字段10 custom_field_11 String 自定义字段11 custom_field_12 String 自定义字段12 custom_field_13 String 自定义字段13 custom_field_14 String 自定义字段14 custom_field_15 String 自定义字段15 custom_field_16 String 自定义字段16 custom_field_17 String 自定义字段17 custom_field_18 String 自定义字段18 custom_field_19 String 自定义字段19 custom_field_20 String 自定义字段20 custom_field_21 String 自定义字段21 custom_field_22 String 自定义字段22 custom_field_23 String 自定义字段23 custom_field_24 String 自定义字段24 custom_field_25 String 自定义字段25 状态码: 400 表5 响应Body参数 参数 参数类型 描述 code String 业务失败的错误码 reason String 业务失败的提示内容 状态码: 401 表6 响应Body参数 参数 参数类型 描述 code String 业务失败的错误码 reason String 业务失败的提示内容 状态码: 404 表7 响应Body参数 参数 参数类型 描述 code String 业务失败的错误码 reason String 业务失败的提示内容 状态码: 500 表8 响应Body参数 参数 参数类型 描述 code String 业务失败的错误码 reason String 业务失败的提示内容
  • 响应示例 状态码: 200 OK { "status" : "success", "result" : { "page_no" : 1, "page_size" : 10, "total_page" : 1, "total_size" : 1, "page_list" : [ { "id" : "dfaba6a51f024c1f95229c1059ca34e0", "warningMsg" : null, "source" : "", "method" : "", "description" : null, "nameView" : null, "tmssCaseNumber" : null, "region" : null, "yamlName" : null, "create_time_string" : "2024-04-11 19:48:13 GMT+08:00", "update_time_string" : "2024-04-11 19:48:13 GMT+08:00", "create_time_stamp" : 1712836093000, "update_time_stamp" : 1712836093000, "create_user" : "devcloud_devcloud_s00314720_01", "create_time" : "2024-04-11T07:48:13+0800", "update_user" : "devcloud_devcloud_s00314720_01", "update_time" : "2024-04-11T07:48:13+0800", "name" : "默认文件夹", "param_type_and_dft_value" : null, "dft_custom_header" : null, "dft_check_point_list" : null, "dft_variable_list" : null, "keyword_variable_value" : null, "dft_retry_times" : "", "dft_retry_interval" : "", "return_type" : "", "aw_type" : 0, "aw_ins_list" : null, "project_id" : "09645c1f3f954a8d9ab29174857cffc5", "public_aw_lib_id" : "", "special_type" : null, "has_code" : null, "aw_code" : "", "group_name" : "", "protocol_type" : "", "by_order" : null, "aw_mark" : null, "output_param_list" : null, "is_favorite" : null, "tmss_case_id" : null, "create_user_id" : "", "aw_description" : null, "origin_project" : null, "aw_uniqueid" : null, "aw_tags" : null, "aw_operationid" : null, "interface_label" : null, "import_package" : null, "public_aw_lib" : null, "root_id" : null, "custom_aw_libs" : null, "delete_time" : null, "delete_user" : null, "parent_id" : "TOP", "is_folder" : "0", "cata_type" : 4, "page_no" : null, "page_size" : null, "total_page" : null, "total_size" : null, "child_list" : [ ], "extra_info" : null } ] }, "reason" : null, "error" : null, "code" : null }
  • 响应参数 状态码: 200 表4 响应Body参数 参数 参数类型 描述 [数组元素] Array of AlertStatisticsDto objects OK 表5 AlertStatisticsDto 参数 参数类型 描述 block_alert_count Integer 阻塞告警次数 exception_alert_count Integer 异常告警次数 fail_alert_count Integer 失败告警次数 service_id String 服务id statistics_time Long 统计时间 timeout_alert_count Integer 超时告警次数 状态码: 401 表6 响应Body参数 参数 参数类型 描述 error_code String 错误编码 最小长度:1 最大长度:50 error_msg String 错误原因 最小长度:1 最大长度:256 状态码: 403 表7 响应Body参数 参数 参数类型 描述 error_code String 错误编码 最小长度:1 最大长度:50 error_msg String 错误原因 最小长度:1 最大长度:256 状态码: 404 表8 响应Body参数 参数 参数类型 描述 error_code String 错误编码 最小长度:1 最大长度:50 error_msg String 错误原因 最小长度:1 最大长度:256
  • 响应参数 状态码: 200 表4 响应Body参数 参数 参数类型 描述 list Array of DashboardDto objects 返回结果 page_num Integer 页码 page_size Integer 分页大小 total_page Integer 总页数 total_size Long 总条数 表5 DashboardDto 参数 参数类型 描述 create_time String 创建时间 create_user String 创建者 data_type String 数据类型:0=用例成功率;1=用例时长 id String 唯一ID,主键 name String 看板标题 service_id String 服务ID task_ids Array of strings 任务ID列表 task_type String 任务类型,仅支持持续拨测和冒烟测试 update_time String 修改时间 update_user String 修改者 view_type String 看板类型:0=折线图;1=散点图;2=饼图 状态码: 401 表6 响应Body参数 参数 参数类型 描述 error_code String 错误编码 最小长度:1 最大长度:50 error_msg String 错误原因 最小长度:1 最大长度:256 状态码: 403 表7 响应Body参数 参数 参数类型 描述 error_code String 错误编码 最小长度:1 最大长度:50 error_msg String 错误原因 最小长度:1 最大长度:256 状态码: 404 表8 响应Body参数 参数 参数类型 描述 error_code String 错误编码 最小长度:1 最大长度:50 error_msg String 错误原因 最小长度:1 最大长度:256
  • 响应参数 状态码: 200 表3 响应Body参数 参数 参数类型 描述 [数组元素] Array of EchoTestPackageCheckResult objects OK 表4 EchoTestPackageCheckResult 参数 参数类型 描述 expiration_time String 到期时间 has_license Boolean 是否拥有license original_amount Double 总量 package_user Boolean 是否跨租户 resource_id String 资源记录id resource_status String 套餐状态 resource_used Double 用量使用量 spec_code String 套餐名称 start_time String 开始时间 tenant_id String 租户id 状态码: 401 表5 响应Body参数 参数 参数类型 描述 error_code String 错误编码 最小长度:1 最大长度:50 error_msg String 错误原因 最小长度:1 最大长度:256 状态码: 403 表6 响应Body参数 参数 参数类型 描述 error_code String 错误编码 最小长度:1 最大长度:50 error_msg String 错误原因 最小长度:1 最大长度:256 状态码: 404 表7 响应Body参数 参数 参数类型 描述 error_code String 错误编码 最小长度:1 最大长度:50 error_msg String 错误原因 最小长度:1 最大长度:256
  • URI GET /v2/{project_id}/cas/environments 表1 路径参数 参数 是否必选 参数类型 描述 project_id 是 String 租户项目ID。获取方法,请参考获取项目ID。 表2 查询参数 参数 是否必选 参数类型 描述 limit 否 Integer 指定个数,取值[0, 100]或者1000,指定的值不在该范围内的话相当于赋值为10。默认1000,用于不分页的场景。分页的场景取值请用[0, 100]。 offset 否 Integer 指定偏移量,表示查询第n条数据后的结果。 order_by 否 String 排序字段,默认按创建时间排序。 排序字段支持枚举值:create_time、name、update_time。传的值不在支持的枚举值范围内的话按默认排序字段排序。 order 否 String 排序方式。 desc,降序排序,默认为desc。 asc,升序排序。
  • 响应示例 { "environments": [ { "id": "00078e9d-a61c-476e-ac63-a10c9cb2638e", "name": "development-env", "alias": null, "description": "", "project_id": "e7d2e9c589e5445e808a8ff0d1235aca", "enterprise_project_id": "0", "charge_mode": "provided", "deploy_mode": "container", "vpc_id": "29d55020-ae0e-4a18-871c-93e6976ee7bd", "base_resources": [ { "id": "523498f1-36c4-11eb-ae36-0255ac1000c2", "type": "cce", "name": "cce-test" } ], "optional_resources": [ { "id": "9963306a-791e-468c-9306-cf80a9d00298", "type": "elb", "name": "elb-2dd2" } ], "creator": "ss-test", "create_time": 1610418873730, "update_time": 1610418873730 } ], "count": 1 }
  • 响应消息 表4 响应参数 参数 参数类型 描述 count Integer 环境总数。 environments Array of objects 环境参数,请参考表5。 表5 environments 参数 参数类型 描述 id String 环境ID。 name String 环境名称。 alias String 环境别名。 description String 环境描述。 project_id String 项目ID。 enterprise_project_id String 企业项目ID。 charge_mode String 收费模式。 deploy_mode String 环境类型。 virtualmachine:虚拟机。 container:Kubernetes。 mixed :虚拟机和Kubernetes。 vpc_id String 虚拟私有云ID。 base_resources Array of objects 基础资源,请参考表6。 optional_resources Array of objects 可选资源,请参考表6。 creator String 创建人。 create_time Integer 创建时间。 update_time Integer 修改时间。 表6 resources 参数 参数类型 描述 id String 资源ID。 name String 资源名称。 type String 基础资源:cce、ecs、as。 可选资源:rds、dcs、elb、cse等其他类型。
  • 响应示例 { "components": [ { "id": "384eb8d4-c193-4d84-9558-6fda2366b536", "name": "mycomponent", "runtime": "Java8", "category": "MicroService", "sub_category": "Java Chassis", "description": "", "project_id": "384eb8d4-c193-4d84-9558-6fda23698536", "application_id": "a8f7eed5-0aa0-4251-9723-c9119a6bf56d", "source": { "kind": "artifact", "spec": { "storage": "obs", "type": "package", "url": "obs://myapp/demo.jar", "properties": { "bucket": "myapp", "key": "demo.jar", "endpoint": "https://obs.region_id.external_domain_name.com" } } }, "build": { "id": "w3dpv7p0t1vpxvey5hjb22iuwxway1vupwx0nae1", "parameters": { "artifact_namespace": "ns", "use_public_cluster": true } }, "status": 0, "creator": "xxx", "create_time": 1610333934288, "update_time": 1610333934288 } ], "count": 1 }
  • URI GET /v2/{project_id}/cas/applications/{application_id}/components 表1 路径参数 参数 是否必选 参数类型 描述 project_id 是 String 租户项目ID。获取方法,请参考获取项目ID。 application_id 是 String 应用ID。获取方法,请参考获取所有应用。 表2 查询参数 参数 是否必选 参数类型 描述 limit 否 String 指定个数,取值[0, 100]或者1000,指定的值不在该范围内的话相当于赋值为10。默认1000,用于不分页的场景。分页的场景取值请用[0, 100]。 offset 否 String 指定偏移量。 order_by 否 String 排序字段,默认按创建时间排序。 排序字段支持枚举值:create_time、name、update_time。 order 否 String 排序方式。 desc,降序排序,默认为desc。 asc,升序排序。
  • 响应消息 表3 响应参数 参数 参数类型 描述 flavors Array of objects 规格参数,请参考表4。 表4 flavors 参数 参数类型 描述 flavor_id String 规格ID storage_size String 存储大小 num_cpu String CPU限制 num_cpu_init String CPU初始 memory_size String 内存限制 memory_size_init String 内存初始 label String 展示标签 custom boolean 是否是自定义资源规格
  • 响应示例 { "flavors": [ { "flavor_id": "MICRO-5G:0.5C:1G", "storage_size": "5G", "num_cpu": "500m", "num_cpu_init": "200m", "memory_size": "1Gi", "memory_size_init": "200Mi", "label": "Micro: 5G Storage, 0.5 CPU, 1G Memory", "custom": false } ] }
  • 响应消息 表3 响应参数 参数 参数类型 描述 id String 环境ID。 name String 环境名称。 alias String 环境别名。 description String 环境描述。 project_id String 项目ID。 enterprise_project_id String 企业项目ID。 charge_mode String 收费模式。 deploy_mode String 环境类型。 virtualmachine:虚拟机。 container:Kubernetes。 mixed :虚拟机和Kubernetes。 vpc_id String 虚拟私有云ID。 base_resources Array of objects 基础资源,请参考表4。 optional_resources Array of objects 可选资源,请参考表4。 creator String 创建人。 create_time Integer 创建时间。 update_time Integer 修改时间。 表4 resources 参数 参数类型 描述 id String 资源ID。 name String 资源名称。 type String 基础资源:cce、ecs、as。 可选资源:rds、dcs、elb、cse等其他类型。
  • 响应示例 { "id": "ea011e01-2eb5-453f-87bf-874e4a855abe", "name": "dev-env", "alias": null, "description": "develop environment", "project_id": "bf8523d898b64e4eb956e3be3555ca16", "enterprise_project_id": "0", "charge_mode": "provided", "deploy_mode": "container", "vpc_id": "234241234124xxvasf2342xxxxxxxxxxx", "base_resources": [ { "id": "211112333sd332w23322332", "type": "cce" } ], "optional_resources": null, "creator": "string", "create_time": 1578984198394, "update_time": 1578984198394 }
  • URI GET /v2/{project_id}/cas/applications/{application_id}/components/{component_id} 表1 路径参数 参数 是否必选 参数类型 描述 project_id 是 String 租户项目ID。获取方法,请参考获取项目ID。 application_id 是 String 应用ID。获取方法,请参考获取所有应用。 component_id 是 String 组件ID。获取方法,请参考获取应用所有组件。
  • 响应示例 { "id": "1cfdda6f-84cd-4ead-8e09-628fabf662e2", "name": "test-micro", "runtime": "Java8", "category": "MicroService", "sub_category": "Java Chassis", "description": "", "project_id": "e7d2e9c589e5445e808a8ff0d1235aca", "application_id": "4d92833a-fa05-4fc0-a761-e67620022310", "source": { "kind": "artifact", "spec": { "storage": "obs", "type": "package", "url": "obs://test-soft/fusionweather-1.0.0.jar", "auth": "iam", "webUrl": "", "properties": { "bucket": "test-soft", "endpoint": "https://obs.region_id.development.com:443", "key": "fusionweather-1.0.0.jar" } } }, "build": { "id": "zpdkj42b3rnko8bmyojzt1ng828ubychw13j8flv", "parameters": { "artifact_namespace": "ns", "use_public_cluster": false, "cluster_id": "523498f1-36c4-11eb-ae36-0255ac1000c2", "cluster_name": "cce-test", "cluster_type": "VirtualMachine" } }, "status": 0, "creator": "ss-test", "create_time": 1610331760105, "update_time": 1610519881943 }
  • 响应示例 { "instances": [ { "id": "11eddb33-140b-4e51-b1e2-6ec265373ca3", "application_id": "4d92833a-fa05-4fc0-a761-e67620022310", "application_name": "test-app", "component_id": "1cfdda6f-84cd-4ead-8e09-628fabf662e2", "component_name": "test-com", "name": "test-micro-test-env-7iafjk", "environment_id": "61b81021-21d5-42f3-b80e-0b6bd10dbf7d", "environment_name": "test-env", "platform_type": "cce", "version": "1.0.0", "artifacts": { "test-micro": { "storage": "obs", "type": "package", "url": "obs://myapp/demo.jar", "properties": { "bucket": "myapp", "key": "demo.jar", "endpoint": "https://obs.region_id.external_domain_name.com" }, "auth": "iam", "version": "1.0.0", } }, "create_time": 1610331819996, "update_time": 1610331830398, "creator": "liuwei", "status_detail": { "status": "RUNNING", "replica": 1, "available_replica": 1, "fail_detail": null, "last_job_id": "JOB7bc0366c-dc43-41f9-b65f-8d6078038488", "last_job_status": "SUCCEEDED", "enterprise_project_id": "0" } } ], "count": 1 }
  • URI GET /v2/{project_id}/cas/applications/{application_id}/components/{component_id}/instances 表1 路径参数 参数 是否必选 参数类型 描述 project_id 是 String 租户项目ID。获取方法,请参考获取项目ID。 application_id 是 String 应用ID。获取方法,请参考获取所有应用。 component_id 是 String 组件ID。获取方法,请参考获取应用所有组件。 表2 查询参数 参数 是否必选 参数类型 描述 maxWaitTime 否 int 用户自定义整体启动时间。 limit 否 Integer 指定个数,取值[0, 100]或者1000,指定的值不在该范围内的话相当于赋值为10。默认1000,用于不分页的场景。分页的场景取值请用[0, 100]。 offset 否 Integer 指定偏移量。 order_by 否 String 排序字段,默认按创建时间排序。 排序字段支持枚举值:create_time、name、version、update_time。 order 否 String 排序方式。 desc,降序排序,默认为desc。 asc,升序排序。
  • 请求消息 表2 请求Header参数 参数 是否必选 参数类型 描述 Content-Type 是 String 消息体的类型(格式)。 X-Auth-Token 是 String 调用接口的认证方式分为Token和AK/SK两种,如果您使用的Token方式,此参数为必填,请填写Token的值。Token获取方式,请参考获取用户Token。 X-Repo-Auth 是 String 授权名称。通过获取仓库授权列表获取对应的授权名称。 表3 请求Body参数 参数 是否必选 参数类型 描述 name 是 String 项目名称。
  • 响应消息 表6 响应参数 参数 参数类型 描述 application_id String 应用ID。 environment_id String 环境ID。 configuration Object 应用配置信息,请参考表7。 表7 configuration 参数 参数类型 描述 env Array of objects 应用环境变量,请参考表8。 表8 env 参数 参数类型 描述 name String 环境变量名称 value String 环境变量取值
共100000条