华为云用户手册

  • 响应参数 状态码: 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状态必须为已部署。 authorizer_version String 函数版本。 当函数别名URN和函数版本同时传入时,函数版本将被忽略,只会使用函数别名URN 最大长度:64 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 id String 自定义认证编号 create_time String 创建时间 roma_app_id String 自定义认证所属应用编号 roma_app_name String 自定义认证所属应用名称 表6 Identity 参数 参数类型 描述 name String 参数名称。 支持数字,英文,下划线,中划线,点,且只能以数字或英文开头。 最小长度:0 最大长度:32 location String 参数位置 validation String 参数校验表达式,默认为null,不做校验 最大长度:1024 状态码: 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 错误描述
  • 请求示例 { "api_id" : "bd42841c20184da6bbf457c6d8a06e37", "api_type" : "function", "scripts" : [ { "type" : "SQL", "object_name" : "fun", "content" : "ZnVuY3Rpb24gZXhlY3V0ZShkYXRhKSB7CiAgICByZXR1cm4gIkhlbGxvIHdvcmxkISIKfQ==" } ]}
  • 响应示例 状态码: 200 OK { "content_type" : "json", "created_time" : "2020-09-18T09:25:59Z", "description" : "", "id" : "bd42841c20184da6bbf457c6d8a06e37", "instance" : "f0fa1789-3b76-433b-a787-9892951c620e", "method" : "GET", "modified_time" : "2020-09-18T09:25:59Z", "name" : "livedata_api_demo", "parameters" : [ ], "path" : "/test/function", "return_format" : false, "roma_app_id" : "98df09fb-d459-4cbf-83a7-2b55ca6f3d5d", "scripts" : [ { "type" : "SQL", "object_name" : "fun", "content" : "ZnVuY3Rpb24gZXhlY3V0ZShkYXRhKSB7CiAgICByZXR1cm4gIkhlbGxvIHdvcmxkISIKfQ==", "created_time" : "2020-09-19T06:29:35Z", "modified_time" : "2020-09-19T06:29:35Z" } ], "status" : 1, "type" : "", "version" : "1.0.1"} 状态码: 400 Bad Request { "error_code" : "APIG.2011", "error_msg" : "Invalid parameter value,parameterName: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.3081", "error_msg" : "authorizer with id: 0d982c1ac3da493dae47627b6439fc5c not found"} 状态码: 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参数 参数 是否必选 参数类型 描述 api_id 否 String 后端API编号 api_type 否 String API类型 data:数据API function:函数API scripts 否 Array of LdApiScript objects API脚本信息列表 表4 LdApiScript 参数 是否必选 参数类型 描述 ds_id 否 String 数据源编号,当api_type = data时,必选 ds_name 否 String 数据源名称 ds_type 否 String 数据源类型: oracle:oracle数据源类型 mysql:mysql数据源类型 mongodb:mongodb数据源类型 redis:redis数据源类型 postgresql:postgresql/opengauss数据源类型 hive:hive数据源类型 mssql:sqlserver数据源类型 sqlserver:sqlserver数据源类型 dws:dws数据源类型 gauss100:gauss100数据源类型 zenith:zenith数据源类型 type 否 String 脚本类型 SQL:sql语句 SP:存储过程 object_name 否 String 返回对象。 当api_type = data时,必选 最小长度:1 最大长度:32 content 是 String API脚本内容 请对脚本进行base64编码 最小长度:1 最大长度:100000 enable_result_paging 否 Boolean 数据脚本是否结果分页,当api_type = data时有效 缺省值:false enable_preparestatement 否 Boolean 数据脚本是否预编译,当api_type = data时有效 缺省值:false created_time 否 String 后端API脚本创建时间 modified_time 否 String 后端API脚本修改时间
  • 请求示例 { "content_type" : "json", "method" : "GET", "name" : "livedata_api_demo", "path" : "/test/function", "return_format" : false, "roma_app_id" : "98df09fb-d459-4cbf-83a7-2b55ca6f3d5d", "version" : "1.0.1"}
  • 响应示例 状态码: 201 Created { "content_type" : "json", "created_time" : "2020-09-18T09:25:59Z", "description" : "", "id" : "bd42841c20184da6bbf457c6d8a06e37", "instance" : "f0fa1789-3b76-433b-a787-9892951c620e", "method" : "GET", "modified_time" : "2020-09-18T09:25:59Z", "name" : "livedata_api_demo", "parameters" : [ ], "path" : "/test/function", "return_format" : false, "roma_app_id" : "98df09fb-d459-4cbf-83a7-2b55ca6f3d5d", "scripts" : [ ], "status" : 1, "type" : "", "version" : "1.0.1"} 状态码: 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-9892951c620ec"} 状态码: 500 Internal Server Error { "error_code" : "APIG.9999", "error_msg" : "System error"}
  • 响应示例 状态码: 200 OK { "deploys" : { "api_id" : "1d0432f1a82a49d08b9308ae7bd96ca6", "deploy_time" : "2020-09-28T11:01:09Z", "env_id" : "DEFAULT_ENVIRONMENT_RELEASE_ID", "group_id" : "01ce7564a2544713b80c7c08eb85f5d0", "id" : "abbe44b56eda428d84172343674c9cd6", "ld_api_id" : "bd42841c20184da6bbf457c6d8a06e37" }} 状态码: 400 Bad Request { "error_code" : "APIG.2011", "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.3084", "error_msg" : "The livedata API does not exist, id: bd42841c20184da6bbf457c6d8a06e37"} 状态码: 500 Internal Server Error { "error_code" : "APIG.9999", "error_msg" : "System error"}
  • 响应示例 状态码: 200 OK { "total" : 1, "size" : 1, "apis" : [ { "content_type" : "json", "created_time" : "2020-09-18T09:25:59Z", "description" : "", "id" : "bd42841c20184da6bbf457c6d8a06e37", "instance" : "f0fa1789-3b76-433b-a787-9892951c620e", "method" : "GET", "modified_time" : "2020-09-18T09:37:28Z", "name" : "livedata_api_demo", "parameters" : [ ], "path" : "/test/function", "return_format" : false, "roma_app_id" : "98df09fb-d459-4cbf-83a7-2b55ca6f3d5d", "roma_app_name" : "app-demo", "scripts" : [ ], "status" : 1, "type" : "", "version" : "1.0.1" } ]} 状态码: 400 Bad Request { "error_code" : "APIG.2011", "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-9892951c620ec"} 状态码: 500 Internal Server Error { "error_code" : "APIG.9999", "error_msg" : "System error"}
  • 响应示例 状态码: 200 OK { "total" : 1, "size" : 1, "his" : [ { "apiUUID" : "bd42841c20184da6bbf457c6d8a06e37", "testDate" : "2020-09-19T06:40:52Z", "testID" : 2524356, "testMethod" : "GET", "testOperator" : "73d69ae0cfcf460190522d06b60f05ad", "testRequest" : "{\"apiUUID\":\"bd42841c20184da6bbf457c6d8a06e37\",\"method\":\"GET\",\"params\":[{\"paramDesc\":\"\",\"paramName\":\"header\",\"paramRequired\":\"0\",\"paramType\":\"Headers\",\"paramValue\":\"test\"}],\"testUrl\":\"/test/function\"}", "test_response" : "Hello world!", "testStatusCode" : "200", "testUsedtime" : 29 } ]} 状态码: 400 Bad Request { "error_code" : "APIG.2011", "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.3084", "error_msg" : "The livedata API does not exist, id: bd42841c20184da6bbf457c6d8a06e37"} 状态码: 500 Internal Server Error { "error_code" : "APIG.9999", "error_msg" : "System error"}
  • 响应参数 状态码: 200 表3 响应Body参数 参数 参数类型 描述 size Integer 本次返回的列表长度 total Long 满足条件的记录数 his Array of LdApiTestHistoryInfo objects 本次查询到的测试结果对象列表 表4 LdApiTestHistoryInfo 参数 参数类型 描述 testStatusCode String 测试返回的状态码 testRequest String 测试的请求内容 testUsedtime Integer 测试耗时 testOperator String 测试者的项目编号 testResponse String 测试的响应内容 testMethod String 测试的请求方法 testID Integer 测试编号 testDate String 测试时间 apiUUID String 后端API编号 状态码: 400 表5 响应Body参数 参数 参数类型 描述 error_code String 错误码 error_msg String 错误描述 状态码: 401 表6 响应Body参数 参数 参数类型 描述 error_code String 错误码 error_msg String 错误描述 状态码: 403 表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 OK { "instances" : [ { "name" : "romamqs_640bb069-151e-4d5e-bd1b-xxxxxxxxxxxx", "engine" : "kafka", "port" : 9093, "status" : "RUNNING", "description" : "roma-mqs", "type" : "cluster", "specification" : "100MB", "engine_version" : "1.1.0", "connect_address" : "192.168.0.57,192.168.0.227,192.168.0.234", "instance_id" : "640bb069-151e-4d5e-bd1b-xxxxxxxxxxxx", "resource_spec_code" : "dms.instance.kafka.cluster.c3.mini", "charging_mode" : 1, "vpc_id" : "5810f4bb-b202-45cd-a5d1-xxxxxxxxxxxx", "vpc_name" : "vpc-4aeb", "created_at" : "1601016527494", "product_id" : "00300-30308-0--0", "security_group_id" : "20d120f2-70ba-4c8d-a6a4-xxxxxxxxxxxx", "security_group_name" : "sg-5ab2", "subnet_id" : "08c8e51c-7013-43ee-bb0a-xxxxxxxxxxxx", "available_zones" : [ "9f1c5806706d4c1fb0eb72f0a9b18c77" ], "user_id" : "4d1a542e7bcf400cb9c8efada01406d8", "user_name" : "paas_test", "access_user" : "mqs-gen-user-1601016526411", "maintain_begin" : "22:00:00", "maintain_end" : "02:00:00", "enable_log_collection" : false, "storage_space" : 490, "total_storage_space" : 600, "used_storage_space" : 25, "partition_num" : "300", "enable_publicip" : false, "ssl_enable" : true, "cross_vpc_info" : "{\"192.168.0.227\":{\"advertised_ip\":\"192.168.0.227\",\"port\":9011,\"port_id\":\"6ba24c0a-c3ba-4fb8-9adb-84b7a346a623\"},\"192.168.0.57\":{\"advertised_ip\":\"192.168.0.57\",\"port\":9011,\"port_id\":\"4d34a44d-d968-4dcb-89a9-e38e62626df6\"},\"192.168.0.234\":{\"advertised_ip\":\"192.168.0.234\",\"port\":9011,\"port_id\":\"9eac2e81-323c-4d2d-acce-7f84f2d3bd9b\"}}", "storage_resource_id" : "234705d3-8f33-451a-92aa-xxxxxxxxxxxx", "storage_spec_code" : "dms.physical.storage.normal", "service_type" : "advanced", "storage_type" : "hec", "is_logical_volume" : true, "extend_times" : 0, "retention_policy" : "produce_reject", "ipv6_enable" : false, "ipv6_connect_addresses" : [ ], "connector_enable" : false, "mqs_connector_enable" : true, "mqs_connector_address" : "192.168.0.10:9776;192.168.0.17:9776", "connector_id" : "", "rest_enable" : true, "rest_connect_address" : "https://10.10.10.170:9292", "kafka_public_status" : "false", "public_bandwidth" : 0, "public_boundwidth" : 0, "message_query_inst_enable" : true, "vpc_client_plain" : false, "support_features" : "kafka.crossvpc.domain.enable,feature.physerver.kafka.topic.accesspolicy,rabbitmq.plugin.management,roma_app_enable,auto_topic_switch,feature.physerver.kafka.user.manager,route,kafka.new.pod.port,feature.physerver.kafka.topic.modify,message_trace_enable,features.pod.token.access,roma.user.manage.no.support,feature.physerver.kafka.pulbic.dynamic,features.log.collection", "trace_enable" : false, "agent_enable" : false, "pod_connect_address" : "10.10.10.122:9080,10.10.10.96:9080,10.10.10.66:9080", "disk_encrypted" : false, "kafka_private_connect_address" : "192.168.0.227:9093,192.168.0.234:9093,192.168.0.57:9093", "enable_auto_topic" : false, "ces_version" : "linux,v1,v2", "plugin_enable" : false, "public_access_enabled" : "false", "node_num" : 3 }, { "name" : "romamqs_54fc780d-bf6f-4402-8149-xxxxxxxxxxxx", "engine" : "kafka", "port" : 9093, "status" : "RUNNING", "description" : "roma-mqs", "type" : "cluster", "specification" : "100MB", "engine_version" : "1.1.0", "connect_address" : "192.168.0.25,192.168.0.92,192.168.0.220", "instance_id" : "54fc780d-bf6f-4402-8149-xxxxxxxxxxxx", "resource_spec_code" : "dms.instance.kafka.cluster.c3.mini", "charging_mode" : 1, "vpc_id" : "5810f4bb-b202-45cd-a5d1-xxxxxxxxxxxx", "vpc_name" : "vpc-4aeb", "created_at" : "1600075938106", "product_id" : "00300-30308-0--0", "security_group_id" : "a9b9667f-8a48-4317-b637-xxxxxxxxxxxx", "security_group_name" : "default", "subnet_id" : "08c8e51c-7013-43ee-bb0a-xxxxxxxxxxxx", "available_zones" : [ "9f1c5806706d4c1fb0eb72f0a9b18c77" ], "user_id" : "4d1a542e7bcf400cb9c8efada01406d8", "user_name" : "paas_test", "access_user" : "mqs-gen-user-1600075937011", "maintain_begin" : "22:00:00", "maintain_end" : "02:00:00", "enable_log_collection" : false, "storage_space" : 492, "total_storage_space" : 600, "used_storage_space" : 25, "partition_num" : "300", "enable_publicip" : false, "ssl_enable" : true, "cross_vpc_info" : "{\"192.168.0.25\":{\"advertised_ip\":\"192.168.0.25\",\"port\":9011,\"port_id\":\"bcf9ba5e-26f4-4d09-b566-014eac1c804b\"},\"192.168.0.92\":{\"advertised_ip\":\"192.168.0.92\",\"port\":9011,\"port_id\":\"43bbffdd-07bf-450f-b1cd-c5e553c77c0f\"},\"192.168.0.220\":{\"advertised_ip\":\"192.168.0.220\",\"port\":9011,\"port_id\":\"dc26f9c0-2d2b-4522-9f22-b5b3d726121e\"}}", "storage_resource_id" : "0b391dcb-ccc8-4f9d-9440-xxxxxxxxxxxx", "storage_spec_code" : "dms.physical.storage.high", "service_type" : "advanced", "storage_type" : "hec", "is_logical_volume" : true, "extend_times" : 0, "retention_policy" : "produce_reject", "ipv6_enable" : false, "ipv6_connect_addresses" : [ ], "connector_enable" : false, "mqs_connector_enable" : true, "mqs_connector_address" : "192.168.0.66:9776;192.168.0.65:9776", "connector_id" : "", "rest_enable" : true, "rest_connect_address" : "https://10.10.10.57:9292", "kafka_public_status" : "false", "public_bandwidth" : 0, "public_boundwidth" : 0, "message_query_inst_enable" : true, "vpc_client_plain" : false, "support_features" : "kafka.crossvpc.domain.enable,route,kafka.new.pod.port,feature.physerver.kafka.topic.modify,feature.physerver.kafka.topic.accesspolicy,message_trace_enable,features.pod.token.access,rabbitmq.plugin.management,roma_app_enable,features.log.collection,auto_topic_switch,feature.physerver.kafka.user.manager", "trace_enable" : false, "agent_enable" : false, "pod_connect_address" : "10.10.10.244:9080,10.10.10.79:9080,10.10.10.64:9080", "disk_encrypted" : false, "kafka_private_connect_address" : "192.168.0.25:9093,192.168.0.92:9093,192.168.0.220:9093", "enable_auto_topic" : false, "ces_version" : "linux,v1,v2", "plugin_enable" : false, "public_access_enabled" : "false", "node_num" : 3 } ], "instance_num" : 2}
  • 请求示例 { "name" : "Authorizer_demo", "type" : "FRONTEND", "authorizer_type" : "LD", "ld_api_id" : "6f8e61317e4e4fbf8e8220cc19fcced9", "authorizer_uri" : "/test", "identities" : [ { "name" : "header", "location" : "HEADER" } ], "ttl" : 5}
  • 响应示例 状态码: 201 Created { "name" : "Authorizer_demo", "type" : "FRONTEND", "authorizer_type" : "LD", "authorizer_uri" : "/test", "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"}
  • 请求参数 表2 请求Header参数 参数 是否必选 参数类型 描述 X-Auth-Token 是 String 用户Token。通过调用IAM服务获取用户Token接口获取(响应消息头中X-Subject-Token的值)。 表3 请求Body参数 参数 是否必选 参数类型 描述 name 是 String 自定义认证的名称。 长度为3 ~ 64位的字符串,字符串由中文、英文字母、数字、“_”组成,且只能以英文或中文开头。 type 是 String 自定义认证类型 FRONTEND:前端 BACKEND:后端 authorizer_type 是 String 自定义认证函数类型: LD:自定义后端函数 FUNC:函数服务函数 authorizer_uri 是 String 函数地址。 注意:使用自定义后端的函数API,API请求方法必须为POST,且API状态必须为已部署。 authorizer_version 否 String 函数版本。 当函数别名URN和函数版本同时传入时,函数版本将被忽略,只会使用函数别名URN 最大长度:64 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 表4 Identity 参数 是否必选 参数类型 描述 name 是 String 参数名称。 支持数字,英文,下划线,中划线,点,且只能以数字或英文开头。 最小长度:0 最大长度:32 location 是 String 参数位置 validation 否 String 参数校验表达式,默认为null,不做校验 最大长度:1024
  • 响应参数 状态码: 201 表5 响应Body参数 参数 参数类型 描述 name String 自定义认证的名称。 长度为3 ~ 64位的字符串,字符串由中文、英文字母、数字、“_”组成,且只能以英文或中文开头。 type String 自定义认证类型 FRONTEND:前端 BACKEND:后端 authorizer_type String 自定义认证函数类型: LD:自定义后端函数 FUNC:函数服务函数 authorizer_uri String 函数地址。 注意:使用自定义后端的函数API,API请求方法必须为POST,且API状态必须为已部署。 authorizer_version String 函数版本。 当函数别名URN和函数版本同时传入时,函数版本将被忽略,只会使用函数别名URN 最大长度:64 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 id String 自定义认证编号 create_time String 创建时间 roma_app_id String 自定义认证所属应用编号 roma_app_name String 自定义认证所属应用名称 表6 Identity 参数 参数类型 描述 name String 参数名称。 支持数字,英文,下划线,中划线,点,且只能以数字或英文开头。 最小长度:0 最大长度:32 location String 参数位置 validation String 参数校验表达式,默认为null,不做校验 最大长度:1024 状态码: 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 [ { "api_id" : "5f918d104dc84480a75166ba99efff21", "auth_result" : { "status" : "SUC CES S" }, "auth_time" : "22020-08-04T04:02:22.482227344Z", "id" : "dd29b33ae4394e3b924b582c6b40880b", "app_id" : "356de8eb7a8742168586e5daf5339965", "auth_role" : "PROVIDER", "auth_tunnel" : "NORMAL"} ] 状态码: 400 Bad Request { "error_code" : "APIG.2011", "error_msg" : "Invalid parameter value,parameterName:api_ids. 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 356de8eb7a8742168586e5daf5339965 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参数 参数 是否必选 参数类型 描述 env_id 是 String 需要授权的环境编号 最小长度:1 最大长度:65 app_ids 是 Array of strings APP的编号列表 api_ids 是 Array of strings API的编号列表。 auth_tunnel 否 String 授权通道类型: GREEN:绿色通道 NORMAL:非绿色通道 实例开启green_tunnel特性时可以开启绿色通道,此字段不填默认为不使用绿色通道 缺省值:NORMAL auth_whitelist 否 Array of strings 绿色通道授权白名单。 允许白名单中的IP不使用认证信息访问,auth_tunnel = GREEN时生效 auth_blacklist 否 Array of strings 绿色通道授权黑名单。 auth_tunnel = GREEN时生效 visit_params 否 Array of ApiAuthVisitParam objects 访问参数列表。 表4 ApiAuthVisitParam 参数 是否必选 参数类型 描述 api_id 是 String 需要授权的API编号 app_id 否 String 需要授权的APP编号 visit_param 是 String 访问参数 支持英文、数字、下划线和中划线,多个参数以英文格式下的逗号隔开,单个参数须以英文或数字结尾且不能重复,且单个参数长度不超过255个字符。
  • 响应参数 状态码: 201 表5 响应Body参数 参数 参数类型 描述 [数组元素] Array of ApiAuthRelations objects API与APP的授权关系列表 表6 ApiAuthRelations 参数 参数类型 描述 api_id String API编号 auth_result AuthResult object 授权结果 auth_time String 授权时间 id String 授权关系编号 app_id String APP编号 auth_role String 授权者 PROVIDER:API提供者授权 CONSUMER:API消费者授权 auth_tunnel String 授权通道类型: GREEN:绿色通道 NORMAL:非绿色通道 此字段不填默认为不使用绿色通道 缺省值:NORMAL auth_whitelist Array of strings 绿色通道授权白名单。 允许白名单中的IP不使用认证信息访问 auth_blacklist Array of strings 绿色通道授权黑名单 visit_params String 访问参数。 表7 AuthResult 参数 参数类型 描述 status String 授权结果 SUCCESS:授权成功 SKIPPED:跳过 FILAED:授权失败 error_msg String 授权失败错误信息 error_code String 授权失败错误码 api_name String 授权失败的API名称 app_name String 授权失败的APP名称 状态码: 400 表8 响应Body参数 参数 参数类型 描述 error_code String 错误码 error_msg String 错误描述 状态码: 401 表9 响应Body参数 参数 参数类型 描述 error_code String 错误码 error_msg String 错误描述 状态码: 403 表10 响应Body参数 参数 参数类型 描述 error_code String 错误码 error_msg String 错误描述 状态码: 404 表11 响应Body参数 参数 参数类型 描述 error_code String 错误码 error_msg String 错误描述 状态码: 500 表12 响应Body参数 参数 参数类型 描述 error_code String 错误码 error_msg String 错误描述
  • 请求参数 表2 请求Header参数 参数 是否必选 参数类型 描述 X-Auth-Token 是 String 用户Token。通过调用IAM服务获取用户Token接口获取(响应消息头中X-Subject-Token的值)。 表3 请求Body参数 参数 是否必选 参数类型 描述 name 是 String API分组的名称。 支持汉字、英文、数字、中划线、下划线、点、斜杠、中英文格式下的小括号和冒号、中文格式下的顿号,且只能以英文、汉字和数字开头,3-255个字符。 说明: 中文字符必须为UTF-8或者unicode编码。 最小长度:3 最大长度:255 remark 否 String API分组描述。 说明: 中文字符必须为UTF-8或者unicode编码。 最大长度:1000 roma_app_id 否 String 分组归属的集成应用编号。 分组版本V2时必填。 version 否 String 分组版本 V1:全局分组 V2:应用级分组
  • 响应参数 状态码: 201 表4 响应Body参数 参数 参数类型 描述 id String 编号 name String API分组名称 status Integer 状态 1: 有效 2: 锁定 sl_domain String 系统默认分配的子域名 register_time String 创建时间 update_time String 最近修改时间 on_sell_status Integer 是否已上架云市场: 1:已上架 2:未上架 3:审核中 ROMA Connect暂未对接云市场,此字段默认返回2 url_domains Array of UrlDomain objects 分组上绑定的独立域名列表 sl_domains Array of strings 系统默认分配的子域名列表 remark String 描述 call_limits Integer 流控时长内分组下的API的总访问次数限制,默认不限,请根据服务的负载能力自行设置 暂不支持 time_interval Integer 流控时长 暂不支持 time_unit String 流控的时间单位 暂不支持 is_default Integer 是否为默认分组 version String 分组版本 V1:全局分组 V2:应用级分组 roma_app_id String 分组归属的集成应用编号。 分组版本V2时必填。 roma_app_name String 分组归属的集成应用名称 表5 UrlDomain 参数 参数类型 描述 id String 域名编号 domain String 访问域名 cname_status Integer 域名cname状态: 1:未解析 2:解析中 3:解析成功 4:解析失败 ssl_id String SSL证书编号 ssl_name String SSL证书名称 min_ssl_version String 最小ssl协议版本号。支持TLSv1.1或TLSv1.2 缺省值:TLSv1.1 verified_client_certificate_enabled Boolean 是否开启客户端证书校验。只有绑定证书时,该参数才生效。当绑定证书存在trusted_root_ca时,默认开启;当绑定证书不存在trusted_root_ca时,默认关闭。 缺省值:false is_has_trusted_root_ca Boolean 是否存在信任的根证书CA。当绑定证书存在trusted_root_ca时为true。 缺省值:false ssl_infos Array of SslInfo objects SSL证书列表 暂不支持 表6 SslInfo 参数 参数类型 描述 ssl_id String SSL证书编号 ssl_name String SSL证书名称 algorithm_type String 证书算法类型: RSA ECC SM2 暂不支持 type String 证书可见范围: instance:当前实例 global:全局 缺省值:global 状态码: 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 { "update_time" : "2020-07-31T06:55:55.383169299Z", "name" : "api_group_001", "on_sell_status" : 2, "remark" : "group1", "sl_domains" : [ "c77f5e81d9cb4424bf704ef2b0ac7600.apic.****.com", "c77f5e81d9cb4424bf704ef2b0ac7600.apic.****.cn" ], "sl_domain" : "c77f5e81d9cb4424bf704ef2b0ac7600.apic.****.com", "id" : "c77f5e81d9cb4424bf704ef2b0ac7600", "register_time" : "2020-07-31T06:55:55.383169068Z", "status" : 1, "is_default" : 2, "version" : "V1"} 状态码: 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-9892951c620ec"} 状态码: 500 Internal Server Error { "error_code" : "APIG.9999", "error_msg" : "System error"}
  • 响应示例 状态码: 201 Created { "id" : "7eb619ecf2a24943b099833cd24a01ba", "acl_name" : "acl_demo", "entity_type" : "IP", "acl_type" : "PERMIT", "acl_value" : "192.168.1.5,192.168.10.1", "update_time" : "2020-08-04T08:42:43.461276217Z"} 状态码: 400 Bad Request { "error_code" : "APIG.2011", "error_msg" : "Invalid parameter value,parameterName:acl_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.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"}
  • 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不同,使用时请注意。
  • Token认证 Token的有效期为24小时,需要使用一个Token鉴权时,可以先缓存起来,避免频繁调用。 Token在计算机系统中代表令牌(临时)的意思,拥有Token就代表拥有某种权限。Token认证就是在调用API的时候将Token加到请求消息头,从而通过身份认证,获得操作API的权限。 Token可通过调用IAM的获取用户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.xxx.com/v3/auth/projectsContent-Type: application/jsonX-Auth-Token: ABCDEFJ....
  • 响应参数 状态码: 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 错误描述
  • 响应示例 状态码: 400 Bad Request { "error_code" : "APIG.2012", "error_msg" : "Invalid parameter value,parameterName: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.3009", "error_msg" : "The app authorization record does not exist,id:dd29b33ae4394e3b924b582c6b40880b"} 状态码: 500 Internal Server Error { "error_code" : "APIG.9999", "error_msg" : "System error"}
  • 响应示例 状态码: 200 OK { "success" : [ { "publish_id" : "9f27d1dc4f4242a9abf88e563dbfc33d", "api_id" : "3a955b791bd24b1c9cd94c745f8d1aad", "api_name" : "Api_mock", "env_id" : "DEFAULT_ENVIRONMENT_RELEASE_ID", "version_id" : "632b2c9e022941969af9a1d45735ae2c", "remark" : "publish to release environment", "publish_time" : "2020-08-03T03:01:31.26522821Z" } ], "failure" : [ { "api_id" : "abd9c4b2ff974888b0ba79be7e6b2762", "error_code" : "APIG.3002", "error_msg" : "Api abd9c4b2ff974888b0ba79be7e6b2762 not found" } ]} 状态码: 400 Bad Request { "error_code" : "APIG.2011", "error_msg" : "Invalid parameter value: parameter action should be \\\"online\\\" or \\\"offline\\\""} 状态码: 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-9892951c620ec"} 状态码: 500 Internal Server Error { "error_code" : "APIG.9999", "error_msg" : "System error"}
  • 响应参数 状态码: 200 表5 响应Body参数 参数 参数类型 描述 success Array of PublishResp objects 发布或下线成功的信息 failure Array of BatchFailure objects 发布或下线失败的API及错误信息 表6 PublishResp 参数 参数类型 描述 publish_id String 发布记录的ID api_id String API编号 api_name String API名称 env_id String 发布的环境编号 remark String 发布描述 publish_time String 发布时间 version_id String 在线的版本号 表7 BatchFailure 参数 参数类型 描述 api_id String 操作失败的API ID api_name String 操作失败的APi名称 error_code String 操作失败的错误码 error_msg String 操作失败的错误信息 状态码: 400 表8 响应Body参数 参数 参数类型 描述 error_code String 错误码 error_msg String 错误描述 状态码: 401 表9 响应Body参数 参数 参数类型 描述 error_code String 错误码 error_msg String 错误描述 状态码: 403 表10 响应Body参数 参数 参数类型 描述 error_code String 错误码 error_msg String 错误描述 状态码: 404 表11 响应Body参数 参数 参数类型 描述 error_code String 错误码 error_msg String 错误描述 状态码: 500 表12 响应Body参数 参数 参数类型 描述 error_code String 错误码 error_msg String 错误描述
  • 请求参数 表3 请求Header参数 参数 是否必选 参数类型 描述 X-Auth-Token 是 String 用户Token。通过调用IAM服务获取用户Token接口获取(响应消息头中X-Subject-Token的值)。 表4 请求Body参数 参数 是否必选 参数类型 描述 apis 否 Array of strings 需要发布或下线的API ID列表 env_id 是 String 环境ID remark 否 String 对本次发布的描述信息 字符长度不超过255 说明: 中文字符必须为UTF-8或者unicode编码。
  • 响应参数 状态码: 200 表5 响应Body参数 参数 参数类型 描述 failure Array of BatchFailure objects 删除失败的API及错误信息 success_count Long 删除成功的API数量 表6 BatchFailure 参数 参数类型 描述 api_id String 操作失败的API ID api_name String 操作失败的APi名称 error_code String 操作失败的错误码 error_msg String 操作失败的错误信息 状态码: 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 错误描述
共100000条