Creating Static Information for a Microservice
Function
This API is used to create static information for a microservice before registering a microservice instance. The registered instance is associated with the static information based on the serviceId field. One service corresponds to multiple instances.
The serviceId field can be customized. If serviceId is not customized, the system generates a random service ID.
URI
POST /v4/{project_id}/registry/microservices
Parameter |
Type |
Mandatory |
Description |
---|---|---|---|
project_id |
String |
Yes |
Fixed value: default. |
Request
Parameter |
Type |
Mandatory |
Description |
---|---|---|---|
service |
Object |
Yes |
Microservice struct. For details, see MicroService. |
rules |
Array of objects |
No |
Blacklist and whitelist structs. For details, see Rule. |
instances |
Array of objects |
No |
Microservice instance struct. For details, see MicroServiceInstance. |
tags |
Map<String, String> |
No |
Microservice tag. You can customize a key and value. |
Example
Example request
{ "service": { "serviceId": "string", "environment": "string", "appId": "string", "serviceName": "string", "version": "string", "description": "string", "level": "string", "registerBy": "string", "schemas": [ "string" ], "status": "UP", "timestamp": "string", "modTimestamp": "string", "framework": { "name": "string", "version": "string" }, "paths": [ { "Path": "string", "Property": { "additionalProp1": "string", "additionalProp2": "string", "additionalProp3": "string" } } ] }, "rules": [ { "ruleId": "string", "ruleType": "string", "attribute": "string", "pattern": "string", "description": "string", "timestamp": "string", "modTimestamp": "string" } ], "instances": [ { "instanceId": "string", "serviceId": "string", "version": "string", "hostName": "string", "endpoints": [ "string" ], "status": "string", "healthCheck": { "mode": "string", "port": 0, "interval": 0, "times": 0 }, "dataCenterInfo": { "name": "string", "region": "string", "availableZone": "string" }, "timestamp": "string", "modTimestamp": "string" } ], "tags": { "additionalProp1": "string", "additionalProp2": "string", "additionalProp3": "string" } }
Example response
{ "serviceId": "string" }
Status Code
See Status Codes.
Error Code
See CSE Error Codes.
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
For any further questions, feel free to contact us through the chatbot.
Chatbot