Creating a Dependency Between Services
Function
This API is used to create a dependency between services. For consumer, version must be a confirmed version and serviceName cannot be *. consumer must be an existing service while provider can be a service that has not been created.
Call Method
See "Microservice Management" in API Calling.
URI
PUT /v4/{project_id}/registry/dependencies
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
project_id |
Yes |
String |
Fixed value: default. |
Request
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
Authorization |
Yes |
String |
This parameter is mandatory if security authentication is enabled for an exclusive microservice engine. Otherwise, this parameter is not required. The token of an exclusive microservice 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 Microservice Engine. |
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
dependencies |
Yes |
Arrayof objects |
Set of rules. See Table 4. The array can contain 1–100 objects. |
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
consumer |
Yes |
Object |
Consumer microservice. See DependencyMicroService. |
providers |
No |
Array of objects |
Provider microservice. See DependencyMicroService. |
Response
None
Example Request
{ "dependencies": [ { "consumer": { "environment": "", "appId": "default", "serviceName": "test1", "version": "1.0.0" }, "providers": [ { "environment": "", "appId": "default", "serviceName": "test", "version": "1.0.0" } ] } ] }
Example Response
None
Status Code
See Status Codes.
Error Code
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