Help Center/ ServiceStage/ API Reference (ME-Abu Dhabi Region)/ CSE API/ Creating a Dependency Between Services
Updated on 2023-06-25 GMT+08:00

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.

URI

PUT /v4/{project_id}/registry/dependencies

Table 1 Path parameters

Parameter

Type

Mandatory

Description

project_id

String

Yes

Fixed value: default.

Request

Table 2 Request body parameters

Parameter

Type

Mandatory

Description

dependencies

Array of objects

Yes

Set of rules. See Table 3. The array can contain 1–100 objects.

Table 3 MicroServiceDependency parameters

Parameter

Type

Mandatory

Description

consumer

Object

Yes

Consumer microservice. For details, see DependencyMicroService.

providers

Array of objects

No

Provider microservice. For details, see DependencyMicroService.

Response

Response parameters

None

Example

Example request

{
  "dependencies": [
    {
      "consumer": {
        "environment": "string",
        "appId": "string",
        "serviceName": "string",
        "version": "string"
      },
      "providers": [
        {
          "environment": "string",
          "appId": "string",
          "serviceName": "string",
          "version": "string"
        }
      ]
    }
  ]
}

Example response

None

Status Code

See Status Codes.

Error Code

See CSE Error Codes.