Updated on 2022-09-15 GMT+08:00

Querying API Information

Description

This API is used to query information about an API.

URI

  • URI format

    GET /v1/{project_id}/service/apis/{api_id}

  • Parameter description

    Parameter

    Mandatory

    Type

    Description

    project_id

    Yes

    String

    Project ID. For details about how to obtain the project ID, see Project ID and Account ID.

    api_id

    Yes

    String

    API Id

Request Message

  • Example request

    None

Response

  • Example response
    {
      "backend_config": null,
      "catalog_id": "0",
      "create_time": 1589186805000,
      "datasource_config": {
        "access_mode": "SQL",
        "backend_paras": [
          {
            "condition": "CONDITION_TYPE_EQ",
            "mapping": "a1",
            "name": "p"
          },
          {
            "condition": "CONDITION_TYPE_EQ",
            "mapping": "a3",
            "name": "q"
          },
          {
            "condition": "CONDITION_TYPE_EQ",
            "mapping": "a2",
            "name": "h"
          }
        ],
        "connection_id": "8a94809170fa181e0170fd2cbb610007",
        "database": "default",
        "order_paras": [
          {
            "description": "1",
            "field": "a1",
            "name": "o1",
            "optional": false,
            "order": 1,
            "sort": "ASC"
          },
          {
            "description": "",
            "field": "a2",
            "name": "o2",
            "optional": true,
            "order": 2,
            "sort": "CUSTOM"
          }
        ],
        "pagination": "DEFAULT",
        "queue": "default",
        "response_paras": [
          {
            "description": "",
            "example_value": "",
            "field": "a1",
            "name": "a1x",
            "type": "REQUEST_PARAMETER_TYPE_STRING"
          },
          {
            "description": "",
            "example_value": "",
            "field": "a2",
            "name": "a2",
            "type": "REQUEST_PARAMETER_TYPE_STRING"
          },
          {
            "description": "",
            "example_value": "1",
            "field": "a3",
            "name": "a3",
            "type": "REQUEST_PARAMETER_TYPE_NUMBER"
          }
        ],
        "sql": null,
        "table_name": "pagesize",
        "type": "DLI"
      },
      "description": "update",
      "host": "e7c91cd2d4714e81807b7d4c273f791c.apig.cn-north-7.huaweicloudapis.com",
      "id": "f2108870c3867c3080cf5dfcc1f1a66c",
      "log_flag": true,
      "manager": "test",
      "name": "testOpenApi_create_configuration_update",
      "path": "/testOpenApi_configuration/{p}",
      "protocol": "PROTOCOL_TYPE_HTTP",
      "publish_type": "PUBLISH_TYPE_PRIVATE",
      "request_paras": [
        {
          "default_value": "",
          "description": "",
          "example_value": "",
          "support_null": false,
          "name": "h",
          "necessary": false,
          "position": "REQUEST_PARAMETER_POSITION_HEADER",
          "type": "REQUEST_PARAMETER_TYPE_STRING"
        },
        {
          "default_value": null,
          "description": "123",
          "example_value": null,
          "support_null": false,
          "name": "p",
          "necessary": true,
          "position": "REQUEST_PARAMETER_POSITION_PATH",
          "type": "REQUEST_PARAMETER_TYPE_NUMBER"
        },
        {
          "default_value": null,
          "description": "",
          "example_value": null,
          "support_null": false,
          "name": "q",
          "necessary": true,
          "position": "REQUEST_PARAMETER_POSITION_QUERY",
          "type": "REQUEST_PARAMETER_TYPE_NUMBER"
        }
      ],
      "request_type": "REQUEST_TYPE_GET",
      "update_time": 1589202148000,
    "data_mask_switch":true,
    "data_mask_paras":[
    {
    "column_name":"id",
    "algorithm_name":"Retain first N and last M.",
    "algorithm_type":"MASK",
    "en_name":"KeepBeforeNAfterM",
    "algorithm_parameters":"{\"m\":0,\"n\":1}",
    "failure_policy":"SKIP",
    "default_value":""
    }
    ]
    }
  • Parameter description

    Parameter

    Type

    Description

    id

    String

    API Id

    name

    String

    API name

    manager

    String

    API reviewer name

    catalog_id

    String

    API catalog ID

    description

    String

    API description

    protocol

    String

    API access protocol. Available values include:

    PROTOCOL_TYPE_HTTP: HTTP

    PROTOCOL_TYPE_HTTPS: HTTPS

    publish_type

    String

    API publish type. Available values include:

    PUBLISH_TYPE_PUBLIC

    The API is available to all tenants.

    PUBLISH_TYPE_PRIVATE

    The API is private and available only to tenants in the same project.

    path

    String

    API path

    request_type

    String

    API request type. Available values include:

    REQUEST_TYPE_POST: POST type

    REQUEST_TYPE_GET: GET type

    create_time

    Long

    API creation time (a 13-digit timestamp)

    update_time

    Long

    API update time (a 13-digit timestamp)

    type

    String

    API type. Available values include:

    API_SPECIFIC_TYPE_CONFIGURATION: configuration API

    API_SPECIFIC_TYPE_SCRIPT: script API

    API_SPECIFIC_TYPE_REGISTER: registration API

    host

    String

    API group domain name

    log_flag

    Boolean

    Whether to enable logging

    request_paras

    Dictionary

    API request parameters

    datasource_config

    Dictionary

    API data source configuration

    data_mask_switch

    Boolean

    Whether to enable data masking

    This parameter is available only in DLM Exclusive.

    data_mask_paras

    Dictionary

    Data masking parameters

    backend_config

    Dictionary

    API backend configuration

    • request_paras parameter description

      Parameter

      Type

      Description

      name

      String

      Parameter name

      position

      String

      Parameter position. Available values include:

      REQUEST_PARAMETER_POSITION_PATH: The parameter is in the path.

      REQUEST_PARAMETER_POSITION_HEADER: The parameter is in the header.

      REQUEST_PARAMETER_POSITION_QUERY: The parameter is in the query.

      type

      String

      Parameter type.

      REQUEST_PARAMETER_TYPE_NUMBER: number

      REQUEST_PARAMETER_TYPE_STRING: string

      description

      String

      Parameter description

      necessary

      Boolean

      Mandatory

      example_value

      String

      Example value

      support_null

      Boolean

      Whether null is allowed

      default_value

      String

      Default value

    • datasource_config parameter description

      Parameter

      Type

      Description

      type

      String

      Data source type

      The value can be MYSQL, DLI, DWS, or Hive.

      connection_id

      String

      Data connection ID

      database

      String

      Database name

      table_name

      String

      Table name

      queue

      DLI queue name

      SQL statement in script mode

      access_mode

      String

      Mode of obtaining data

      SQL: Data is obtained using SQL statements. The public cloud only supports this mode.

      ROW_KEY: Data is obtained through the row key. This mode applies only to the HBase data source.

      PREFIX_FILTER: Data is obtained through the prefix filter. This mode applies only to the HBase data source.

      pagination

      String

      Pagination mode

      The value can be DEFAULT or CUSTOM.

      sql

      String

      SQL statement in script mode

      total_size_sql

      Boolean

      SQL script for calculating the total number of records in the dataset in the script mode

      total_size_switch

      Boolean

      Whether to return the total number of records

      backend_paras

      Dictionary

      API backend parameters

      response_paras

      Dictionary

      Response parameters of configuration APIs

      order_paras

      Dictionary

      Sorting parameters

    • data_mask_paras parameter description

      Parameter

      Mandatory

      Type

      Description

      column_name

      Yes

      String

      Field name (subject to the field name in the returned result)

      algorithm_name

      Yes

      String

      Algorithm name. For details, see Data Security APIs.

      algorithm_type

      Yes

      String

      Algorithm type. For details, see Data Security APIs.

      en_name

      Yes

      String

      Algorithm name in English. For details, see Data Security APIs.

      algorithm_parameters

      Yes

      String

      Algorithm parameters. For details, see Data Security APIs.

      failure_policy

      Yes

      String

      Failure policy to be applied when an exception occurs during data masking. Available values include:

      1. INTERRUPT_AND_EXCEPTION
      2. DEFAULT_VALUE
      3. SKIP
      4. SET_NULL

      default_value

      No

      String

      Default value to be obtained when a failure occurs. This parameter is required only when failure_policy is DEFAULT_VALUE.

    • backend_paras parameter description

      Parameter

      Type

      Description

      name

      String

      Parameter name

      mapping

      String

      Mapping field

      condition

      String

      Operator. Available values include:

      CONDITION_TYPE_EQ: equal to

      CONDITION_TYPE_NE: not equal to

      CONDITION_TYPE_GT: greater than

      CONDITION_TYPE_GE: greater than or equal to

      CONDITION_TYPE_LT: less than

      CONDITION_TYPE_LE: less than or equal to

      CONDITION_TYPE_LIKE: %parameter%

      CONDITION_TYPE_LIKE_L: %parameter

      CONDITION_TYPE_LIKE_R: parameter%

    • response_paras parameter description

      Parameter

      Type

      Description

      name

      String

      Parameter name

      field

      String

      Bound table field

      type

      String

      Parameter type.

      REQUEST_PARAMETER_TYPE_STRING: string

      REQUEST_PARAMETER_TYPE_NUMBER: number

      description

      String

      Parameter description

      example_value

      String

      Instance value

    • order_paras parameter description

      Parameter

      Type

      Description

      name

      String

      Parameter name

      field

      String

      Bound table field

      optional

      Boolean

      Mandatory or optional

      sort

      String

      Sorting method. Available values include:

      ASC: ascending order

      DESC: descending order

      CUSTOM: custom order

      descriptioni

      String

      Description

      order

      Integer

      Sorting order

    • backend_config parameter description

      Parameter

      Type

      Description

      type

      String

      Request type. Available values include:

      REQUEST_TYPE_POST: POST request

      REQUEST_TYPE_GET: GET request

      protocol

      String

      Request protocol. Available values include:

      PROTOCOL_TYPE_HTTP: HTTP

      PROTOCOL_TYPE_HTTPS: HTTPS

      host

      String

      Backend host

      timeout

      Integer

      Timeout duration

      path

      String

      Request path

      backend_paras

      Dictionary

      Backend parameters

      constant_paras

      Dictionary

      Backend constant parameters

    • backend_paras parameter description

      Parameter

      Type

      Description

      name

      String

      Request parameter name

      position

      String

      Parameter position. Available values include:

      REQUEST_PARAMETER_POSITION_PATH

      (The parameter is in the path.)

      REQUEST_PARAMETER_POSITION_HEADER

      (The parameter is in the header.)

      REQUEST_PARAMETER_POSITION_QUERY

      (The parameter is in the query.)

      backend_para_name

      String

      Backend parameter name

    • constant_paras parameter description

      Parameter

      Type

      Description

      name

      String

      Parameter name

      type

      String

      Parameter type.

      REQUEST_PARAMETER_TYPE_NUMBER

      (number)

      REQUEST_PARAMETER_TYPE_STRING

      (string)

      position

      String

      Parameter position. Available values include:

      REQUEST_PARAMETER_POSITION_PATH

      (The parameter is in the path.)

      REQUEST_PARAMETER_POSITION_HEADER

      (The parameter is in the header.)

      REQUEST_PARAMETER_POSITION_QUERY

      (The parameter is in the query.)

      description

      String

      Parameter description

      value

      String

      Parameter value

Status Code

Status Code

Description

200

The API information is obtained.

For details about status codes, see Status Codes.