Updated on 2024-01-04 GMT+08:00

Querying Scene Analysis Plugin Information

Function

This API is used to query the information about the application analysis capability in a scene, including information about the applications, parameters, and function details.

URI

GET /v2/{project_id}/graphs/scenes

Table 1 URI parameters

Parameter

Mandatory

Type

Description

project_id

Yes

String

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

Table 2 Query parameters

Parameter

Mandatory

Type

Description

scene_name

No

String

Scene name. If only scene_name is specified, all application details in the specified scene will be returned. If only scene_name and application_name are specified, details about the applications requested by application_name will be returned. If scene_name, application_name, and graph_id are left empty, details of all scene applications will be returned.

application_name

No

String

Application name. If only scene_name and application_name are specified, details about the applications requested by application_name will be returned. If scene_name, application_name, and graph_id are left empty, details of all scene applications will be returned.

graph_id

No

String

Graph ID. If only graph_id is set, details about all the subscribed applications of the graph ID will be returned. If scene_name, application_name, and graph_id are left empty, details of all scene applications will be returned.

Request Parameters

Table 3 Request header parameter

Parameter

Mandatory

Type

Description

X-Auth-Token

Yes

String

User token.

It is used to obtain the permission to call APIs. For details about how to obtain the token, see Authentication. The value of X-Subject-Token in the response header is the token.

Response Parameters

Status code: 200

Table 4 Response body parameters

Parameter

Type

Description

results

Array of results objects

Scene analysis plugin information

Table 5 results

Parameter

Type

Description

scene

String

Scene name

name

String

Application name

params

Array of params objects

Parameter list

description

String

Description of an application in a scene

Table 6 params

Parameter

Type

Description

name

String

Parameter name

type

String

Parameter type. The value range is ["string","int"]. Currently, only "string" is supported.

default_value

String

The value can be left empty or a specified value. If you left the value empty, the parameter is not nullable.

Status code: 400

Table 7 Response body parameters

Parameter

Type

Description

error_code

String

System prompt code.

  • If execution succeeds, this parameter may be left blank.
  • If execution fails, this parameter is used to display the error code.

error_msg

String

System prompt.

  • If execution succeeds, this parameter may be left blank.
  • If execution fails, this parameter is used to display the error message.

Example Request

Query the information about the application analysis capability in a scene.

GET /v2/{project_id}/graphs/scenes?scene_name=xxx&application_name=xxx&graph_id=xxx

Example Response

Status code: 200

Example response for a successful request

{
  "results" : [ {
    "name" : "movie_recommendation",
    "description": "Recommend movies that friends are interested in. Graph constraints: (user)-[friends]->(user), (user)-[rates]->(movie)",
    "params" : [ {
      "name" : "user",
      "default_value" : "",
      "type" : "string"
    } ],
    "scene" : "MovieSocialNetwork_V2"
  }, {
    "name" : "friend_recommendation",
    "description": "Recommend people who you may be interested in (considering the relationships between potential friends and movie preference). Graph constraints: (user) -[friends]-> (user), (user) -[rates]-> (movie)",
    "params" : [ {
      "name" : "user",
      "default_value" : "",
      "type" : "string"
    } ],
    "scene" : "MovieSocialNetwork_V2"
  } ]
}

Status code: 400

Example response for a failed request

{
  "error_msg" : "The request body or header is invalid.",
  "error_code" : "GES.7016"
}

Status Code

Return Value

Description

400 Bad Request

Request error

401 Unauthorized

Authorization failed

403 Forbidden

No operation permissions

404 Not Found

No resources found

500 Internal Server Error

Internal server error

503 Service Unavailable

Service unavailable

Error Code

See Error Code.