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
On this page

Obtaining Services

Updated on 2024-03-21 GMT+08:00

Obtain the service list of a user.

Sample Code

In ModelArts notebook, you do not need to enter authentication parameters for session authentication. For details about session authentication of other development environments, see Session Authentication.

  • Scenario 1: Obtain all services of a user.
    1
    2
    3
    4
    5
    6
    from modelarts.session import Session 
    from modelarts.model import Predictor 
    
    session = Session() 
    predictor_list = Predictor.get_service_list(session)
    print(predictor_list)
    
  • Scenario 2: Obtain the services of a user based on search criteria.
    1
    2
    3
    4
    5
    6
    from modelarts.session import Session 
    from modelarts.model import Predictor 
    
    session = Session()
    predictor_list = Predictor.get_service_list(session, service_name="digit", order="asc", offset="0", infer_type="real-time")
    print(predictor_list)
    

Parameters

Table 1 Query parameters

Parameter

Mandatory

Type

Description

session

Yes

Object

Session object. For details about the initialization method, see Session Authentication.

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.

infer_type

No

String

Inference mode. The value can be real-time or batch. By default, this parameter is left blank.

offset

No

Integer

Start page of the paging list. Default value: 0

limit

No

Integer

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

service_status

No

String

Service status. By default, the service status is not filtered. The service list can be queried based on the service status. Possible values are as follows:

  • running: The service is running properly and is being billed.
  • deploying: The service is being deployed or scheduling resources are being deployed.
  • concerning: An alarm is generated, indicating that the backend instance is abnormal and may be billed. For example, in the case of multiple instances, some instances are normal, but some are not. A normal instance is billed but is in the concerning status.
  • failed: The service fails to be deployed. For details about the failure cause, see the event and log.
  • stopped: The service has been stopped.
  • finished: This status is displayed only for the batch service, indicating that the service running is completed.

sort_by

No

String

Sorting mode. The value can be publish_at or service_name. Default value: publish_at

order

No

String

Sorting order. The value can be asc or desc, indicating the ascending or descending order. Default value: desc

model_id

No

String

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

Table 2 get_service_list response parameters

Parameter

Type

Description

total_count

Integer

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

count

Integer

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

services

service array

Collection of the queried services

Table 3 service parameters

Parameter

Type

Description

service_id

String

Service ID

service_name

String

Service name

description

String

Service description

tenant

String

Tenant to whom a service belongs

project

String

Project to which a service belongs

owner

String

User to whom a service belongs

publish_at

Number

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

infer_type

String

Inference mode. The value can be real-time or batch.

status

String

Service status. The value can be running, deploying, concerning, failed, stopped, or finished.

progress

Integer

Deployment progress. This parameter is returned when status is deploying.

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 subscriptions

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