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

Obtaining Service Details

Function

This API is used to obtain service details.

URI

GET /v2/{project_id}/algorithm/services/{service_id}

Table 1 Path Parameters

Parameter

Mandatory

Type

Description

project_id

Yes

String

Project ID. For details, see Obtaining a Project ID and Name.

service_id

Yes

String

Service ID

Request Parameters

Table 2 Request header parameters

Parameter

Mandatory

Type

Description

X-Auth-Token

Yes

String

User token. For details about how to obtain a user token, see Authentication.

Response Parameters

Status code: 200

Table 3 Response body parameters

Parameter

Type

Description

service_id

String

Service ID

service_name

String

Service name

logo

String

Algorithm logo, which is a Base64-encoded string. This parameter is returned when it is not empty.

function_version

String

Service version

release_flag

Boolean

Whether the service has been released. The value can be true or false.

description

String

Algorithm description. This parameter is returned when it is not empty.

created_at

Long

Creation time

updated_at

Long

Update time

release_at

Long

Release time

api

String

API

pool_id

String

Resource pool ID

alg_name

String

Algorithm name

alg_id

String

Algorithm ID

request_mode

String

Request mode. The value can be sync or async.

package_name

String

Algorithm package name

package_id

String

Algorithm package ID

alg_version

String

Algorithm version

alg_versions

Array of strings

Algorithm versions

diagram

String

Algorithm scenario diagram, which is a Base64-encoded string. This parameter is returned when it is not empty.

service_api_list

Array of ServiceApiDto objects

Service API list

deployment_constraints

DeploymentConstraintsDto object

Model deployment constraints

company

String

Vendor name

tags

Array of strings

Application scenario tag

deploy_type

String

Deployment type. The value can be cloud or edge.

alg_class

String

Algorithm type. The value can be self or partner.

alg_status

String

Algorithm status. The value can be service_running, service_deploying, service_failed, service_stopping, service_stopped, service_upgrading, service_finished, service_concerning or "not_deployed".

error_msg

String

Service exception information. This parameter is returned when it is not empty.

Table 4 ServiceApiDto

Parameter

Type

Description

request_type

String

Request type, which can be get or post.

zh

String

Description (CN)

en

String

Description

request_url

String

Request URL

Table 5 DeploymentConstraintsDto

Parameter

Type

Description

request_mode

String

Request mode. The value can be sync or async.

cpu_type

String

CPU type. The value can be x86_64 or aarch64.

accelerators

Array of AcceleratorsDto objects

Inference accelerator

input_types

Array of strings

Supported input type. The value can be OBS, URL, Restful, VCN, or EdgeCamera.

output_types

Array of strings

Supported output type. The value can be OBS, DIS, or Webhook.

service_config

String

Service startup parameters

task_config

String

Task configuration parameters

Table 6 AcceleratorsDto

Parameter

Type

Description

type

String

Accelerator card type

Minimum: 1

Maximum: 256

name

String

Accelerator card name

Minimum: 1

Maximum: 256

cuda_version

String

CUDA version

Minimum: 1

Maximum: 256

driver_version_section

String

Ascend driver version

Minimum: 1

Maximum: 256

Example Requests

This request is used to obtain service details.

GET https://{endpoint}/v2/{project_id/algorithm/services/331bcb4a-5b3c-4e67-87cc-6c******d77b

Example Responses

Status code: 200

Response body for obtaining service details

{
  "service_id" : "331bcb4a-5b3c-4e67-87cc-6c******d77b",
  "service_name" : "Edge Intrusion Detection",
  "logo" : "data:image/png;base64,xxxxxx",
  "function_version" : "1.0",
  "release_flag" : true,
  "created_at" : 1680008856502,
  "updated_at" : 1680004378199,
  "release_at" : 1680004378199,
  "api" : "c-int******ion-edge",
  "pool_id" : "ed9f128bf7d04f5683f0ef******a255",
  "alg_name" : "Edge Intrusion Detection",
  "alg_id" : "068ed4d8-077e-4ec9-aa19-bc******e925",
  "package_id" : "9a2423e3-02d3-4305-b491-d6******51bd",
  "alg_version" : "1.0.1",
  "alg_versions" : [ ],
  "diagram" : "data:image/png;base64,xxxxxx",
  "service_api_list" : [ {
    "request_type" : "POST",
    "zh" : "Creating a Task",
    "en" : "create task",
    "request_url" : "/v2/41be0da3412b4a569409dcec43983908/services/c-int******ion-edge/tasks"
  }, {
    "request_type" : "GET",
    "zh" : "Task details",
    "en" : "task detail",
    "request_url" : "/v2/41be0da3412b4a569409dcec43983908/tasks/{task_id}"
  }, {
    "request_type" : "GET",
    "zh" : "Task list",
    "en" : "task list",
    "request_url" : "/v2/41be0da3412b4a569409dcec43983908/tasks"
  }, {
    "request_type" : "DELETE",
    "zh" : "Deleting a Task",
    "en" : "delete task",
    "request_url" : "/v2/41be0da3412b4a569409dcec43983908/tasks/{task_id}"
  }, {
    "request_type" : "PUT",
    "zh" : "Starting a task",
    "en" : "start task",
    "request_url" : "/v2/41be0da3412b4a569409dcec43983908/tasks/{task_id}/action/start"
  }, {
    "request_type" : "PUT",
    "zh" : "Stopping a task",
    "en" : "stop task",
    "request_url" : "/v2/41be0da3412b4a569409dcec43983908/tasks/{task_id}/action/stop"
  } ],
  "deployment_constraints" : {
    "request_mode" : "async",
    "cpu_type" : "x86_64",
    "accelerators" : [ {
      "type" : "gp",
      "name" : "Tnt004",
      "cuda_version" : "cuda 10.2"
    } ],
    "input_types" : [ "Restful", "VCN", "EdgeCamera" ],
    "output_types" : [ "Webhook" ],
    "service_config" : "<?xml version=\"1.0\" encoding=\"UTF-8\"?><algorithm><deployConfig> <param name=\"sub_scene\" titleCn=\"Sub scenario\" titleEn=\"sub scene\" required=\"false\" type=\"String\" default=\"common\"/></deployConfig></algorithm>",
    "task_config" : "<algorithm><config><common/></config></algorithm>"
  },
  "alg_scene" : "other",
  "deploy_type" : "edge"
}

Status Codes

Status Code

Description

200

Response body for obtaining service details

400

Request error

500

Internal error

Error Codes

See Error Codes.