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
- Log in to ServiceStage and choose Cloud Service Engine > Engines.
- Select the target microservice engine from the Microservice Engine drop-down list in the upper part of the page.
- In the Service Discovery and Configuration area, view or click to copy the service center address.
- Call the API by referring to Calling APIs. In Request URI, replace {Endpoint} with the obtained service center address.
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
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