应用与数据集成平台 ROMA Connect-创建API:响应示例

时间:2025-02-12 14:55:42

响应示例

状态码: 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"    } ]  },  "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"    } ]  },  "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"    } ]  },  "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"}
support.huaweicloud.com/api-roma/CreateApiV2.html