Querying the Details About a Service

Function

This API is used to query the details about a model service based on the service ID.

URI

GET /v1/{project_id}/services/{service_id}

Table 1 describes the required parameters.

Table 1 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.

service_id

Yes

String

Service ID

Request Body

None

Response Body

Table 2 describes the response parameters.

Table 2 Parameters

Parameter

Type

Description

service_id

String

Service ID

service_name

String

Service name

description

String

Service description

tenant

String

Tenant to which a service belongs

project

String

Project to which a service belongs

owner

String

User to which a service belongs

publish_at

Number

Latest service release time, in milliseconds calculated from 1970.1.1 0:0:0 UTC

infer_type

String

Inference type, which can be real-time, edge, or batch

workspace_id

String

Workspace ID

cluster_id

String

ID of the dedicated resource pool used by the real-time or batch service. This parameter is available only when a dedicated resource pool is used.

vpc_id

String

ID of the VPC to which the real-time service instance belongs. This parameter is available when the network configuration is customized.

subnet_network_id

String

ID of the subnet to which the real-time service instance belongs. This parameter is available when the network configuration is customized.

security_group_id

String

Security group to which the real-time service instance belongs. This parameter is available when the network configuration is customized.

status

String

Service status, which can be running, deploying, concerning, failed, stopped, or finished

progress

Integer

Deployment progress. This parameter is available when the status is deploying.

error_msg

String

Error message. When status is failed, an error message carrying the failure cause is returned.

config

config array corresponding to infer_type

Service configuration (If a service is shared, only model_id, model_name, and model_version are returned.)

  • If infer_type is set to real-time, see Table 3.

  • If infer_type is set to batch, see Table 4.

access_address

String

Access address of an inference request. This parameter is available when infer_type is set to real-time.

bind_access_address

String

Request address of a custom domain name. This parameter is available after a domain name is bound.

invocation_times

Number

Total number of service calls

failed_times

Number

Number of failed service calls

is_shared

Boolean

Whether a service is subscribed

shared_count

Number

Number of subscribed services

schedule

schedule array

Service scheduling configuration. If this parameter is not set, no value will be returned. For details, see Table 6.

update_time

Number

Time when the configuration used by a service is updated, in milliseconds calculated from 1970.1.1 0:0:0 UTC

debug_url

String

Online debugging address of a real-time service. This parameter is available only when the model supports online debugging and there is only one instance.

due_time

number

Time when a real-time service automatically stops, in milliseconds calculated from 1970.1.1 0:0:0 UTC

operation_time

number

Operation time of a request

transition_at

number

Time when the service status changes

is_free

Boolean

Whether a free-of-charge flavor is used

additional_properties

Map<String, Object>

Additional service attribute

Table 3 config parameters of real-time

Parameter

Type

Description

model_id

String

Model ID

model_name

String

Model name

model_version

String

Model version

source_type

String

Model source. This parameter is returned when a model is created through ExeML. The value is auto.

status

String

Model status. Options:

  • ready: ready (All instances have been started.)

  • concerning: partially ready (Some instances are started and some are not.)

  • notReady: not ready (All instances are not started.)

weight

Integer

Traffic weight allocated to a model

specification

String

Resource flavor. Options: modelarts.vm.gpu.v100 and modelarts.vm.cpu.2u To use other flavors, contact the system administrator.

custom_spec

Object

Custom For details, see Table 7.

envs

Map<String, String>

(Optional) Environment variable key-value pair required for running a model

To ensure data security, do not enter sensitive information, such as plaintext passwords, in environment variables.

instance_count

Integer

Number of instances deployed in a model

scaling

Boolean

Whether auto scaling is enabled

cluster_id

String

ID of a dedicated resource pool used by a service instance. This parameter is returned only when a dedicated resource pool is configured.

support_debug

Boolean

Whether a model supports online debugging

additional_properties

Map<String, Object>

Additional model deployment attribute

Table 4 config parameters of batch

Parameter

Type

Description

model_id

String

Model ID

model_name

String

Model name

model_version

String

Model version

specification

String

Resource flavor. Options: modelarts.vm.gpu.v100 and modelarts.vm.cpu.2u To use other flavors, contact the system administrator

