Bu sayfa henüz yerel dilinizde mevcut değildir. Daha fazla dil seçeneği eklemek için yoğun bir şekilde çalışıyoruz. Desteğiniz için teşekkür ederiz.

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
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
Help Center/ Cloud Service Engine/ API Reference/ ServiceComb API/ Microservice Instance/ Querying a Microservice Instance Based on service_id

Querying a Microservice Instance Based on service_id

Updated on 2023-11-08 GMT+08:00

Function

This API is used to query all instances of a microservice based on service_id after the instances are registered.

URI

GET /v4/{project_id}/registry/microservices/{service_id}/instances

Table 1 Path parameters

Parameter

Mandatory

Type

Description

project_id

Yes

String

Fixed value: default.

service_id

Yes

String

Microservice ID, which must be unique. The value contains 1 to 64 characters. Regular expression: ^.*$. See Querying Information About All Microservices.

Table 2 Query parameter

Parameter

Mandatory

Type

Description

tags

No

String

Tag. When there are multiple tags, separate them using commas (,). Regular expression: ^[a-zA-Z][a-zA-Z0-9_-.]{0,63}$

Request

Table 3 Request header parameters

Parameter

Mandatory

Type

Description

X-ConsumerId

No

String

Microservice consumer ID, which must be unique.

Authorization

No

String

This parameter is mandatory if security authentication is enabled for an exclusive ServiceComb engine. Otherwise, this parameter is not required.

The token of an exclusive ServiceComb engine with security authentication enabled is in the following format:

Authorization:Bearer {Token}

For details about how to obtain the token, see Obtaining the User Token of an Exclusive ServiceComb Engine.

Response

Status code: 200

Table 4 Response body parameter

Parameter

Type

Description

instances

Array of MicroServiceInstance objects

Instance list.

Table 5 MicroServiceInstance

Parameter

Type

Description

instanceId

String

Instance ID, which must be unique. The instance ID is generated by the service center.

serviceId

String

Microservice ID, which must be unique. During instance creation, use the microservice ID in the URL instead of the microservice ID specified here.

version

String

Microservice version.

hostName

String

Host information.

endpoints

Array of strings

Access address information.

status

String

Instance status. Value: UP, DOWN, STARTING, or OUTOFSERVICE. Default value: UP.

properties

Object

Extended attribute. You can customize a key and value. The value must be at least 1 byte long.

healthCheck

HealthCheck object

Health check information.

dataCenterInfo

DataCenterInfo object

Data center information.

timestamp

String

Time when an instance is created, which is automatically generated.

modTimestamp

String

Update time.

Table 6 HealthCheck

Parameter

Type

Description

mode

String

Heartbeat mode. Value: push or pull.

port

Integer

Port.

interval

Integer

Heartbeat interval. Unit: s. If the value is less than 5s, the registration is performed at an interval of 5s.

times

Integer

Maximum retries.

Table 7 DataCenterInfo

Parameter

Type

Description

name

String

Region name.

region

String

Region.

availableZone

String

AZ.

Status code: 400

Table 8 Response body parameters

Parameter

Type

Description

errorCode

String

Error code.

errorMessage

String

Error message.

detail

String

Location details.

Status code: 500

Table 9 Response body parameters

Parameter

Type

Description

errorCode

String

Error code.

errorMessage

String

Error message.

detail

String

Location details.

Example Request

Query instance information about a microservice with specified service_id.

GET https://{endpoint}/v4/{project_id}/registry/microservices/{service_id}/instances

Example Response

Status code: 200

Successfully queried.

{
    "instances": [
        {
            "instanceId": "8540bb8b693c4ad1a7fb6a756c415244",
            "serviceId": "8aed80ea052ac04a64dfc79c24f2170224d074f5",
            "endpoints": [
                "rest:127.0.0.1:8080"
            ],
            "hostName": "hostNameTest",
            "status": "UP",
            "properties": {
                "engineID": "30c263e5-2eac-4da1-9c72-5abb9ac94550",
                "engineName": "cse-fkln1-HA"
            },
            "healthCheck": {
                "mode": "push",
                "interval": 30,
                "times": 3
            },
            "timestamp": "1650545035",
            "modTimestamp": "1650545035",
            "version": "1.0.0"
        }
    ]
}

Status Code

Status Code

Description

200

OK

400

Bad Request

500

Internal Server Error

Error Code

See ServiceComb Error Codes.

Sitemizi ve deneyiminizi iyileştirmek için çerezleri kullanırız. Sitemizde tarama yapmaya devam ederek çerez politikamızı kabul etmiş olursunuz. Daha fazla bilgi edinin

Feedback

Feedback

Feedback

0/500

Selected Content

Submit selected content with the feedback