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

Publishing an API

Description

This API is used to publish an API. Only published APIs can be called. You can choose to publish an API to a specified gateway.

  • If you are using DLM Shared, you can only publish APIs to the API Gateway Shared edition.
  • If you are using DLM Exclusive, you can publish APIs to the API Gateway Dedicated edition or ROMA-APIC, or do not publish APIs to any gateway.

If you are not the reviewer, your request for publishing an API needs to be reviewed by the API reviewer.

URL

  • URI format

    POST /v1/{project_id}/service/apis/{api_id}/instances/{instance_id}/publish

  • 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

    instance_id

    Yes

    String

    Cluster ID

Request Message

  • Example request
    {
      "apig_type": "APIG",
      "apig_instance_id": "APIG",
      "group_id_in_apig": "d1a3400bbe04457587bc32293e7b7c80",
      "roma_app_id": null
    }
  • Request parameter description

    Parameter

    Mandatory

    Type

    Description

    apig_type

    No

    String

    Gateway type. Available values include:

    APIG: API Gateway Shared edition

    APIGW: API Gateway Dedicated edition

    ROMA_APIC: ROMA-APIC gateway

    None (or null): no gateway

    apig_instance_id

    No

    String

    Gateway instance ID

    For the API Gateway Shared edition, the instance ID is APIG.

    If the API is not published to any gateway, this parameter is not required, or is set to null.

    For the API Gateway Dedicated edition or ROMA gateway, the value of this parameter is the actual gateway instance ID.

    group_id_in_apig

    No

    String

    Gateway group ID

    dlm_default: default group created for DLM on the gateway

    If the API is not published to any gateway, this parameter is not required, or is set to null.

    For any other group, the value of this parameter is the corresponding gateway group ID.

    roma_app_id

    No

    String

    ID of the ROMA gateway integrated app

    If the API is to be published to the API Gateway Shared or Dedicated edition, or not published to any gateway, this parameter is not required, or is set to null.

    If the API is to be published to the ROMA gateway, the value of this parameter is the ID of the integrated app.

Response

  • Example response

    None

Status Code

Status Code

Description

204

The API is published successfully.

For details about status codes, see Status Codes.