Instance Management APIs

Register a new instance to Broker Service

This API accepts requests to register an instance.

Note: Note: The broker service does not verify the health status of the instance during registration. It verifies the health status during the next status verification cycle.

Method: HTTP POST

Endpoint: http://<host_address>:<port_address>/v1/instance/register

Example:

{
  "instanceId": "string",
  "serviceName": "string",
  "ipAddress": "string",
  "port": 0
}

Instance Ping Operation

At regular intervals, the instance computes its status and sends a ping to the Broker service. Based on the status, the broker might initiate the transfer of order messages to another instance.

Method: HTTP POST

Endpoint: http://<host_address>:<port_address>/v1/instance/ping

Example:

{
  "instanceId": "string",
  "status": "string",
  "inactiveComponentList": [
    "string"
  ]
}

Instance Clean Up Operations

This API accepts a list of instance IDs. It then purges instances from the database whose status is down. If an instance is still up while this operation is being performed, the Broker does not purge that instance.

Method: HTTP POST

Endpoint: http://<host_address>:<port_address>/v1/instance/cleanup

Example:

[
  "string"
]

Get Instance Details by Service Name

Given a service name, this operation returns all details of instances associated with that service name.

Method: HTTP GET

Endpoint: http://<host_address>:<port_address>/v1/instance

Parameters
Name Type Value
serviceName (mandatory) string Name of the service
pageNo (mandatory) integer Page number

instancePerPage (mandatory)

integer Instance per page

Example:

{
  "instanceDetailsList": [
    {
      "instanceId": "string",
      "serviceName": "string",
      "ipAddress": "string",
      "port": 0,
      "status": "string"
    }
  ],
  "totalPages": 0,
  "currentPage": 0,
  "instancesPerPage": 0
}

Get Instance Details by Instance Id

Given an instance ID, this operation returns the details of that instance.

Method: HTTP GET

Endpoint: http://<host_address>:<port_address>/v1/instance/{instanceId}

Parameters
Name Type Value

instanceId (mandatory)

string Id of the instance

Example:

{
  "instanceId": "string",
  "serviceName": "string",
  "ipAddress": "string",
  "port": 0,
  "status": "string"
}

Get All Available Services

This operation returns all service names available with the Broker Service.

Method: HTTP GET

Endpoint: http://<host_address>:<port_address>/v1/instance/services

Example:

[
  "string"
]

Get All Instance Details

This operation returns all details of instances available with the Broker service.

Method: HTTP GET

Endpoint: http://<host_address>:<port_address>/v1/instance/all

Parameters
Name Type Value
pageNo (mandatory) integer Page number

instancePerPage (mandatory)

integer Instance per page

Example:

{
  "instanceDetailsList": [
    {
      "instanceId": "string",
      "serviceName": "string",
      "ipAddress": "string",
      "port": 0,
      "status": "string"
    }
  ],
  "totalPages": 0,
  "currentPage": 0,
  "instancesPerPage": 0
}

Unregister an instance from Broker Service

This asynchronous operation unregisters the instance from the Broker service.

The unregistration operation does not immediately delete the instance. Instead, it attempts to validate whether the instance is down by verifying its health status.

The operation performs this validation several times. If the instance is not down, it does not get purged. However, if the instance goes down during this process, it is purged from the database.

Method: HTTP DELETE

Endpoint: http://<host_address>:<port_address>/v1/instance/un-register/{instanceId}

Parameters
Name Type Value

instanceId (mandatory)

string Id of the instance