custom_spec

Object

Custom For details, see Table 7.

envs

Map<String, String>

(Optional) Environment variable key-value pair required for running a model

To ensure data security, do not enter sensitive information, such as plaintext passwords, in environment variables.

instance_count

Integer

Number of instances deployed in a model

src_type

String

Data source type. This parameter is returned only when ManifestFile is specified.

src_path

String

OBS path of the input data of a batch job

dest_path

String

OBS path of the output data of a batch job

req_uri

String

Inference path of a batch job

mapping_type

String

Mapping type of the input data. The value can be file or csv.

mapping_rule

Map

Mapping between input parameters and CSV data. This parameter is mandatory only when mapping_type is set to csv.

start_time

Number

Task start time, in milliseconds calculated from 1970.1.1 0:0:0 UTC. This parameter is not returned until the task starts.

finished_time

Number

Task finished time, in milliseconds calculated from 1970.1.1 0:0:0 UTC. This parameter is not returned until the task ends.

Table 5 node parameters

Parameter

Type

Description

id

String

Node ID

name

String

Node name

instance_status

String

Status of a model instance on a node. The value can be running, stopped, notReady, or failed.

predict_url

String

Inference URL of a node

node_label

String

Node label

description

String

Description

host_name

String

Host name of a node

os_name

String

OS name

os_type

String

OS type

os_version

String

OS version

arch

String

Node architecture

cpu

Integer

Number of CPUs

memory

Integer

Memory size, in MB

gpu_num

Integer

Number of GPUs

enable_gpu

String

Whether to enable the GPU

host_ips

String array

Host IP of a node

deployment_num

Integer

Number of application instances deployed on a node

state

String

Host status. Options:

  • RUNNING: running

  • FAIL: faulty

  • UNCONNECTED: disconnected

created_at

String

Creation time, in the format of YYYY-MM-DDThh:mm:ss (UTC)

updated_at

String

Update time, in the format of YYYY-MM-DDThh:mm:ss (UTC)

Table 6 schedule parameters

Parameter

Type

Description

type

String

Scheduling type. Only the value stop is supported.

time_unit

String

Scheduling time unit. Options:

  • DAYS

  • HOURS

  • MINUTES

duration

Integer

Value that maps to the time unit. For example, if the task stops after two hours, set time_unit to HOURS and duration to 2.

Table 7 custom_spec parameters

Parameter

Type

Description

cpu

Float

Number of CPUs

memory

Integer

Memory capacity in MB

gpu_p4

Float

Number of GPUs

Samples

The following shows how to query the details about a real-time service based on the service ID.

  • Sample request

    GET    https://endpoint/v1/{project_id}/services/{service_id}
    
  • Sample response

    {
        "service_id": "f76f20ba-78f5-44e8-893a-37c8c600c02f",
        "service_name": "service-demo",
        "tenant": "xxxxx",
        "project": "xxxxx",
        "owner": "xxxxx",
        "publish_at": 1585809231902,
        "update_time": 1585809358259,
        "infer_type": "real-time",
        "status": "running",
        "progress": 100,
        "access_address": "https://xxxxx.apigw.xxxxx/v1/infers/088458d9-5755-4110-97d8-1d21065ea10b/f76f20ba-78f5-44e8-893a-37c8c600c02f",
        "cluster_id": "088458d9-5755-4110-97d8-1d21065ea10b",
        "workspace_id": "0",
        "additional_properties": {},
        "is_shared": false,
        "invocation_times": 0,
        "failed_times": 0,
        "shared_count": 0,
        "operation_time": 1586249085447,
        "config": [{
            "model_id": "044ebf3d-8bf4-48df-bf40-bad0e664c1e2",
            "model_name": "jar-model",
            "model_version": "1.0.1",
            "specification": "custom",
            "custom_spec": {},
            "status": "notReady",
            "weight": 100,
            "instance_count": 1,
            "scaling": false,
            "envs": {},
            "additional_properties": {},
            "support_debug": false
        }],
        "transition_at": 1585809231902,
        "is_free": false
    }
    

Status Code

For details about the status code, see Table 1.

Error Codes

See Error Codes.