华为云用户手册

  • 响应参数 状态码:200 表3 响应Body参数 参数 参数类型 描述 id String 应用ID。 secret String 应用认证访问SECRET,未提供(字段不存在或值为null)时随机生成。 字符集:英文字母、数字、!、@、#、$、%、+、=、点、中划线、斜线/。 复杂度:满足大小写字母、数字、特殊字符的复杂度组合,考虑兼容性暂时不做复杂度校验。 状态码:403 表4 响应Body参数 参数 参数类型 描述 error_code String 错误码。 error_msg String 错误消息。 error_details String 具体错误消息。 request_id String 请求处理ID。
  • 响应示例 状态码:200 OK { "id" : "b2e6b145-4f3f-4a80-aa45-f4b8029f95a3", "secret" : "JNs****jd" } 状态码:403 Forbidden { "error_code" : "ROMA.00000101", "error_msg" : "error summary", "error_details" : "some error details here", "request_id" : "13760c1fe8655e61209b75665e9bef43" }
  • 请求示例 创建一个API,认证方式为自定义认证,匹配方式为绝对匹配,后端类型为Web后端,并自定义前端请求参数和后端请求参数 { "group_id" : "c77f5e81d9cb4424bf704ef2b0ac7600", "match_mode" : "NORMAL", "name" : "Api_http", "auth_type" : "AUTHORIZER", "authorizer_id" : "0d982c1ac3da493dae47627b6439fc5c", "backend_type" : "HTTP", "backend_api" : { "url_domain" : "10.10.10.156:12346", "req_protocol" : "HTTP", "req_method" : "GET", "req_uri" : "/test/benchmark", "timeout" : 5000 }, "req_protocol" : "HTTPS", "req_uri" : "/test/http", "remark" : "Web backend API", "type" : 1, "req_method" : "GET", "result_normal_sample" : "Normal response example", "result_failure_sample" : "Failure response example", "tags" : [ "webApi" ], "req_params" : [ { "name" : "query_demo", "location" : "QUERY", "type" : "STRING", "required" : 1 }, { "name" : "header-demo", "location" : "HEADER", "type" : "STRING", "required" : 2 } ], "backend_params" : [ { "name" : "backHeader", "value" : "header-demo", "location" : "HEADER", "origin" : "REQUEST" }, { "name" : "backQuery", "value" : "query_demo", "location" : "QUERY", "origin" : "REQUEST" }, { "name" : "X-CONSTANT-HEADER", "value" : "demo", "location" : "HEADER", "origin" : "CONSTANT", "remark" : "constant_demo" }, { "name" : "app-id", "value" : "$context.appId", "location" : "HEADER", "origin" : "SYSTEM", "remark" : "Application ID of the invoker." } ] } 创建一个API,认证方式为APP认证,匹配方式为绝对匹配,后端类型为 函数工作流 { "group_id" : "c77f5e81d9cb4424bf704ef2b0ac7600", "match_mode" : "NORMAL", "name" : "Api_function", "auth_type" : "APP", "backend_type" : "FUNCTION", "func_info" : { "authorizer_id" : "5b8cd3f06f004115aec69c58f57272c9", "function_urn" : "'urn:fss:region01:73d69ae0cfcf460190522d06b60f05ad:function:default:auto_testfunc93749'", "network_type" : "V1", "invocation_type" : "sync", "timeout" : 5000, "version" : "latest", "alias_urn" : "urn:fss:region01:73d69ae0cfcf460190522d06b60f05ad:function:default:auto_testfunc93749:!a1" }, "req_protocol" : "HTTPS", "req_uri" : "/test/function", "remark" : "FunctionGraph backend API", "type" : 1, "req_method" : "GET", "result_normal_sample" : "Normal response example", "result_failure_sample" : "Failure response example", "tags" : [ "functionApi" ] } 创建一个API,认证方式为APP认证,匹配方式为前缀匹配,后端类型为MOCK后端 { "group_id" : "c77f5e81d9cb4424bf704ef2b0ac7600", "match_mode" : "SWA", "name" : "Api_mock", "auth_type" : "APP", "backend_type" : "MOCK", "mock_info" : { "result_content" : "mock success" }, "req_protocol" : "HTTPS", "req_uri" : "/test/mock", "remark" : "Mock backend API", "type" : 1, "req_method" : "GET", "result_normal_sample" : "Normal response example", "result_failure_sample" : "Failure response example", "tags" : [ "mockApi" ] }
  • 响应示例 状态码: 201 Created 示例 1 { "name" : "Api_http", "type" : 1, "version" : "V2", "req_protocol" : "HTTP", "req_method" : "GET", "req_uri" : "/test/http", "auth_type" : "APP", "auth_opt" : { "app_code_auth_type" : "DISABLE" }, "cors" : false, "match_mode" : "NORMAL", "backend_type" : "HTTP", "remark" : "Web backend API", "group_id" : "c77f5e81d9cb4424bf704ef2b0ac7600", "body_remark" : "", "result_normal_sample" : "Normal response example", "result_failure_sample" : "Failure response example", "authorizer_id" : "", "tags" : [ "webApi" ], "roma_app_id" : "957dcd1e-d8f4-432e-8e71-df55cf772aba", "domain_name" : "", "tag" : "", "id" : "5f918d104dc84480a75166ba99efff21", "status" : 1, "arrange_necessary" : 2, "register_time" : "2022-02-09T02:46:36.913996908Z", "update_time" : "2022-02-09T02:46:36.913997175Z", "group_name" : "api_group_001", "group_version" : "V2", "run_env_name" : "", "run_env_id" : "", "publish_id" : "", "roma_app_name" : "app-htyr", "ld_api_id" : "", "backend_api" : { "authorizer_id" : "", "url_domain" : "10.10.10.156:12346", "req_protocol" : "HTTP", "remark" : "", "req_method" : "GET", "version" : "", "req_uri" : "/test/bechmark", "timeout" : 5000, "enable_client_ssl" : false, "retry_count" : "-1", "id" : "86686e62cabe44b392ad4a0856165e92", "status" : 1, "register_time" : "2022-02-09T02:46:36.914978278Z", "update_time" : "2022-02-09T02:46:36.914978525Z", "vpc_channel_info" : { "cascade_flag" : false, "vpc_channel_id" : "", "vpc_channel_port" : 0 }, "vpc_channel_status" : 2 }, "api_group_info" : { "id" : "02b157a33b394babb0b08c010bc3d76b", "name" : "api_group", "status" : 1, "sl_domain" : "02b157a33b394babb0b08c010bc3d76b.apic.****.com", "register_time" : "2022-02-09T02:46:31Z", "update_time" : "2022-02-09T02:46:31Z", "on_sell_status" : 2, "url_domains" : [ { "id" : "e91b83b07744e8eb1872d695ed4743b", "domain" : "domain.com", "cname_status" : 3, "ssl_id" : "ddsa83b07744e8eb1872d695ed4743b", "ssl_name" : "certificate", "min_ssl_version" : "TLSv1.1" } ], "sl_domain_access_enabled" : true }, "func_info" : null, "mock_info" : null, "req_params" : [ { "name" : "query_demo", "location" : "QUERY", "type" : "STRING", "valid_enable" : 2, "required" : 1, "id" : "57c8bf3c97ef40ee94eace95dff30014", "pass_through" : 1 }, { "name" : "header-demo", "location" : "HEADER", "type" : "STRING", "valid_enable" : 2, "required" : 2, "id" : "8d993be96980415faa6b1fb2ebd647e0", "pass_through" : 1 } ], "backend_params" : [ { "name" : "backHeader", "value" : "header-demo", "location" : "HEADER", "origin" : "REQUEST", "id" : "709f0ea376b44aaf907aaaa37d8cce92", "req_param_id" : "8d993be96980415faa6b1fb2ebd647e0" }, { "name" : "backQuery", "value" : "query_demo", "location" : "QUERY", "origin" : "REQUEST", "id" : "2f152d0fb54445039158d29c2a4f69ee", "req_param_id" : "57c8bf3c97ef40ee94eace95dff30014" }, { "name" : "X-CONSTANT-HEADER", "value" : "demo", "location" : "HEADER", "origin" : "CONSTANT", "remark" : "constant_demo", "id" : "20142102c6aa4f3c97d5fd6ef4010ac2" }, { "name" : "app-id", "value" : "$context.appId", "location" : "HEADER", "origin" : "SYSTEM", "remark" : "Application ID of the invoker.", "id" : "a1349c61016e4d999ca783a50bfeee2b" } ], "policy_functions" : null, "policy_mocks" : null, "policy_https" : [ ] } 示例 2 { "name" : "Api_function", "type" : 1, "version" : "V0.0.1", "req_protocol" : "HTTPS", "req_method" : "GET", "req_uri" : "/test/function", "auth_type" : "APP", "auth_opt" : { "auth_code_auth_type" : "DISABLE" }, "cors" : false, "match_mode" : "NORMAL", "backend_type" : "FUNCTION", "remark" : "FunctionGraph backend API", "group_id" : "c77f5e81d9cb4424bf704ef2b0ac7600", "body_remark" : "", "result_normal_sample" : "Normal response example", "result_failure_sample" : "Failure response example", "authorizer_id" : "", "tags" : [ "functionApi" ], "tag" : "", "roma_app_id" : "f77f5e81d9cb4424bf704ef2b0ac7690", "domain_name" : "www.sss.com", "id" : "abd9c4b2ff974888b0ba79be7e6b2763", "status" : 1, "arrange_necessary" : 2, "register_time" : "2020-08-02T15:56:52.286099413Z", "update_time" : "2020-08-02T15:56:52.286099715Z", "group_name" : "api_group_001", "group_version" : "V1", "run_env_name" : "", "run_env_id" : "", "publish_id" : "", "publish_time" : "", "roma_app_name" : "app-dfge", "ld_api_id" : "", "backend_api" : null, "api_group_info" : { "id" : "c77f5e81d9cb4424bf704ef2b0ac7600", "name" : "api_group", "status" : 1, "sl_domain" : "c77f5e81d9cb4424bf704ef2b0ac7600.apic.****.com", "register_time" : "2020-08-02T15:56:52Z", "update_time" : "2020-08-02T15:56:52Z", "on_sell_status" : 2, "url_domains" : [ { "id" : "e91b83b07744e8eb1872d695ed4743b", "domain" : "domain.com", "cname_status" : 3, "ssl_id" : "ddsa83b07744e8eb1872d695ed4743b", "ssl_name" : "certificate", "min_ssl_version" : "TLSv1.1" } ], "sl_domain_access_enabled" : true }, "mock_info" : null, "func_info" : { "id" : "c0740524cd4c40e3801a7afe5375f8b0", "authorizer_id" : "5b8cd3f06f004115aec69c58f57272c9", "function_urn" : "'urn:fss:region01:73d69ae0cfcf460190522d06b60f05ad:function:default:auto_testfunc93749'", "network_type" : "V1", "remark" : "", "invocation_type" : "sync", "timeout" : 5000, "version" : "latest", "alias_urn" : "urn:fss:region01:73d69ae0cfcf460190522d06b60f05ad:function:default:auto_testfunc93749:!a1", "register_time" : "2020-08-02T15:36:19.897262803Z", "update_time" : "2020-08-02T15:36:19.897262993Z", "status" : 1 }, "req_params" : [ ], "backend_params" : [ ], "policy_functions" : null, "policy_mocks" : [ ], "policy_https" : null } 示例 3 { "name" : "Api_mock", "type" : 1, "version" : "V0.0.1", "req_protocol" : "HTTPS", "req_method" : "GET", "req_uri" : "/test/mock", "auth_type" : "APP", "auth_opt" : { "auth_code_auth_type" : "DISABLE" }, "cors" : false, "match_mode" : "SWA", "backend_type" : "MOCK", "remark" : "Mock backend API", "group_id" : "c77f5e81d9cb4424bf704ef2b0ac7600", "body_remark" : "", "result_normal_sample" : "Normal response example", "result_failure_sample" : "Failure response example", "authorizer_id" : "", "tags" : [ "mockApi" ], "tag" : "", "roma_app_id" : "f77f5e81d9cb4424bf704ef2b0ac7690", "domain_name" : "www.sss.com", "id" : "3a955b791bd24b1c9cd94c745f8d1aad", "status" : 1, "arrange_necessary" : 2, "register_time" : "2020-08-02T15:56:52.286099413Z", "update_time" : "2020-08-02T15:56:52.286099715Z", "group_name" : "api_group_001", "group_version" : "V1", "run_env_name" : "", "run_env_id" : "", "publish_id" : "", "publish_time" : "", "roma_app_name" : "app-dfge", "ld_api_id" : "", "backend_api" : null, "api_group_info" : { "id" : "c77f5e81d9cb4424bf704ef2b0ac7600", "name" : "api_group", "status" : 1, "sl_domain" : "c77f5e81d9cb4424bf704ef2b0ac7600.apic.****.com", "register_time" : "2020-08-02T15:56:52Z", "update_time" : "2020-08-02T15:56:52Z", "on_sell_status" : 2, "url_domains" : [ { "id" : "e91b83b07744e8eb1872d695ed4743b", "domain" : "domain.com", "cname_status" : 3, "ssl_id" : "ddsa83b07744e8eb1872d695ed4743b", "ssl_name" : "certificate", "min_ssl_version" : "TLSv1.1" } ], "sl_domain_access_enabled" : true }, "mock_info" : { "remark" : "", "result_content" : "mock success", "version" : "m1", "authorizer_id" : "", "status_code" : 200, "header" : [ ], "id" : "e74bbc75825c4c38ae84ccab6bdc6175", "register_time" : "2020-08-02T15:56:52.301790367Z", "status" : 1, "update_time" : "2020-08-02T15:56:52.301790686Z" }, "func_info" : null, "req_params" : [ ], "backend_params" : [ ], "policy_functions" : null, "policy_mocks" : [ ], "policy_https" : null } 状态码: 400 Bad Request { "error_code" : "APIG.2011", "error_msg" : "Invalid parameter value,parameterName:name. Please refer to the support documentation" } 状态码: 401 Unauthorized { "error_code" : "APIG.1002", "error_msg" : "Incorrect token or token resolution failed" } 状态码: 403 Forbidden { "error_code" : "APIG.1005", "error_msg" : "No permissions to request this method" } 状态码: 404 Not Found { "error_code" : "APIG.3019", "error_msg" : "The function URN does not exist" } 状态码: 500 Internal Server Error { "error_code" : "APIG.9999", "error_msg" : "System error" }
  • 响应示例 状态码: 400 Bad Request { "error_code" : "APIG.2012", "error_msg" : "Invalid parameter value,parameterName:app_id. Please refer to the support documentation" } 状态码: 401 Unauthorized { "error_code" : "APIG.1002", "error_msg" : "Incorrect token or token resolution failed" } 状态码: 403 Forbidden { "error_code" : "APIG.1005", "error_msg" : "No permissions to request this method" } 状态码: 404 Not Found { "error_code" : "APIG.3004", "error_msg" : "App 9ed8b7fe84224de681e7d7a5587e76dc does not exist" } 状态码: 500 Internal Server Error { "error_code" : "APIG.9999", "error_msg" : "System error" }
  • 响应参数 状态码: 400 表3 响应Body参数 参数 参数类型 描述 error_code String 错误码 error_msg String 错误描述 状态码: 401 表4 响应Body参数 参数 参数类型 描述 error_code String 错误码 error_msg String 错误描述 状态码: 403 表5 响应Body参数 参数 参数类型 描述 error_code String 错误码 error_msg String 错误描述 状态码: 404 表6 响应Body参数 参数 参数类型 描述 error_code String 错误码 error_msg String 错误描述 状态码: 500 表7 响应Body参数 参数 参数类型 描述 error_code String 错误码 error_msg String 错误描述
  • 请求示例 修改指定的MySQL数据源,修改主机地址、端口号、用户名和密码。 { "datasource_name" : "fdi_ds_y3k674", "datasource_type" : "MYSQL", "content" : { "host" : "**.**.**.**", "port" : "3306", "database_name" : "testfdi", "user_name" : "fditest", "password" : "******", "mode" : "default" }, "app_id" : "9dbd2cd2-9622-4a1b-ad47-31018cf44cbd", "description" : "testtesttest" }
  • 响应示例 状态码: 200 OK { "datasource_id" : "acd5502992254b3ab2dfd5b6900159db", "datasource_name" : "TY_KAFKA", "datasource_type" : "KAFKA", "content" : { "project_id" : "c53626012ba84727b938ca8bf03108ef", "type" : "KAFKA", "instance_id" : "05173009-2e5f-4773-8303-8e05cc9c9302", "broker" : "10.01.01.01:9092", "ssl_username" : "1", "ssl_password" : "******", "ssl_enable" : true }, "create_time" : 1616784907101, "update_time" : 1619650507230, "app_id" : "141bbdf5-131e-4111-898d-5a6292a2113b", "app_name" : "app-zhe", "instance_id" : "05173009-2e5f-4773-8303-8e05cc9c9302", "remark" : "No change." }
  • 响应示例 状态码: 200 OK { "total" : 1, "size" : 1, "authorizer_list" : [ { "name" : "Authorizer_demo", "type" : "FRONTEND", "authorizer_type" : "LD", "authorizer_uri" : "/test", "network_type" : "", "authorizer_version" : "", "authorizer_alias_uri" : "", "identities" : [ { "name" : "header", "location" : "HEADER" } ], "ttl" : 5, "user_data" : "authorizer_test", "id" : "0d982c1ac3da493dae47627b6439fc5c", "create_time" : "2020-09-23T02:32:10Z", "need_body" : true, "roma_app_id" : "98df09fb-d459-4cbf-83a7-2b55ca6f3d5d", "roma_app_name" : "app-demo" } ] } 状态码: 400 Bad Request { "error_code" : "APIG.2011", "error_msg" : "Invalid parameter value,parameterName:name. Please refer to the support documentation" } 状态码: 401 Unauthorized { "error_code" : "APIG.1002", "error_msg" : "Incorrect token or token resolution failed" } 状态码: 403 Forbidden { "error_code" : "APIG.1005", "error_msg" : "No permissions to request this method" } 状态码: 404 Not Found { "error_code" : "APIG.3030", "error_msg" : "The instance does not exist;id:f0fa1789-3b76-433b-a787-9892951c620e" } 状态码: 500 Internal Server Error { "error_code" : "APIG.9999", "error_msg" : "System error" }
  • 响应参数 状态码: 200 表4 响应Body参数 参数 参数类型 描述 size Integer 本次返回的列表长度 total Long 满足条件的记录数 authorizer_list Array of AuthorizerResp objects 自定义认证列表 表5 AuthorizerResp 参数 参数类型 描述 name String 自定义认证的名称。 长度为3 ~ 64位的字符串,字符串由中文、英文字母、数字、“_”组成,且只能以英文或中文开头。 type String 自定义认证类型 FRONTEND:前端 BACKEND:后端 authorizer_type String 自定义认证函数类型: LD:自定义后端函数 FUNC:函数服务函数 authorizer_uri String 函数地址。 注意:使用自定义后端的函数API,API请求方法必须为POST,且API状态必须为已部署。 network_type String 对接函数的网络架构类型 V1:非VPC网络架构 V2:VPC网络架构 注意:该字段在APIC场景下不生效 authorizer_version String 函数版本。 当函数别名URN和函数版本同时传入时,函数版本将被忽略,只会使用函数别名URN authorizer_alias_uri String 函数别名地址。 当函数别名URN和函数版本同时传入时,函数版本将被忽略,只会使用函数别名URN identities Array of Identity objects 认证来源 ttl Integer 缓存时间 user_data String 用户数据 ld_api_id String 自定义后端服务ID。 自定义认证函数类型为LD时必填 need_body Boolean 是否发送body auth_downgrade_enabled Boolean 宽松模式,连接函数鉴权服务失败或者函数鉴权服务返回5XX,网关是否接受客户端请求。 id String 自定义认证编号 create_time String 创建时间 roma_app_id String 自定义认证所属应用编号 roma_app_name String 自定义认证所属应用名称 表6 Identity 参数 参数类型 描述 name String 参数名称。 支持数字,英文,下划线,中划线,点,且只能以数字或英文开头。 location String 参数位置 validation String 参数校验表达式,默认为null,不做校验 状态码: 400 表7 响应Body参数 参数 参数类型 描述 error_code String 错误码 error_msg String 错误描述 状态码: 401 表8 响应Body参数 参数 参数类型 描述 error_code String 错误码 error_msg String 错误描述 状态码: 403 表9 响应Body参数 参数 参数类型 描述 error_code String 错误码 error_msg String 错误描述 状态码: 404 表10 响应Body参数 参数 参数类型 描述 error_code String 错误码 error_msg String 错误描述 状态码: 500 表11 响应Body参数 参数 参数类型 描述 error_code String 错误码 error_msg String 错误描述
  • 响应参数 状态码: 201 表4 响应Body参数 参数 参数类型 描述 property_id Integer 属性ID。 property_name String 属性名称,首位必须为字母,支持大小写字母、数字、中划线及下划线,长度2-50。 description String 属性描述,长度0-200。 data_type String 属性数据类型,boolean枚举值大小写敏感;number格式为数字,范围±1.0 x 10^-28 to ±7.9228 x 10^28;string为字符串;integer为整数;datetime为时间,格式为yyyyMMddTHHmmss;json为自定义json格式; array为数组类型。 required Integer 是否必填,0-非必填,1-必填。 min String 最小值,当data_type为integer或number时有效。 max String 最大值,当data_type为integer或number时有效。 step String 步长,当data_type为integer或number时有效。 max_length Integer 字符串最大长度,当data_type为string、datetime、json时有效。 unit String 属性单位。 enum_list String string的枚举值数组,使用逗号分隔,单个长度取决于max_length参数。 enum_dict Object 当数据类型为boolean枚举值时填写json格式数据,形如"enum_dict":{"0":"xxx","1":"xxx"}。 method String 访问模式(兼容20.0,R属性可读,W属性可写,E属性可执行)。 状态码: 400 表5 响应Body参数 参数 参数类型 描述 error_code String 系统错误码,针对4xx和5xx类HTTP错误码的详细错误码。 error_msg String 错误描述。 request_id String 消息ID。 状态码: 404 表6 响应Body参数 参数 参数类型 描述 error_code String 系统错误码,针对4xx和5xx类HTTP错误码的详细错误码。 error_msg String 错误描述。 request_id String 消息ID。 状态码: 500 表7 响应Body参数 参数 参数类型 描述 error_code String 系统错误码,针对4xx和5xx类HTTP错误码的详细错误码。 error_msg String 错误描述。 request_id String 消息ID。
  • 请求示例 为指定服务添加一个属性,数据类型为Integer,属性非必填,并设置最小和最大值。 { "property_name" : "power_usage", "description" : "power_usage", "data_type" : "integer", "required" : 0, "min" : "0", "max" : "100", "step" : "1", "unit" : "W" }
  • 响应示例 状态码: 201 Created { "property_id" : 3320, "property_name" : "p2", "description" : null, "data_type" : "datetime", "required" : 0, "min" : 0, "max" : 65536, "step" : 1, "max_length" : "10", "unit" : "yuan", "enum_list" : null, "method" : "RWE" } 状态码: 400 Bad Request { "error_code" : "SCB.00000000", "error_msg" : "Parameter is not valid for operation [romalink.link-command.saveProperty]. Parameter is [service_id]. Processor is [path].", "request_id" : "cb39e78a-afd3-4e04-901d-70468b1c23dc-1619602712496-cnnorth7a-P-romalink-service01" } 状态码: 404 Not Found { "error_code" : "ROMA.00110006", "error_msg" : "The resource does not exist. Check whether the resource ID 1 is correct.", "request_id" : "13984193-ca65-4954-9b7f-4b7d680399d6-1619678681445-cnnorth7a-P-romalink-service01" } 状态码: 500 Internal Server Error { "error_code" : "ROMA.00110002", "error_msg" : "The instance does not exist. project_id: 397cd10b30544c588b2f4a56d83856c4, instance_id: f3bb386a-23ec-47aa-9943-4c60ac658611", "request_id" : "c8c06d0a-be92-4fdf-9d10-bc20131ab158-1619593104919-cnnorth7a-P-romalink-service01" }
  • 请求参数 表2 请求Header参数 参数 是否必选 参数类型 描述 X-Auth-Token 是 String 用户Token。通过调用 IAM 服务获取用户Token接口获取(响应消息头中X-Subject-Token的值)。 表3 请求Body参数 参数 是否必选 参数类型 描述 property_name 是 String 属性名称,首位必须为字母,支持大小写字母、数字、中划线及下划线,长度2-50。 description 否 String 属性描述,长度0-200。 data_type 是 String 属性数据类型,boolean枚举值大小写敏感;number格式为数字,范围±1.0 x 10^-28 to ±7.9228 x 10^28;string为字符串;integer为整数;datetime为时间,格式为yyyyMMddTHHmmss;json为自定义json格式; array为数组类型。 required 是 Integer 是否必填,0-非必填,1-必填。 min 否 String 最小值,当data_type为integer或number时必填。 max 否 String 最大值,当data_type为integer或number时必填。 step 否 String 步长,当data_type为integer或number时必填。 max_length 否 Integer 字符串最大长度,当data_type为string、datetim、 json时必填,自动向下取整。 unit 否 String 属性单位。 enum_list 否 String string的枚举值数组,使用逗号分隔,单个长度取决于max_length参数。 enum_dict 否 Object 当数据类型为boolean枚举值时填写json格式数据,形如"enum_dict":{"0":"xxx","1":"xxx"}。 method 否 String 访问模式(兼容20.0,R属性可读,W属性可写,E属性可执行)。
  • 响应参数 状态码: 200 表4 响应Body参数 参数 参数类型 描述 size Integer 本次返回的列表长度 total Long 满足条件的记录数 plugins Array of PluginInfo objects 插件列表。 表5 PluginInfo 参数 参数类型 描述 plugin_id String 插件编码。 plugin_name String 插件名称。支持汉字,英文,数字,下划线,且只能以英文和汉字开头,3-255字符。 说明: 中文字符必须为UTF-8或者unicode编码。 plugin_type String 插件类型。 cors:跨域资源共享 set_resp_headers:HTTP响应头管理 kafka_log:Kafka日志推送 breaker:断路器 rate_limit: 流量控制 third_auth: 第三方认证 proxy_cache: 响应缓存 proxy_mirror: 请求镜像 plugin_scope String 插件可见范围 global:全局可见 app:集成应用可见 plugin_content String 插件定义内容,支持json。参考提供的具体模型定义 CorsPluginContent:跨域资源共享 定义内容 SetRespHeadersContent:HTTP响应头管理 定义内容 KafkaLogContent:Kafka日志推送 定义内容 BreakerContent:断路器 定义内容 RateLimitContent 流量控制 定义内容 ThirdAuthContent: 第三方认证 定义内容 ProxyCacheContent: 响应缓存 定义内容 ProxyMirrorContent: 请求镜像 定义内容 remark String 插件描述,255字符。 说明: 中文字符必须为UTF-8或者unicode编码。 create_time String 创建时间。 update_time String 更新时间。 roma_app_id String 归属集成应用编码,plugin_scope为app时生效 roma_app_name String API归属的集成应用名称 状态码: 400 表6 响应Body参数 参数 参数类型 描述 error_code String 错误码 error_msg String 错误描述 状态码: 401 表7 响应Body参数 参数 参数类型 描述 error_code String 错误码 error_msg String 错误描述 状态码: 403 表8 响应Body参数 参数 参数类型 描述 error_code String 错误码 error_msg String 错误描述 状态码: 404 表9 响应Body参数 参数 参数类型 描述 error_code String 错误码 error_msg String 错误描述 状态码: 500 表10 响应Body参数 参数 参数类型 描述 error_code String 错误码 error_msg String 错误描述
  • 响应示例 状态码: 200 OK { "total" : 1, "size" : 1, "plugins" : [ { "plugin_id" : "5b729aa252764739b3s237ef0d66dc63", "plugin_name" : "跨域插件", "plugin_type" : "cors", "plugin_scope" : "global", "plugin_content" : "{\"allow_origin\": \"*\",\"allow_methods\": \"GET,POST,PUT\",\"allow_headers\": \"Content-Type,Accept,Accept-Ranges,Cache-Control\",\"expose_headers\": \"X-Request-Id,X-Apig-Latency\",\"max_age\": 172800,\"allow_credentials\": true}", "remark" : "CORS跨域资源访问", "create_time" : "2022-11-02T12:31:23.353Z", "update_time" : "2022-11-02T12:31:23.353Z" } ] } 状态码: 400 Bad Request { "error_code" : "APIG.2012", "error_msg" : "Invalid parameter value,parameterName:instance_id. Please refer to the support documentation" } 状态码: 401 Unauthorized { "error_code" : "APIG.1002", "error_msg" : "Incorrect token or token resolution failed" } 状态码: 403 Forbidden { "error_code" : "APIG.1005", "error_msg" : "No permissions to request this method" } 状态码: 404 Not Found { "error_code" : "APIG.3002", "error_msg" : "API 5f918d104dc84480a75166ba99efff21 does not exist" } 状态码: 500 Internal Server Error { "error_code" : "APIG.9999", "error_msg" : "System error" }
  • 响应参数 状态码: 200 表4 响应Body参数 参数 参数类型 描述 size Integer 本次返回的列表长度 total Long 满足条件的记录数 apps Array of AppQuotaAppInfo objects 凭据列表 表5 AppQuotaAppInfo 参数 参数类型 描述 app_id String 凭据编号 name String 凭据名称 status Integer 凭据状态: 1:启用 2:禁用 app_key String 凭据的Key remark String 凭据描述 register_time String 创建时间 update_time String 更新时间 app_quota_id String 凭据配额编号 app_quota_name String 配额名称。支持汉字,英文,数字,下划线,且只能以英文和汉字开头,3-255字符 bound_time String 绑定时间 状态码: 400 表6 响应Body参数 参数 参数类型 描述 error_code String 错误码 error_msg String 错误描述 状态码: 401 表7 响应Body参数 参数 参数类型 描述 error_code String 错误码 error_msg String 错误描述 状态码: 403 表8 响应Body参数 参数 参数类型 描述 error_code String 错误码 error_msg String 错误描述 状态码: 404 表9 响应Body参数 参数 参数类型 描述 error_code String 错误码 error_msg String 错误描述 状态码: 500 表10 响应Body参数 参数 参数类型 描述 error_code String 错误码 error_msg String 错误描述
  • 响应示例 状态码: 200 OK { "total" : 1, "size" : 1, "apps" : [ { "app_id" : "98df09fb-d459-4cbf-83a7-2b55ca6f3d5d", "app_key" : "9b93db07-4634-4b7a-99d8-869933ed055d", "app_quota_name" : "ClientQuota_demo", "bound_time" : "2020-09-19T07:43:11Z", "name" : "app-demo", "register_time" : "2020-09-18T09:25:19Z", "status" : 1, "update_time" : "2020-09-18T09:25:19Z" } ] } 状态码: 400 Bad Request { "error_code" : "APIG.2012", "error_msg" : "Invalid parameter value,parameterName:app_name. Please refer to the support documentation" } 状态码: 401 Unauthorized { "error_code" : "APIG.1002", "error_msg" : "Incorrect token or token resolution failed" } 状态码: 403 Forbidden { "error_code" : "APIG.1005", "error_msg" : "No permissions to request this method" } 状态码: 404 Not Found { "error_code" : "APIG.3093", "error_msg" : "The App quota c900c5612dbe451bb43cbcc49cfaf2f3 does not exist" } 状态码: 500 Internal Server Error { "error_code" : "APIG.9999", "error_msg" : "System error" }
  • 请求参数 表2 请求Header参数 参数 是否必选 参数类型 描述 X-Auth-Token 是 String 用户Token。通过调用IAM服务获取用户Token接口获取(响应消息头中X-Subject-Token的值)。 表3 请求Body参数 参数 是否必选 参数类型 描述 name 是 String Topic名称,以字母开头,仅能包含数字、字母、下划线(_)、中划线(-),长度3-200字符。 app_id 是 String 集成应用Key。 app_key 否 String 集成应用Key。 partition 否 Integer Topic分区数,设置消费的并发数。 取值范围:1-100。 默认值:3。 replication 否 Integer 副本数,配置数据的可靠性。 取值范围:1-3。 默认值:3。 说明: 消息集成轻量化版的副本数只能为1。 基础版的取值范围: 1-3。 专业版/高性能设备接入版(一百万)取值范围: 1-5。 高性能设备接入版(一千万)取值范围:1-8。 access_policy 是 String 权限类型。 all:发布+订阅 pub:发布 sub:订阅 sync_message_flush 否 Boolean 是否使用同步落盘。默认值为false。同步落盘会导致性能降低。 sync_replication 否 Boolean 是否开启同步复制,开启后,客户端生产消息时相应的也要设置acks=-1,否则不生效,默认关闭。 retention_time 否 Integer 消息老化时间。默认值为72。取值范围1~168,单位小时。 tag 否 String 权限类型对应的标签。 当权限类型是all时,发布和订阅的标签用符号“&”隔开。 当有多个标签时,标签用符号“||”隔开。 description 否 String 描述。长度0-1000字符。输入值首字符不能为"="、"+"、 "-"、"@"的全角和半角字符。 sensitive_word 否 String 敏感字段。 当有多个敏感字段时,敏感字段用符号“||”隔开。
  • 响应参数 状态码:200 表4 响应Body参数 参数 参数类型 描述 name String Topic名称。 状态码:400 表5 响应Body参数 参数 参数类型 描述 error_code String 错误码。 error_msg String 错误信息。 状态码:403 表6 响应Body参数 参数 参数类型 描述 error_code String 错误码。 error_msg String 错误信息。
  • 请求示例 创建一个Topic,分区数为3,副本数为3,消息老化时间为72小时 POST https://{endpoint}/v2/{project_id}/mqs/instances/{instance_id}/topics { "name" : "topic-test-2", "app_id" : "c5abd910-02b1-4bc4-b587-c3fe4c49dab9", "partition" : 3, "access_policy" : "all", "replication" : 3, "retention_time" : 72, "sync_replication" : false, "sync_message_flush" : false, "tag" : "11 || 22 || aa || bb&11 || 22 || aa || bb", "description" : "test", "sensitive_word" : "sss || ddd" }
  • 响应示例 状态码: 200 OK { "total" : 9999999999, "size" : 999, "items" : [ { "notification_id" : 100, "type" : 0, "status" : 0, "topic" : "string", "instance_id" : "string", "app_id" : "string" } ] } 状态码: 400 Bad Request { "error_code" : "string", "error_msg" : "string", "request_id" : "string" } 状态码: 404 Not Found { "error_code" : "ROMA.00110006", "error_msg" : "The resource does not exist. Check whether the resource ID 1 is correct.", "request_id" : "624c8be1-39b6-47b7-941d-c159aced368a-1619602544650-cnnorth7a-P-romalink-service01" } 状态码: 500 Internal Server Error { "error_code" : "string", "error_msg" : "string", "request_id" : "string" }
  • 响应参数 状态码: 200 表4 响应Body参数 参数 参数类型 描述 total Integer 总数。 size Integer 本次返回数量。 items Array of NotificationResponseBody objects 订阅管理列表。 表5 NotificationResponseBody 参数 参数类型 描述 notification_id Integer 订阅ID。 type Integer 订阅类型,0:设备上线通知类型,1:设备下线通知类型,2:设备添加通知类型, 3:设备删除通知类型,4:设备变更通知类型。 status Integer 订阅管理状态,0:启用,1:停用。 topic String 订阅的Topic名称。 instance_id String 实例ID。 app_id String 应用ID。 状态码: 400 表6 响应Body参数 参数 参数类型 描述 error_code String 系统错误码,针对4xx和5xx类HTTP错误码的详细错误码。 error_msg String 错误描述。 request_id String 消息ID。 状态码: 404 表7 响应Body参数 参数 参数类型 描述 error_code String 系统错误码,针对4xx和5xx类HTTP错误码的详细错误码。 error_msg String 错误描述。 request_id String 消息ID。 状态码: 500 表8 响应Body参数 参数 参数类型 描述 error_code String 系统错误码,针对4xx和5xx类HTTP错误码的详细错误码。 error_msg String 错误描述。 request_id String 消息ID。
  • 响应示例 状态码: 200 OK { "total" : 1, "size" : 1, "features" : [ { "config" : "on", "enable" : true, "id" : "db9a9260cd3e4a16a9b5747a65d3ffaa", "instance_id" : "f0fa1789-3b76-433b-a787-9892951c620e", "name" : "app_api_key", "update_time" : "2020-08-24T01:17:31.041984Z" } ] } 状态码: 400 Bad Request { "error_code" : "APIG.2012", "error_msg" : "Invalid parameter value,parameterName:instance_id. Please refer to the support documentation" } 状态码: 401 Unauthorized { "error_code" : "APIG.1002", "error_msg" : "Incorrect token or token resolution failed" } 状态码: 403 Forbidden { "error_code" : "APIG.1005", "error_msg" : "No permissions to request this method" } 状态码: 404 Not Found { "error_code" : "APIG.3030", "error_msg" : "The instance does not exist;id:f0fa1789-3b76-433b-a787-9892951c620e" } 状态码: 500 Internal Server Error { "error_code" : "APIG.9999", "error_msg" : "System error" }
  • 响应参数 状态码: 200 表4 响应Body参数 参数 参数类型 描述 size Integer 本次返回的列表长度 total Long 满足条件的记录数 features Array of FeatureInfoV2 objects 实例特性列表 表5 FeatureInfoV2 参数 参数类型 描述 id String 特性编号 name String 特性名称 enable Boolean 是否开启特性 config String 特性参数配置 instance_id String 实例编号 update_time String 实例特性更新时间 状态码: 400 表6 响应Body参数 参数 参数类型 描述 error_code String 错误码 error_msg String 错误描述 状态码: 401 表7 响应Body参数 参数 参数类型 描述 error_code String 错误码 error_msg String 错误描述 状态码: 403 表8 响应Body参数 参数 参数类型 描述 error_code String 错误码 error_msg String 错误描述 状态码: 404 表9 响应Body参数 参数 参数类型 描述 error_code String 错误码 error_msg String 错误描述 状态码: 500 表10 响应Body参数 参数 参数类型 描述 error_code String 错误码 error_msg String 错误描述
  • 响应示例 状态码: 200 ok [ { "target_instance_id" : "62afe8b5-6bf0-40ea-b4f6-6b06a39be754", "source_app_id" : "c24d7cf4-0e5a-416c-b197-30e6696b98f2", "mapping" : [ { "ext_info" : { "server_id" : 1665647763438 }, "id" : "f1c1d7f3afc94c1c995628df55939ced", "mapping" : [ { "is_add_boolean_mapping" : false, "is_add_custom_mapping" : false, "is_add_date_mapping" : false, "is_add_fdi_uuid_mapping" : false, "is_add_mapping" : false, "source_column" : "c1", "source_column_length" : "10", "source_column_type" : "INT", "target_column" : "c1", "target_column_length" : "10", "target_column_type" : "INT" }, { "is_add_boolean_mapping" : false, "is_add_custom_mapping" : false, "is_add_date_mapping" : false, "is_add_fdi_uuid_mapping" : false, "is_add_mapping" : false, "source_column" : "c2", "source_column_length" : "100", "source_column_type" : "VARCHAR", "target_column" : "c2", "target_column_length" : "100", "target_column_type" : "VARCHAR" } ], "mapping_percent" : 100, "project_id" : "0ab7e64afd80d2822fe0c00d26395a1f", "source_columns" : [ { "field_length" : "10", "field_name" : "c1", "field_type" : "INT", "null_able" : "0", "unique" : "1" }, { "field_length" : "100", "field_name" : "c2", "field_type" : "VARCHAR", "null_able" : "1", "unique" : "0" } ], "source_ds_id" : "984edcd6735c4988b15f6a497cb97c5a", "source_group" : "SOURCE_GROUP1", "source_table" : "test.t1", "status" : "ADD", "target_columns" : [ { "field_length" : "10", "field_name" : "c1", "field_type" : "INT", "null_able" : "0", "unique" : "0" }, { "field_length" : "100", "field_name" : "c2", "field_type" : "VARCHAR", "null_able" : "1", "unique" : "0" } ], "target_ds_id" : "dd14c908aa4d446b85949550f523ff83", "target_group" : "TARGET_GROUP1", "target_table" : "fditest.t1", "task_id" : "e530a006683d400e8b3bac1d7c00952b", "updated_time" : 1665647764511 } ], "target_ds_name" : "fdi_MySQL_zqx_205", "target_app_id" : "c24d7cf4-0e5a-416c-b197-30e6696b98f2", "source_instance_id" : "62afe8b5-6bf0-40ea-b4f6-6b06a39be754", "task_id" : "e530a006683d400e8b3bac1d7c00952b", "source_ds_type" : "MYSQL", "ext_info" : { "server_id" : 1665647763438 }, "target_ds_type" : "MYSQL", "total" : 1, "source_group" : "SOURCE_GROUP1", "source_ds_id" : "984edcd6735c4988b15f6a497cb97c5a", "target_group" : "TARGET_GROUP1", "source_ds_name" : "mysql8.0.30", "target_ds_id" : "dd14c908aa4d446b85949550f523ff83" } ]
  • 请求参数 表2 请求Header参数 参数 是否必选 参数类型 描述 X-Auth-Token 是 String 用户Token。通过调用IAM服务获取用户Token接口获取(响应消息头中X-Subject-Token的值)。 表3 FormData参数 参数 是否必选 参数类型 描述 source_ds_id 是 String 源端数据源ID。 source_group 否 String 源表分组。 target_ds_id 是 String 目标端数据源ID。 target_group 否 String 目标表分组。 task_id 否 String 任务唯一标识,任务ID。 ext_info 否 String 额外标识。 task_type 否 Integer 1:实时任务,2:定时任务。 mapping_prefix 否 String 映射前缀(根据前后缀组合将源端表映射至匹配目标端表名称 = 前缀(可选) + 源端表名称 + 后缀(可选))。 mapping_suffix 否 String 映射后缀(根据前后缀组合将源端表映射至匹配目标端表名称 = 前缀(可选) + 源端表名称 + 后缀(可选))。 target_select_mapping_tables 否 String 目标端映射范围(选择多表用半角,分隔:schema.table1,schema.table2;选择全库:schema.*)。 source_select_mapping_tables 否 String 源端映射范围(选择多表用半角,分隔:schema.table1,schema.table2;选择全库:schema.*)。
  • 请求示例 创建一个自定义认证,认证类型为前端认证,函数类型为自定义后端函数,认证来源使用Header参数 { "name" : "Authorizer_demo", "type" : "FRONTEND", "authorizer_type" : "LD", "ld_api_id" : "6f8e61317e4e4fbf8e8220cc19fcced9", "authorizer_uri" : "/test", "network_type" : "", "authorizer_version" : "", "authorizer_alias_uri" : "", "identities" : [ { "name" : "header", "location" : "HEADER" } ], "ttl" : 5 }
  • 响应参数 状态码: 201 表5 响应Body参数 参数 参数类型 描述 name String 自定义认证的名称。 长度为3 ~ 64位的字符串,字符串由中文、英文字母、数字、“_”组成,且只能以英文或中文开头。 type String 自定义认证类型 FRONTEND:前端 BACKEND:后端 authorizer_type String 自定义认证函数类型: LD:自定义后端函数 FUNC:函数服务函数 authorizer_uri String 函数地址。 注意:使用自定义后端的函数API,API请求方法必须为POST,且API状态必须为已部署。 network_type String 对接函数的网络架构类型 V1:非VPC网络架构 V2:VPC网络架构 注意:该字段在APIC场景下不生效 authorizer_version String 函数版本。 当函数别名URN和函数版本同时传入时,函数版本将被忽略,只会使用函数别名URN authorizer_alias_uri String 函数别名地址。 当函数别名URN和函数版本同时传入时,函数版本将被忽略,只会使用函数别名URN identities Array of Identity objects 认证来源 ttl Integer 缓存时间 user_data String 用户数据 ld_api_id String 自定义后端服务ID。 自定义认证函数类型为LD时必填 need_body Boolean 是否发送body auth_downgrade_enabled Boolean 宽松模式,连接函数鉴权服务失败或者函数鉴权服务返回5XX,网关是否接受客户端请求。 id String 自定义认证编号 create_time String 创建时间 roma_app_id String 自定义认证所属应用编号 roma_app_name String 自定义认证所属应用名称 表6 Identity 参数 参数类型 描述 name String 参数名称。 支持数字,英文,下划线,中划线,点,且只能以数字或英文开头。 location String 参数位置 validation String 参数校验表达式,默认为null,不做校验 状态码: 400 表7 响应Body参数 参数 参数类型 描述 error_code String 错误码 error_msg String 错误描述 状态码: 401 表8 响应Body参数 参数 参数类型 描述 error_code String 错误码 error_msg String 错误描述 状态码: 403 表9 响应Body参数 参数 参数类型 描述 error_code String 错误码 error_msg String 错误描述 状态码: 404 表10 响应Body参数 参数 参数类型 描述 error_code String 错误码 error_msg String 错误描述 状态码: 500 表11 响应Body参数 参数 参数类型 描述 error_code String 错误码 error_msg String 错误描述
  • 响应示例 状态码: 201 Created { "name" : "Authorizer_demo", "type" : "FRONTEND", "authorizer_type" : "LD", "authorizer_uri" : "/test", "network_type" : "", "authorizer_version" : "", "authorizer_alias_uri" : "", "identities" : [ { "name" : "header", "location" : "HEADER" } ], "ttl" : 5, "id" : "0d982c1ac3da493dae47627b6439fc5c", "create_time" : "2020-09-23T02:32:10.354159293Z", "need_body" : true } 状态码: 400 Bad Request { "error_code" : "APIG.2011", "error_msg" : "Invalid parameter value,parameterName:type. Please refer to the support documentation" } 状态码: 401 Unauthorized { "error_code" : "APIG.1002", "error_msg" : "Incorrect token or token resolution failed" } 状态码: 403 Forbidden { "error_code" : "APIG.1005", "error_msg" : "No permissions to request this method" } 状态码: 404 Not Found { "error_code" : "APIG.3019", "error_msg" : "The function URN does not exist" } 状态码: 500 Internal Server Error { "error_code" : "APIG.9999", "error_msg" : "System error" }
共100000条
提示

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