Help Center> RES> API Reference> API> Scenario> Querying the List of Scenarios

Querying the List of Scenarios

Function

This API is used to query the scenario list in the current workspace.

URI

GET /v2.0/{project_id}/workspaces/{workspace_id}/scenes

Table 1 Path parameters

Parameter

Mandatory

Type

Description

project_id

Yes

String

Project ID. For details on how to obtain the project ID, see Obtaining a Project ID.

workspace_id

Yes

String

Workspace ID

Table 2 Query parameters

Parameter

Mandatory

Type

Description

category

Yes

String

Scenario type. The options are:

  • customize indicates the custom recommendation scenario.

  • Intelligent indicates the intelligent recommendation scenario.

Request Parameters

Table 3 Request header parameters

Parameter

Mandatory

Type

Description

Content-Type

Yes

String

Content type. The value is application/json.

X-Auth-Token

Yes

String

User token. For details on how to obtain the user token, see Obtaining a User Token Through Password Authentication.

Response Parameters

Status code: 200

Table 4 Response body parameters

Parameter

Type

Description

is_success

Boolean

Whether the request is successful

res_scenes

Array of res_scene objects

Scenario list information

message

String

Response message (This field is not returned when the request is successful.)

error_code

String

Error code (This parameter is not returned when the request is successful.)

Table 5 res_scene

Parameter

Type

Description

category

String

Type

datasource_id

String

Data source ID

ds_config

DataConfig object

Data source settings

scene_id

String

Scenario ID

scene_name

String

Scenario name

type

String

Scenario type

service_type

String

Service type

status

String

Status

workspace_id

String

Workspace ID

created_at

String

Creation time

update_at

String

Update time

specs_config

SpecsConfig object

Computing specifications

Table 6 DataConfig

Parameter

Type

Description

offline

Offline object

Offline computing specifications

nearline

Nearline object

Nearline data source

Table 7 Offline

Parameter

Type

Description

user_url

String

User data URL

item_url

String

Item data URL

behavior_url

String

Behavior data URL

Table 8 Nearline

Parameter

Type

Description

item_topic

Topic object

Item topic

user_topic

Topic object

User topic

behavior_topic

Topic object

Behavior topic

Table 9 Topic

Parameter

Type

Description

name

String

Name

id

String

ID

Table 10 SpecsConfig

Parameter

Type

Description

offline

String

Offline computing specifications

nearline

String

Real-time computing specifications

rank

String

Deep learning computing specifications

online_tps

Integer

Max. number of concurrent online services

Example Requests

This API is used to query the scenario list in the current workspace.

/v2.0/testuuidxxxxxxxxxxxxxxxxxxxxxxxx/workspaces/testuuidxxxxxxxxxxxxxxxxxxxxxxxx/scenes?category=customize

-

Example Responses

Status code: 200

OK

{
  "res_scenes" : [ {
    "type" : "UI",
    "service_type" : "rec",
    "ds_config" : {
      "time_interval" : 300
    },
    "specs_config" : {
      "offline" : "4CU",
      "nearline" : "2CU",
      "rank" : "16CU",
      "online_tps" : 10
    },
    "scene_name" : "cyd-scene",
    "category" : "customize",
    "scene_id" : "01040139fde2434eb7f0dfab597a3614",
    "datasource_id" : "1f0affe98a7844ca920f47a2b7e7abae",
    "status" : "PRE_START",
    "created_at" : 0,
    "update_at" : 0,
    "workspace_id" : "68887f2a855f45e7ab4850ecc7ca28c2"
  }, {
    "type" : "UI",
    "service_type" : "rank",
    "ds_config" : {
      "time_interval" : 30
    },
    "specs_config" : {
      "offline" : "4CU",
      "nearline" : "2CU",
      "rank" : "16CU",
      "online_tps" : 10
    },
    "scene_name" : "jby-test-0102",
    "category" : "customize",
    "scene_id" : "159a4b7ea15a43abb469ef2a7739bae4",
    "datasource_id" : "6a3475a7dd11492e8d14f73a3719333b",
    "status" : "INITIALIZED",
    "created_at" : 0,
    "update_at" : 0,
    "workspace_id" : "68887f2a855f45e7ab4850ecc7ca28c2"
  } ],
  "is_success" : true
}

Status Codes

Status Code

Description

200

OK

Error Codes

See Error Codes.