Compute
Elastic Cloud Server
Huawei Cloud Flexus
Bare Metal Server
Auto Scaling
Image Management Service
Dedicated Host
FunctionGraph
Cloud Phone Host
Huawei Cloud EulerOS
Networking
Virtual Private Cloud
Elastic IP
Elastic Load Balance
NAT Gateway
Direct Connect
Virtual Private Network
VPC Endpoint
Cloud Connect
Enterprise Router
Enterprise Switch
Global Accelerator
Management & Governance
Cloud Eye
Identity and Access Management
Cloud Trace Service
Resource Formation Service
Tag Management Service
Log Tank Service
Config
OneAccess
Resource Access Manager
Simple Message Notification
Application Performance Management
Application Operations Management
Organizations
Optimization Advisor
IAM Identity Center
Cloud Operations Center
Resource Governance Center
Migration
Server Migration Service
Object Storage Migration Service
Cloud Data Migration
Migration Center
Cloud Ecosystem
KooGallery
Partner Center
User Support
My Account
Billing Center
Cost Center
Resource Center
Enterprise Management
Service Tickets
HUAWEI CLOUD (International) FAQs
ICP Filing
Support Plans
My Credentials
Customer Operation Capabilities
Partner Support Plans
Professional Services
Analytics
MapReduce Service
Data Lake Insight
CloudTable Service
Cloud Search Service
Data Lake Visualization
Data Ingestion Service
GaussDB(DWS)
DataArts Studio
Data Lake Factory
DataArts Lake Formation
IoT
IoT Device Access
Others
Product Pricing Details
System Permissions
Console Quick Start
Common FAQs
Instructions for Associating with a HUAWEI CLOUD Partner
Message Center
Security & Compliance
Security Technologies and Applications
Web Application Firewall
Host Security Service
Cloud Firewall
SecMaster
Anti-DDoS Service
Data Encryption Workshop
Database Security Service
Cloud Bastion Host
Data Security Center
Cloud Certificate Manager
Edge Security
Situation Awareness
Managed Threat Detection
Blockchain
Blockchain Service
Web3 Node Engine Service
Media Services
Media Processing Center
Video On Demand
Live
SparkRTC
MetaStudio
Storage
Object Storage Service
Elastic Volume Service
Cloud Backup and Recovery
Storage Disaster Recovery Service
Scalable File Service Turbo
Scalable File Service
Volume Backup Service
Cloud Server Backup Service
Data Express Service
Dedicated Distributed Storage Service
Containers
Cloud Container Engine
SoftWare Repository for Container
Application Service Mesh
Ubiquitous Cloud Native Service
Cloud Container Instance
Databases
Relational Database Service
Document Database Service
Data Admin Service
Data Replication Service
GeminiDB
GaussDB
Distributed Database Middleware
Database and Application Migration UGO
TaurusDB
Middleware
Distributed Cache Service
API Gateway
Distributed Message Service for Kafka
Distributed Message Service for RabbitMQ
Distributed Message Service for RocketMQ
Cloud Service Engine
Multi-Site High Availability Service
EventGrid
Dedicated Cloud
Dedicated Computing Cluster
Business Applications
Workspace
ROMA Connect
Message & SMS
Domain Name Service
Edge Data Center Management
Meeting
AI
Face Recognition Service
Graph Engine Service
Content Moderation
Image Recognition
Optical Character Recognition
ModelArts
ImageSearch
Conversational Bot Service
Speech Interaction Service
Huawei HiLens
Video Intelligent Analysis Service
Developer Tools
SDK Developer Guide
API Request Signing Guide
Terraform
Koo Command Line Interface
Content Delivery & Edge Computing
Content Delivery Network
Intelligent EdgeFabric
CloudPond
Intelligent EdgeCloud
Solutions
SAP Cloud
High Performance Computing
Developer Services
ServiceStage
CodeArts
CodeArts PerfTest
CodeArts Req
CodeArts Pipeline
CodeArts Build
CodeArts Deploy
CodeArts Artifact
CodeArts TestPlan
CodeArts Check
CodeArts Repo
Cloud Application Engine
MacroVerse aPaaS
KooMessage
KooPhone
KooDrive

Obtaining Services

Updated on 2024-05-30 GMT+08:00

Function

This API is used to obtain model services.

Debugging

You can debug this API through automatic authentication in API Explorer or use the SDK sample code generated by API Explorer.

URI

GET /v1/{project_id}/services

Table 1 Path Parameters

Parameter

Mandatory

Type

Description

project_id

Yes

String

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

Table 2 Query Parameters

Parameter

Mandatory

Type

Description

service_id

No

String

Service ID. By default, the service ID is not filtered.

service_name

No

String

Service name. By default, the service name is not filtered.

model_id

No

String

Model ID. By default, the model ID is not filtered.

workspace_id

No

String

Workspace ID. If this parameter is not configured, only the default workspace is obtained.

infer_type

No

String

