Querying Scenarios

Function

This API is used to query the information about a scenario.

URI

GET /v1/{project_id}/scene

Table 1 describes the URI parameters.
Table 1 URI parameters

Parameter

Mandatory

Type

Description

project_id

Yes

String

Project ID, which is used for resource isolation. For details about how to obtain the project ID, see Obtaining a Project ID.

Request

N/A

Response

Table 2 describes the response parameters.

Table 2 Response parameters

Parameter

Type

Description

is_success

boolean

Whether the request is successful

scenes

object []

Scenario information. For details, see Table 3.

  • Min. quantity: 1
  • Max. quantity: 10

error_code

String

Error code that indicates a request has failed. This parameter is unavailable when a request is successful.

error_msg

String

Error message that indicates a request has failed. This parameter is unavailable when a request is successful.

message

String

Response message.

Table 3 scenes parameters

Parameter

Type

Description

project_id

String

Project ID, which is used for resource isolation.

user_id

String

User ID, which is used to isolate users in the public cloud.

scene_id

String

Scenario ID

scene_name

String

Scenario name

Example

  • Example of a successful response
    {
        "is_success": true,
        "message": "Succeed to query the scene information.",
        "scenes": [
            {
                "scene_id": "0",
    "scene_name": "Default scenario"
            },
            {
                "project_id": "07f125793ba7497d887cb112dc917e87",
                "user_id": "07f125793ba7497d887cb112dc917e87",
                "scene_id": "51192cc3cecc4bcd854a6c40dc7941db",
                "scene_name": "10"
            }
        ]
    }
  • Example of a failed response
    {
        "error_code": "res.2301",
        "error_msg": "Failed to resolve the token from the request."
    }

Status Code

For details about status codes, see Status Codes.