DeployHttpApi

更新时间:
复制 MD 格式

Publishes HTTP APIs, including routes for REST and HTTP APIs.

Try it now

Try this API in OpenAPI Explorer, no manual signing needed. Successful calls auto-generate SDK code matching your parameters. Download it with built-in credential security for local usage.

Test

RAM authorization

The table below describes the authorization required to call this API. You can define it in a Resource Access Management (RAM) policy. The table's columns are detailed below:

  • Action: The actions can be used in the Action element of RAM permission policy statements to grant permissions to perform the operation.

  • API: The API that you can call to perform the action.

  • Access level: The predefined level of access granted for each API. Valid values: create, list, get, update, and delete.

  • Resource type: The type of the resource that supports authorization to perform the action. It indicates if the action supports resource-level permission. The specified resource must be compatible with the action. Otherwise, the policy will be ineffective.

    • For APIs with resource-level permissions, required resource types are marked with an asterisk (*). Specify the corresponding Alibaba Cloud Resource Name (ARN) in the Resource element of the policy.

    • For APIs without resource-level permissions, it is shown as All Resources. Use an asterisk (*) in the Resource element of the policy.

  • Condition key: The condition keys defined by the service. The key allows for granular control, applying to either actions alone or actions associated with specific resources. In addition to service-specific condition keys, Alibaba Cloud provides a set of common condition keys applicable across all RAM-supported services.

  • Dependent action: The dependent actions required to run the action. To complete the action, the RAM user or the RAM role must have the permissions to perform all dependent actions.

Action

Access level

Resource type

Condition key

Dependent action

apig:DeployHttpApi

none

*HttpApi

acs:apig:{#regionId}:{#accountId}:httpapi/{#HttpApiId}

None None

Request syntax

POST /v1/http-apis/{httpApiId}/deploy HTTP/1.1

Path Parameters

Parameter

Type

Required

Description

Example

httpApiId

string

No

The unique identifier of the HTTP API.

api-cr68g1dlhtgm31fb***

Request parameters

Parameter

Type

Required

Description

Example

body

object

No

The request body.

routeId

string

No

The route ID. Required when deploying a route for an HTTP API.

hr-cr82undlhtgrl***

restApiConfig

object

No

The REST API deployment configuration. Required when deploying an HTTP API as a REST API.

revisionId

string

No

The revision ID. If specified, the deployment uses the configuration from that revision.

apr-xxx

description

string

No

The deployment description.

用户服务API发布。

environment

object

No

The deployment environment configuration.

environmentId deprecated

string

No

The environment ID.

env-cpqnr6tlhtgubc***

customDomainIds

array

No

A list of custom domain IDs.

string

No

The domain ID.

d-cr62ts5lhtgln***

backendScene deprecated

string

No

The API deployment scenario.

Valid values:

  • SingleService :

    single service

  • MultiServiceByRatio :

    canary release by ratio

  • MultiServiceByContent :

    canary release by content

  • Mock :

    mock

SingleService

serviceConfigs deprecated

array<object>

No

The service configurations. Specify a single configuration for a single service deployment, or multiple configurations for canary release by ratio and canary release by content.

object

No

The service configuration.

serviceId

string

No

The service ID.

svc-cr6pk4tlhtgm58e***

protocol

string

No

The service protocol:

  • HTTP

  • HTTPS

Valid values:

  • HTTPS :

    HTTPS

  • HTTP :

    HTTP

HTTP

port

integer

No

The service port. Omit this parameter when using a dynamic port.

8080

weight

integer

No

The weight. An integer from 1 to 100. Used only for the canary release by ratio scenario.

49

version

string

No

The service version.

v1

match HttpApiBackendMatchConditions

No

The match conditions for routing requests to this service configuration. This parameter is applicable only to the canary release by content scenario.

{\"change_order_revision\":\"3.657.33_fc-hz-yunqi.1662568293908382_faas-eerouter\"}

operationIds deprecated

array

No

The operation IDs.

string

No

An operation ID.

xxxxxx

gatewayId

string

No

The gateway ID.

gw-cvn2u46m1hkun04oll8g

operationDeployments

array<object>

No

A list of operation-level deployment configurations.

object

No

An operation-level deployment configuration.

operationId

string

No

The operation ID.

op-xxx

action

string

No

The action type.

Publish

httpApiConfig deprecated

object

No

The HTTP API deployment configuration.

gatewayId

string

No

The gateway ID.

gw-csrhgfmm1hknf0hu6o3g

routeIds

array

No

The route IDs.

string

No

A route ID.

xxxxxx

Response elements

Element

Type

Description

Example

object

The response object.

requestId

string

The unique identifier for the request.

0C2D1C68-0D93-5561-8EE6-FDB7BF067A30

code

string

The status code of the response.

Ok

message

string

The response message.

success

data

object

httpApiId

string

Examples

Success response

JSON format

{
  "requestId": "0C2D1C68-0D93-5561-8EE6-FDB7BF067A30",
  "code": "Ok",
  "message": "success",
  "data": {
    "httpApiId": ""
  }
}

Error codes

See Error Codes for a complete list.

Release notes

See Release Notes for a complete list.