Inference mode. By default, the inference mode is not filtered. Options:

  • real-time

  • batch

  • edge

status

No

String

Service status. By default, the service status is not filtered. Options:

  • running: The service is running properly.

  • deploying: The service is being deployed, including image creation and resource scheduling deployment.

  • concerning: An alarm has been generated, indicating that some backend instances malfunction.

  • failed: Deploying the service failed. For details about the failure cause, see the event and log tab pages.

  • stopped: The service has been stopped.

  • finished: Service running is completed. This status is available only for batch services.

  • stopping: The VM is being stopped.

  • deleting: The VM is being deleted.

  • pending: to be started. This state is available only when the system is online.

  • waiting: The resource is queuing. This state is available only for online services.

offset

No

Integer

Start page for pagination display. The default value is 0.

limit

No

Integer

Maximum number of records returned on each page. Default value: 1000

sort_by

No

String

Sorting field. Enums:

  • publish_at: service publishing time, which is the default value

  • service_name: service name

  • transition_at: update time

order

No

String

Sorting order. Enums:

  • asc: ascending order

  • desc: descending order (default value)

tags

No

String

Tag. By default, tags are not filtered.

Request Parameters

Table 3 Request header parameters

Parameter

Mandatory

Type

Description

X-Auth-Token

Yes

String

User token. It can be obtained by calling the IAM API that is used to obtain a user token. The value of X-Subject-Token in the response header is the user token.

Response Parameters

Status code: 200

Table 4 Response body parameters

Parameter

Type

Description

total_count

Integer

Total number of services that meet the search criteria when no paging is performed

count

Integer

Number of services in the query result. If offset and limit are not configured, the values of count and total are the same.

services

Array of ListServices objects

Collection of obtained services

Table 5 ListServices

Parameter

Type

Description

failed_times

Long

Number of failed service calls

owner

String

User to which a service belongs

due_time

Number

Time when an online service automatically stops, in milliseconds calculated from 1970.1.1 0:0:0 UTC. This parameter is not returned if automatic stop is not configured.

finished_time

Number

Batch service completion time, in milliseconds calculated from 1970.1.1 0:0:0 UTC. This parameter is returned only when the service is a batch service.

infer_type

String

Inference mode. Options:

  • real-time

  • batch

  • edge

service_name

String

Service name

description

String

Service description

project

String

Project to which a service belongs

invocation_times

Long

Total number of service calls

publish_at

Long

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

workspace_id

String

Workspace ID

schedule

Array of Schedule objects

Service scheduling configuration. If this parameter is not configured, no value will be returned.

start_time

Number

Batch service start time, in milliseconds calculated from 1970.1.1 0:0:0 UTC. This parameter is returned only when the service is a batch service.

operation_time

Number

Operation time of a request

is_shared

Boolean

Whether a service is subscribed True indicates that the service is a subscription service.

service_id

String

Service ID

progress

Integer

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

shared_count

Number

Number of subscribed services

tenant

String

Tenant to which a service belongs

status

String

Service status. Options:

  • running: The service is running properly.

  • deploying: The service is being deployed, including image creation and resource scheduling deployment.

  • concerning: An alarm has been generated, indicating that some backend instances malfunction.

  • failed: Deploying the service failed. For details about the failure cause, see the event and log tab pages.

  • stopped: The service has been stopped.

  • finished: Service running is completed. This status is available only for batch services.

is_opened_sample_collection

String

Whether to enable data collection, which defaults to false

transition_at

Number

Time when the service status changes

is_free

Boolean

Whether a free-of-charge flavor is used

additional_properties

Map<String,String>

Additional service attribute. If this parameter is not configured, no value will be returned.

Table 6 Schedule

Parameter

Type

Description

duration

Integer

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

time_unit

String

Scheduling time unit. Possible values are DAYS, HOURS, and MINUTES.

type

String

Scheduling type. Only the value stop is supported.

Example Requests

GET https://{endpoint}/v1/{project_id}/services

Example Responses

Status code: 200

Service list

{
  "total_count" : 1,
  "count" : 1,
  "services" : [ {
    "failed_times" : 1,
    "owner" : "b575785bcece44beb23597770fb819f9",
    "infer_type" : "real-time",
    "service_name" : "mnist",
    "description" : "",
    "project" : "b575785bcece44beb23597770fb819f9",
    "invocation_times" : 50,
    "publish_at" : 1243143243,
    "workspace_id" : 0,
    "is_shared" : false,
    "service_id" : "195c1f2d-136d-40af-a0f3-db5717d2634a",
    "shared_count" : 0,
    "tenant" : "b575785bcece44beb23597770fb819f9",
    "status" : "running"
  } ]
}

Status Codes

Status Code

Description

200

Service list

Error Codes

See Error Codes.

We use cookies to improve our site and your experience. By continuing to browse our site you accept our cookie policy. Find out more

Feedback

Feedback

Feedback

0/500

Selected Content

Submit selected content with the feedback