CORS configuration

Updated at:
Copy as MD

This topic describes the OpenAPI operations for cross-origin resource sharing (CORS) and lists their request and response parameters.

Create a CORS configuration

You can use sofa.apigateway.cors.create to create a CORS configuration.

Request parameters

Name

Type

Required

Example

Description

param

CorsInfoVO

No

-

The CORS configuration information.

tenant_id

STRING

No

TSCPDICNT

The tenant identity.

workspace_id

STRING

No

default

The workspace identity.

Response parameters

Name

Type

Example

Description

data

CorsInfoVO

-

data

Delete a CORS configuration

You can use sofa.apigateway.cors.delete to delete a specific CORS rule.

Request parameters

Name

Type

Required

Example

Description

cors_id

STRING

No

cors_id1

The CORS rule identity.

tenant_id

STRING

No

TSCPDICNT

The tenant identity.

workspace_id

STRING

No

default

Workspace identity

Response parameters

Name

Type

Example

Description

data

BOOLEAN

true, false

data

Update a CORS configuration

You can use sofa.apigateway.cors.update to update a specific CORS rule.

Request parameters

Name

Type

Required

Example

Description

param

CorsInfoVO

No

-

The CORS configuration information.

tenant_id

STRING

No

TSCPDICNT

The tenant identity.

workspace_id

STRING

No

default

The workspace identity.

Response parameters

Name

Type

Example

Description

data

BOOLEAN

true, false

data

Query a CORS configuration by ID

You can use sofa.apigateway.cors.get to query a CORS configuration by its ID.

Request parameters

Name

Type

Required

Example

Description

cors_id

STRING

No

cors_id1

The CORS rule identity.

tenant_id

STRING

No

TSCPDICNT

The tenant identity.

workspace_id

STRING

No

default

The workspace identity.

Response parameters

Name

Type

Example

Description

data

CorsInfoVO

-

data

Query a list of CORS configurations

You can use sofa.apigateway.cors.all to query a list of all CORS rules.

Request parameters

Name

Type

Required

Example

Description

param

CorsInfoQueryVO

No

-

The CORS query parameters.

tenant_id

STRING

No

TSCPDICNT

The tenant identity.

workspace_id

STRING

No

default

The workspace identity.

Response parameters

Name

Type

Example

Description

data

ARRAY[CorsInfoVO]

-

data

Query a paginated list of CORS configurations

You can use sofa.apigateway.cors.list to query a paginated list of CORS configurations.

Request parameters

Name

Type

Required

Example

Description

param

CorsInfoQueryVO

No

-

The CORS query parameters.

tenant_id

STRING

No

TSCPDICNT

The tenant identity.

workspace_id

STRING

No

default

The workspace identity.

Response parameters

Name

Type

Example

Description

data

CorsInfoPagedListVO

-

data

Query a list of APIs by CORS ID

You can use sofa.apigateway.cors.api.all to query a list of all APIs attached to a specific CORS ID.

Request parameters

Name

Type

Required

Example

Description

cors_id

STRING

No

cors_id1

The CORS identity.

param

ApiInfoQueryVO

No

-

The API query information.

tenant_id

STRING

No

TSCPDICNT

The tenant identity.

workspace_id

STRING

No

default

The workspace identity.

Response parameters

Name

Type

Example

Description

data

ARRAY[ApiInfoVO]

-

data

Query a paginated list of APIs by CORS ID

You can use sofa.apigateway.cors.api.list to query a paginated list of APIs attached to a specific CORS ID.

Request parameters

Name

Type

Required

Example

Description

cors_id

STRING

No

cors_id1

The CORS identity.

param

ApiInfoQueryVO

No

-

param

tenant_id

STRING

No

TSCPDICNT

The tenant identity.

workspace_id

STRING

No

default

The workspace identity.

Response parameters

Name

Type

Example

Description

data

ApiInfoPagedListVO

-

data

Attach APIs by CORS ID

You can use sofa.apigateway.cors.api.mount to attach APIs to a specific CORS configuration.

Request parameters

Name

Type

Required

Example

Description

api_id_list

ARRAY[STRING]

No

-

A list of API IDs to attach.

cors_id

STRING

No

cors_id1

The CORS identity.

tenant_id

STRING

No

TSCPDICNT

The tenant identity.

workspace_id

STRING

No

default

The workspace identity.

Response parameters

Name

Type

Example

Description

data

BatchActionResult

data

Detach APIs by CORS ID

You can use sofa.apigateway.cors.api.unmount to detach APIs by CORS ID.

Request parameters

Name

Type

Required

Example

Description

api_id_list

ARRAY[STRING]

No

-

Attached API IDs

cors_id

STRING

No

cors_id1

CORS Identity

tenant_id

STRING

No

TSCPDICNT

The tenant identity.

workspace_id

STRING

No

default

The workspace identity.

Response parameters

Name

Type

Example

Description

data

BatchActionResult

-

data