华为云用户手册

  • 响应示例 状态码: 200 OK { "result" : { "security" : { "status" : "success" }, "file" : { "status" : "success" }, "basicInformation" : { "status" : "success", "extension_version_compare" : "NULL_VERSION", "extension_brief_info" : { "publisherSnake" : { "publisher_id" : "c45c552c14b94e0889e0346090688ad9", "publisher_name" : "lemontree", "display_name" : "lemontree" }, "identifier" : "lemontree.big-file-test", "logUrl" : "https://cnnorth6-dev-cloudide.obs.cn-north-6.myhuaweicloud.com:443/upload/d6cbb007-4071-4bce-921f-538e78ce4859/icon.png?AccessKeyId=7JLQBTJ2B3TEYUIF00FF&Expires=1676272349&Signature=lT9YyiqQddPYYmaVoJ9hgvdGed8%3D", "displayName" : "bigfile upload test", "platform" : "codearts ide online", "version" : "0.0.1", "description" : "Debug for AOC SSP" } } }, "status" : "success"}
  • 请求参数 表1 请求Header参数 参数 是否必选 参数类型 描述 x-auth-token 是 String iam x-auth-token Content-Type 否 String content enum - application/json 枚举值: application/json 表2 请求Body参数 参数 是否必选 参数类型 描述 case 否 String case chat_id 是 String chat id message 是 String message infer_end 否 Boolean infer end meta_prompt 否 Array of strings prompt need_preprocess 否 Boolean need or not user_id 否 String user id task_parameters 否 Object task parameters
  • 响应参数 状态码: 200 表3 响应Body参数 参数 参数类型 描述 result Object 返回值 status String 状态 状态码: 401 表4 响应Body参数 参数 参数类型 描述 error_msg String 错误描述 error_code String 错误码 状态码: 403 表5 响应Body参数 参数 参数类型 描述 error_msg String 错误描述 error_code String 错误码 状态码: 404 表6 响应Body参数 参数 参数类型 描述 error_msg String 错误描述 error_code String 错误码
  • 请求参数 表2 请求Header参数 参数 是否必选 参数类型 描述 X-Auth-Token 否 String 用户Token。 通过调用 IAM 服务获取用户Token接口获取(响应消息头中X-Subject-Token的值)。 x-publisher-token和X-Auth-Token必传一个 x-publisher-token 否 String 发布商凭证,x-publisher-token和X-Auth-Token必传一个
  • 文档修订记录 文档修订记录累积了每次文档更新的说明。最新版本的文档包含以前所有文档版本的更新内容。 修订记录 发布日期 第十九次正式发布,本次变更说明如下: 新增接口:查询插件分类 新增接口:插件发布 新增接口:获取插件检测结果 新增接口:获取当前用户下的发布商列表 新增接口:文件上传归一化 新增接口:CreateLogin接口 新增接口:CreateJoinRequest接口 新增接口:CreateEvent接口 2023-04-11 第十八次正式发布,本次变更说明如下: CloudIDE服务更名为CodeArts IDE Online 2023-02-16 第十七次正式发布,本次变更说明如下: 新增接口:CreateAcceptance接口 新增接口:Create Request接口 新增接口:Show Result接口 2022-12-05 第十六次正式发布,本次变更说明如下: 新增接口:添加插件评论 新增接口:添加评论回复、回复评论回复 新增接口:添加新评星 新增接口:举报评论,举报回复 新增接口:删除评论 新增接口:删除回复 新增接口:查询插件列表 新增接口:查询插件详细信息 新增接口:查询插件评价 新增接口:查询插件评星 2022-11-23 第十五次正式发布,本次变更说明如下: 接口查询某个IDE实例更新:响应示例中删掉instance.is_private。 接口启动IDE实例更新:新增请求示例。 接口查询某个租户下的IDE实例列表更新:响应示例参数删除 instances.count、instances.items.is_private。 接口查询IDE实例列表更新:响应示例参数删除 instances.count、instances.items.is_private。 接口查询技术栈模板工程更新:响应参数中新增arch参数。 2022-08-24 第十四次正式发布,本次变更说明如下: 新增接口:查询某个IDE实例的状态。 接口创建IDE实例更新:删除参数instance_user_domain_name、instance_user_name。 接口外部第三方集成商创建IDE实例更新:删除参数instance_user_domain_name、instance_user_name。 2022-07-22 第十三次正式发布,本次变更说明如下: 新增接口:上传插件。 2022-07-01 第十二次正式发布,本次变更说明如下: 接口创建IDE实例更新:新增请求Body参数instance_domain_id和instance_user_id。 参数描述中“组织”修改改成“租户”。 2022-03-01 第十一次正式发布,本次变更说明如下: 刷新refresh_interval参数。 2022-01-26 第十次正式发布,本次变更说明如下: 新增接口:按region获取标签所有技术栈。 废弃接口:获取标签所有技术栈。 2022-01-11 第九次正式发布,本次变更说明如下: 修改接口查询某个IDE实例的响应参数。 修改接口查询某个租户下的IDE实例列表的响应参数。 修改接口查询IDE实例列表的响应参数。 更新部分接口的参数描述。 2021-12-20 第八次正式发布,本次变更说明如下: 新增接口:查询用户是否有权限访问某个IDE实例 新增接口:刷新IDE实例活跃状态 新增接口:查询ide实例对插件的授权情况 新增接口:设置ide实例对插件的授权 2021-12-13 第七次正式发布,本次变更说明如下: 新增权限策略和授权项相关内容。 2021-08-24 第六次正式发布,本次变更说明如下: 接口创建IDE实例更新:新增请求Body参数。 更新部分接口参数描述。 2021-01-27 第五次正式发布,本次变更说明如下: 错误码更新:错误响应Body体格式示例更新。 接口启动IDE实例更新:新增请求body参数。 接口创建IDE实例更新:请求Body参数新增port_id、private_ip、vpc_id三个参数。 新增接口:查询当前账号访问权限。 2020-12-29 第四次正式发布,本次变更说明如下: 接口创建IDE实例返回值更新。 接口外部第三方集成商创建IDE实例返回值更新。 2020-11-09 第三次正式发布,本次变更说明如下: 更新终端节点,新增北京一和大连。 2020-09-17 第二次正式发布,本次变更说明如下: 新增应用示例。 2020-07-31 第一次正式发布。 2020-07-07
  • Token认证 Token的有效期为24小时,需要使用一个Token鉴权时,可以先缓存起来,避免频繁调用。 Token在计算机系统中代表令牌(临时)的意思,拥有Token就代表拥有某种权限。Token认证就是在调用API的时候将Token加到请求消息头,从而通过身份认证,获得操作API的权限。 在构造请求中以调用获取用户Token接口为例说明了如何调用API。 Token可通过调用获取用户Token接口获取,调用本服务API需要project级别的Token,即调用获取用户Token接口时,请求body中auth.scope的取值需要选择project,如下所示。 { "auth": { "identity": { "methods": [ "password" ], "password": { "user": { "name": "username", "password": "********", "domain": { "name": "domainname" } } } }, "scope": { "project": { "name": "xxxxxxxx" } } } } 获取Token 后,再调用其他接口时,您需要在请求消息头中添加“X-Auth-Token”,其值即为Token。例如Token值为“ABCDEFJ....”,则调用接口时将“X-Auth-Token: ABCDEFJ....”加到请求消息头即可,如下所示。 GET https://iam.cn-north-1.myhuaweicloud.com/v3/auth/projects Content-Type: application/json X-Auth-Token: ABCDEFJ....
  • AK/SK认证 AK/SK签名认证方式仅支持消息体大小12M以内,12M以上的请求请使用Token认证。 AK/SK认证就是使用AK/SK对请求进行签名,在请求时将签名信息添加到消息头,从而通过身份认证。 AK(Access Key ID):访问密钥ID。与私有访问密钥关联的唯一标识符;访问密钥ID和私有访问密钥一起使用,对请求进行加密签名。 SK(Secret Access Key):与访问密钥ID结合使用的密钥,对请求进行加密签名,可标识发送方,并防止请求被修改。 使用AK/SK认证时,您可以基于签名算法使用AK/SK对请求进行签名,也可以使用专门的签名SDK对请求进行签名。详细的签名方法和SDK使用方法请参见API签名指南。 签名SDK只提供签名功能,与服务提供的SDK不同,使用时请注意。
  • 响应参数 状态码: 200 表3 响应Body参数 参数 参数类型 描述 result Object 返回值 status String 状态 状态码: 401 表4 响应Body参数 参数 参数类型 描述 error_msg String 错误描述 error_code String 错误码 状态码: 403 表5 响应Body参数 参数 参数类型 描述 error_msg String 错误描述 error_code String 错误码 状态码: 404 表6 响应Body参数 参数 参数类型 描述 error_msg String 错误描述 error_code String 错误码
  • 响应示例 状态码: 200 successful operation { "result" : { "size" : 30, "total_items_count" : 3, "items_before" : 0, "items" : [ { "id" : 74, "extension_id" : "17c341ee-797e-4824-aec5-6fafb3c0eced", "comment" : "1111111", "stars" : 5, "create_time" : "2022-02-17 09:35:31", "last_updated" : "2022-04-11 16:52:12", "status" : "VALIDATED", "commentator" : { "domainId" : "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", "domainName" : "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", "deletedTime" : 0 } }, { "id" : 75, "extension_id" : "17c341ee-797e-4824-aec5-6fafb3c0eced", "comment" : "4分", "stars" : 4, "create_time" : "2022-02-17 09:41:24", "last_updated" : "2022-02-17 09:41:24", "status" : "VALIDATED", "commentator" : { "domainId" : "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", "domainName" : "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", "deletedTime" : 0 } } ], "empty" : false }, "status" : "success"}
  • 响应示例 状态码: 200 successful operation { "results" : [ { "extensions" : [ { "extension_id" : "d45648941sadsadsa_hdsa", "extension_name" : "plugin_for_CodeArtsIDEOnline", "display_name" : "backgroudcolor_setting", "flags" : 8, "last_updated" : "2022-08-31 00:00:00", "published_date" : "2022-08-29 00:00:00", "release_date" : "2022-09-06 00:00:00", "short_description" : "插件的简要描述", "tags" : [ "color", "extention" ], "tag_all_list" : [ "color", "extension", "enhancer" ], "publisher" : { "publisher_id" : 123456, "publisher_name" : "code-huawei", "display_name" : "color-modify", "publisher_status" : "VERIFIED", "email" : "xxx@huawei.com", "web_url" : "www.xxx.huawei.com", "open" : true }, "arch" : [ "x86", "arm" ], "target" : "CodeArts IDE Online", "categories" : [ "backgroud", "color" ], "category_all_list" : [ "backgroud", "color", "script" ], "publish_manager" : { "publisher_id" : 123456, "publisher_name" : "code-huawei", "display_name" : "color-modify", "publisher_status" : "VERIFIED", "email" : "xxx@huawei.com", "web_url" : "www.xxx.huawei.com", "open" : true }, "status" : "NORMAL", "validate_status" : "NONE", "install_count" : 5000, "average_star" : 4.6, "identifier" : "marketplace_plugin", "support_os" : [ "win", "mac os", "linux" ], "support_ide" : 3, "support_ide_info" : "CodeArts IDE Online", "versions" : [ { "id" : "d45648132313", "version" : "version_one", "version_ranking" : 10000, "status" : "PUBLISHED", "version_status" : "PUBLISHED", "asset_uri" : "www.example.com", "last_updated" : "2022-08-31 00:00:00" } ], "extension_statistics" : { "install" : 10000, "stars" : 5 }, "preview" : false, "ext_info" : { "extension_id" : "d45648941sadsadsa_hdsa", "repo_url" : "www.xxxcodehub.com", "help_page" : "www.help.page.com", "website" : "www.index.com", "issue_link" : "www.problem.com", "show_previews" : false }, "platform" : "/opt/**", "check_result" : { "status" : "success" }, "extension_owner" : "huaweistaff" } ], "result_metadata" : [ { "metadata_type" : ".ts", "metadata_items" : [ { "key" : "value" }, { "uuid" : "uuid" } ] } ] } ]}
  • 请求参数 表1 请求Header参数 参数 是否必选 参数类型 描述 X-Auth-Token 否 String 用户Token。 通过调用IAM服务获取用户Token接口获取(响应消息头中X-Subject-Token的值)。 表2 请求Body参数 参数 是否必选 参数类型 描述 filters 是 Array of FilterSnake objects 过滤字段 flags 是 Integer 插件flag;通过传递flag参数来进行过滤或其他操作。flag的基础数字是2\4\8\16;传递的参数只能是这四个数字加法组合而成数字 利用它们之间二进制的运算获取的值进行其他操作.比如6=0110=0010+0100也就是2和4的集合flags 表3 FilterSnake 参数 是否必选 参数类型 描述 criteria 否 Array of CriteriaSnake objects 过滤集合 page_number 是 Long 页码 page_size 是 Long 分页大小 sort_by 否 Long 排序字段. 1 修改日期 2 插件名称 3 插件作者名称 枚举值: 1 2 3 sort_order 否 Long 排序顺序. 1 升序 2 降序 枚举值: 1 2 表4 CriteriaSnake 参数 是否必选 参数类型 描述 filter_type 否 Integer 过滤类型 1 按插件Tag过滤 2 按diplayName过滤 3 按publisherId过滤 4 按插件Id过滤 5 按插件分类过滤 7 按照作者名.插件名过滤 8 按Target(客户端)过滤 10 按关键字(客户端输入的)过滤 12 根据flags传入的值来进行过滤,eg:flags=2name就排除flags=2的插件. 13 根据flags传入的值来进行过滤,eg:flags=2name就查询出flags=2的插件 18 按publisherName过滤 19 按publisherDisplayName过滤 102 按照插件状态排除插件 103 按照插件状态过滤出插件 107 supportIdeInfo 108 根据插件ids查询 枚举值: 1 2 3 4 5 7 8 10 12 13 18 19 102 103 107 108 value 否 String 过滤类型对应字段名称
  • 实例相关权限 表1 实例相关权限 权限 对应API接口 授权项(Action) 依赖的授权项 IAM项目 (Project) 企业项目(Enterprise Project) 创建IDE实例 POST /v2/{org_id}/instances cloudIDE:instance:create - √ × 删除IDE实例 DELETE /v2/instances/{instance_id} cloudIDE:instance:delete - √ × 启动IDE实例 PUT /v2/instances/{instance_id}/runtime cloudIDE:instance:start - √ × 停止IDE实例 DELETE /v2/instances/{instance_id}/runtime cloudIDE:instance:stop - √ × 访问IDE实例 仅支持CodeArts IDE Online内部调用,API方式不支持 cloudIDE:instance:access - √ × 修改IDE实例(仅修改描述和名称) PUT /v2/instances/{instance_id} cloudIDE:instance:update - √ × 分发实例给访问者 POST /v2/instances/{instance_id}/visitor cloudIDE:instance:assign - √ × 授权实例给用户 POST /v2/instance/{instance_id}/user cloudIDE:instance:auth - √ × 重置实例 POST /v2/instance/{instance_id}/reset cloudIDE:instance:reset - √ × 父主题: 权限策略和授权项
  • 响应参数 状态码: 200 表4 响应Body参数 参数 参数类型 描述 result String 返回值 status String 状态 状态码: 403 表5 响应Body参数 参数 参数类型 描述 error_msg String 错误描述 error_code String 错误码 状态码: 404 表6 响应Body参数 参数 参数类型 描述 error_msg String 错误描述 error_code String 错误码 状态码: 406 表7 响应Body参数 参数 参数类型 描述 error_msg String 错误描述 error_code String 错误码 状态码: 500 表8 响应Body参数 参数 参数类型 描述 error_msg String 错误描述 error_code String 错误码
  • 响应示例 状态码: 200 Successful Response { "tasks" : [ { "request_id" : "d980c2b5242eb97aa07a1f6645a6793a", "task_id" : 0, "language" : "python", "snippet" : "def add(x, y):\n return x + y", "generated_snippet" : "", "docker_id" : "02:55:ac:10:00:36", "start_time" : "2022-11-21T19:48:30", "record_time" : "2022-11-21T19:48:30", "time_consuming" : 0.022447, "status" : "success", "exception" : null, "model_id" : "300M" } ], "request_status" : "completed", "request_type" : "function"}
  • 响应参数 状态码: 200 表2 响应Body参数 参数 参数类型 描述 request_status String the status of the request 枚举值: created dispatched completed timeout unknown tasks Array of TaskModel objects task list request_type String the type of the request 表3 TaskModel 参数 参数类型 描述 docker_id String the docker_id exception String exception generated_snippet String the generated_snippet language String code language model_id String model_id record_time String record_time request_id String the unique id of request snippet String the snippet of code start_time String start_time status String status task_id Integer task_id time_consuming Number the time_consuming
  • 响应示例 状态码: 200 OK { "result" : [ { "id" : "cc809483-21b8-473b-bd65-ff87efb261fa", "name" : "Spring Boot Extension Pack", "identifier" : "huawei", "description" : "Spring Boot Extension Pack", "email" : "xuhui80@huawei.com", "status" : true, "publisher_review" : false, "system_review" : false, "official" : false, "is_open" : false, "created_time" : "2022-04-01 09:54:26", "updated_time" : "2023-02-15 15:29:12", "role" : "Owner" }, { "id" : "6251b1ee539f4c02ad4b83daeda81633", "name" : "fast-run-app", "identifier" : "devcloud_cloudide_name_g0", "description" : "fast-run-appc", "email" : "test@qq.com", "web_url" : "", "status" : true, "publisher_review" : false, "system_review" : false, "official" : false, "is_open" : false, "created_time" : "2022-04-01 09:54:26", "updated_time" : "2022-09-08 11:01:10", "role" : "Owner" } ], "status" : "success"}
  • 响应参数 状态码: 200 表3 响应Body参数 参数 参数类型 描述 result Array of PublisherVO objects 返回值 status String 状态 表4 PublisherVO 参数 参数类型 描述 code_repo String 代码地址 created_time String 创建时间 description String 发布商描述 eamap_info String EAMAP注册信息 email String 邮箱 espase_group String espase交流群号 extension_count Long 插件数量 id String 发布商ID identifier String 唯一标志 is_open Boolean 开源发布商,0:非开源; 1:开源; is_org Boolean 发布商或组织,0:发布商; 1:组织; logo_url String 发布商logo member_count Long 成员数量 name String 发布商名称 official Boolean 是否是官方发布商 owners Array of MemberRoleVo objects 成员角色 publisher_review Boolean 是否开启发布商审核,1:开启;0:关闭 role String 角色 status Boolean 状态,0:禁用; 1:正常; suite_count Long 匹配数量 support_url String 支持地址 system_review Boolean 是否忽略系统审核,1:忽略;0:不忽略 updated_time String 更新时间 web_url String 官网地址 表5 MemberRoleVo 参数 参数类型 描述 domain_id String 租户ID extension_count Integer 插件数量 role String 角色名称 role_id Long 角色ID role_value String 发布商或插件ID user_id String 用户ID user_name String 用户名 状态码: 401 表6 响应Body参数 参数 参数类型 描述 error_msg String 错误描述 error_code String 错误码 状态码: 403 表7 响应Body参数 参数 参数类型 描述 error_msg String 错误描述 error_code String 错误码 状态码: 404 表8 响应Body参数 参数 参数类型 描述 error_msg String 错误描述 error_code String 错误码
  • 响应参数 状态码: 200 表3 响应Body参数 参数 参数类型 描述 result Object 返回值 status String 状态 状态码: 403 表4 响应Body参数 参数 参数类型 描述 error_msg String 错误描述 error_code String 错误码 状态码: 404 表5 响应Body参数 参数 参数类型 描述 error_msg String 错误描述 error_code String 错误码 状态码: 406 表6 响应Body参数 参数 参数类型 描述 error_msg String 错误描述 error_code String 错误码 状态码: 500 表7 响应Body参数 参数 参数类型 描述 error_msg String 错误描述 error_code String 错误码
  • 响应示例 状态码: 200 OK { "result" : { "identifier" : "redhat.java", "instance_id" : "***", "extension_version" : "1.0.1", "status" : "AGREE" }, "status" : "success"} 状态码: 403 Forbidden { "error_msg" : "Instance does not belong to the user or tenant", "error_code" : "IDE.00010129"}
  • 请求参数 表1 请求Header参数 参数 是否必选 参数类型 描述 x-auth-token 是 String iam x-auth-token 表2 请求Body参数 参数 是否必选 参数类型 描述 region 否 String the region of user name 否 String the name of user email 否 String the email of user organization 否 String the organization of user phone_number 否 String the phone_number of user invitation_code 否 String the invitation_code
  • 请求示例 创建一个地域在北京,用户名为“name”,邮箱为“email@codeartssnap.com”,组织为“huawei”的用户。 POST https://{endpoint}/v2/aims/codemodelserver/join-request{ "region" : "北京", "name" : "name", "email" : "email@codeartssnap.com", "organization" : "huawei", "phone_number" : "13666666666", "invitation_code" : "gouliguojiashengsiyi"}
  • 响应参数 状态码: 200 表3 响应Body参数 参数 参数类型 描述 result Object 返回值 status String 状态 状态码: 401 表4 响应Body参数 参数 参数类型 描述 error_msg String 错误描述 error_code String 错误码 状态码: 403 表5 响应Body参数 参数 参数类型 描述 error_msg String 错误描述 error_code String 错误码
  • 响应参数 状态码: 200 表3 响应Body参数 参数 参数类型 描述 result Boolean 返回值 status String 状态 状态码: 403 表4 响应Body参数 参数 参数类型 描述 error_msg String 错误描述 error_code String 错误码 状态码: 404 表5 响应Body参数 参数 参数类型 描述 error_msg String 错误描述 error_code String 错误码 状态码: 406 表6 响应Body参数 参数 参数类型 描述 error_msg String 错误描述 error_code String 错误码 状态码: 500 表7 响应Body参数 参数 参数类型 描述 error_msg String 错误描述 error_code String 错误码
  • 请求参数 表2 请求Header参数 参数 是否必选 参数类型 描述 x-auth-token 是 String iam x-auth-token 表3 请求Body参数 参数 是否必选 参数类型 描述 context 否 String context docstring 否 String docstring ide_type 否 String the type of ide ide_version 否 String the version of ide language 是 String code language plugin_version 否 String the version of plugin signature 否 String signature above_text 否 String the text above the cursor following_text 否 String the text following the cursor
  • URI POST /v2/aims/codemodelserver/code-generation/request 表1 Query参数 参数 是否必选 参数类型 描述 topn 否 Integer the number of samples scenario 否 String the scenario of code content resubmit 否 Boolean if resubmit is true, the de-duplication will be ignored model_id 否 String choose the model request_type 否 String An enumeration. function rawtext 枚举值: function rawtext
  • 响应参数 状态码: 200 表4 响应Body参数 参数 参数类型 描述 request_id String the unique id of the request status String the status of the request 枚举值: created dispatched completed timeout unknown dispatched_task_number Integer the number of tasks dispatched successfully
  • 请求示例 创建一个签名为“def add(x, y):”、语言为“python”、文档字符串为“sum two numbers”的代码生成请求。 POST https://{endpoint}/v2/aims/codemodelserver/code-generation/request{ "signature" : "def add(x, y):", "language" : "python", "docstring" : "sum two numbers", "context" : " return x + y", "ide_type" : "pycharm professional", "ide_version" : "2022.1.3", "plugin_version" : "v0.1.0"}
  • 响应参数 状态码: 200 表3 响应Body参数 参数 参数类型 描述 result Object 返回值 status String 状态 状态码: 401 表4 响应Body参数 参数 参数类型 描述 error_msg String 错误描述 error_code String 错误码 状态码: 403 表5 响应Body参数 参数 参数类型 描述 error_msg String 错误描述 error_code String 错误码
  • 功能介绍 create a code generation request.if agent receives a code generation request, it will:- record the request into mysql,- decompose the request into topn tasks.- send the tasks to kafka.if agent receives a duplicated code generation request, it will not decompose request and send to kafka.
  • 请求示例 创建IDE实例 POST https://{endpoint}/v2/6251b1ee539f4c02ad4b83daeda81633/instances{ "display_name" : "testjava", "stack_id" : "java", "description" : "", "cpu_memory" : "2U4G", "pvc_quantity" : "5GB", "refresh_interval" : "30"}
共100000条
提示

您即将访问非华为云网站,请注意账号财产安全