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

时间:2024-10-30 19:37:40

响应示例

状态码: 201

Created

  • 示例 1
    {
      "id" : "5f918d104dc84480a75166ba99efff21",
      "tags" : [ "webApi" ],
      "arrange_necessary" : 2,
      "backend_type" : "HTTP",
      "auth_type" : "AUTHORIZER",
      "auth_opt" : {
        "app_code_auth_type" : "DISABLE"
      },
      "authorizer_id" : "0d982c1ac3da493dae47627b6439fc5c",
      "backend_api" : {
        "update_time" : "2020-07-31T12:42:51.325312994Z",
        "vpc_status" : 2,
        "url_domain" : "10.10.10.156:12346",
        "req_protocol" : "HTTP",
        "id" : "1ce8fda3586d4371bd83c955df37e102",
        "req_method" : "GET",
        "register_time" : "2020-07-31T12:42:51.325312721Z",
        "req_uri" : "/benchmark",
        "timeout" : 5000,
        "status" : 1
      },
      "cors" : false,
      "status" : 1,
      "group_name" : "api_group_001",
      "group_id" : "c77f5e81d9cb4424bf704ef2b0ac7600",
      "group_version" : "V1",
      "response_id" : "981e6c8f847f47199a9faf4409b751a5",
      "match_mode" : "NORMAL",
      "name" : "Api_http",
      "req_protocol" : "HTTPS",
      "req_method" : "GET",
      "req_uri" : "/test/http",
      "type" : 1,
      "result_normal_sample" : "normal result",
      "result_failure_sample" : "failure result",
      "version" : "V0.0.1",
      "register_time" : "2020-07-31T12:42:51.314357035Z",
      "update_time" : "2020-07-31T12:42:51.314357324Z",
      "remark" : "Web backend API",
      "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" : "consumer app id",
        "id" : "a1349c61016e4d999ca783a50bfeee2b"
      } ]
    }
  • 示例 2
    {
      "id" : "abd9c4b2ff974888b0ba79be7e6b2763",
      "arrange_necessary" : 2,
      "group_id" : "c77f5e81d9cb4424bf704ef2b0ac7600",
      "group_name" : "api_group_001",
      "group_version" : "V1",
      "match_mode" : "NORMAL",
      "name" : "Api_function",
      "auth_type" : "APP",
      "auth_opt" : {
        "auth_code_auth_type" : "DISABLE"
      },
      "backend_type" : "FUNCTION",
      "func_info" : {
        "id" : "c0740524cd4c40e3801a7afe5375f8b0",
        "authorizer_id" : "5b8cd3f06f004115aec69c58f57272c9",
        "function_urn" : "'urn:fss:region01:73d69ae0cfcf460190522d06b60f05ad:function:default:auto_testfunc93749'",
        "invocation_type" : "sync",
        "timeout" : 5000,
        "version" : "latest",
        "register_time" : "2020-08-02T15:36:19.897262803Z",
        "update_time" : "2020-08-02T15:36:19.897262993Z",
        "status" : 1
      },
      "cors" : false,
      "req_protocol" : "HTTPS",
      "req_uri" : "/test/function",
      "remark" : "function api",
      "type" : 1,
      "version" : "V0.0.1",
      "status" : 1,
      "req_method" : "GET",
      "result_normal_sample" : "normal result",
      "result_failure_sample" : "failure result",
      "tags" : [ "functionApi" ],
      "register_time" : "2020-08-02T15:36:19.892012381Z",
      "update_time" : "2020-08-02T15:36:19.892012627Z"
    }
  • 示例 3
    {
      "id" : "3a955b791bd24b1c9cd94c745f8d1aad",
      "arrange_necessary" : 2,
      "group_id" : "c77f5e81d9cb4424bf704ef2b0ac7600",
      "group_name" : "api_group_001",
      "group_version" : "V1",
      "match_mode" : "SWA",
      "name" : "Api_mock",
      "auth_type" : " IAM ",
      "auth_opt" : {
        "auth_code_auth_type" : "DISABLE"
      },
      "backend_type" : "MOCK",
      "mock_info" : {
        "id" : "e74bbc75825c4c38ae84ccab6bdc6175",
        "result_content" : "mock success",
        "update_time" : "2020-08-02T15:56:52.301790686Z",
        "register_time" : "2020-08-02T15:56:52.301790367Z"
      },
      "policy_mocks" : [ {
        "name" : "mock api",
        "id" : "1cb05173a4c84b7d996e30145cce3c7d",
        "effect_mode" : "ANY",
        "result_content" : "mock policy success",
        "conditions" : [ {
          "condition_origin" : "source",
          "condition_value" : "1.0.1.0",
          "id" : "8650b3a94e7344df8251658d8aee1f6d"
        } ]
      } ],
      "cors" : false,
      "req_protocol" : "HTTPS",
      "req_uri" : "/test/mock",
      "remark" : "mock api",
      "type" : 1,
      "version" : "V0.0.1",
      "req_method" : "GET",
      "result_normal_sample" : "normal result",
      "result_failure_sample" : "failure result",
      "tags" : [ "mockApi" ],
      "register_time" : "2020-08-02T15:56:52.286099413Z",
      "update_time" : "2020-08-02T15:56:52.286099715Z",
      "status" : 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.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/CreateApi.html