Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

OperationRegister service to the Microservice Bus
URL/api/microservices/v1/services
VerbPOST
Request



ParameterMandatoryParameter typeData TypeDefaultexampleDescription
BodyYBodyJSON String
{
  "serviceName": "catalog",
  "version": "v1",
  "url": "/aai/v8",
  "protocol": "REST",
  "visualRange": "1",
"path":"/aai/v8"
"nodes": [
    {
      "ip": "10.74.56.36",
      "port": "8988",
      "ttl": 0
    }
  ]
}
Described in the below table
createOrUpdateNQuerybooleantrue
true: create new instances or replace the old instances if the instance with the same service name, ipandport exist 

false: create new instances and remove all the old instances with the same service name

ParameterMandatoryData TypeDefaultDescription
serviceNameYString
Service Name
versionYString
Service Version
urlY if protocol is 'REST' or 'UI'String
the actual URL of the service to be registered
protocolYString
supported protocols: 'REST', 'UI','TCP','HTTP'
visualRangeFString1Visibility of the service. 
External(can be accessed by external systems):0 
Internal(can only be accessed by ONAP consumers):1
path
FString

The customized publish path of this service.

If path parameter is specified when registering the service, the service will be published to api gateway under this path. Otherwise, the service will be published to api gateway using a fixed format: api/{version}/{serviceName}.

nodesYList
ip: the ipofthe service instance node, it could also be a hostname like catalog.onap.org
port: the port of the service instance node
ttl: time to live, this parameter is reserved for later use



Response
exampleDescription
{
  "serviceName": "catalog",
  "version": "v1",
  "url": "/api/catalog/v1",
  "protocol": "REST",
  "visualRange": "1",
  "nodes": [
    {
      "ip": "10.74.55.66",
      "port": "6666",
      "ttl": 0,
      "expiration": "2016-02-18T16:19:40+08:00",
      "created_at": "2016-02-18T16:03:00+08:00",
      "updated_at": "2016-02-18T16:03:00+08:00"
    },
    {
      "ip": "10.74.56.37",
      "port": "8989",
      "ttl": 0,
      "expiration": "2016-02-18T16:13:00+08:00",
      "created_at": "2016-02-18T16:03:00+08:00",
      "updated_at": "2016-02-18T16:03:00+08:00"
    },
    {
      "ip": "10.74.56.36",
      "port": "8988",
      "ttl": 0,
      "expiration": "2016-02-18T17:04:36+08:00",
      "created_at": "2016-02-18T16:03:00+08:00",
      "updated_at": "2016-02-18T16:03:00+08:00"
    }
  ],
  "status": "1"
}

serviceName: service name
version: version
url: url of the created service instance
protocol: supported protocols: 'REST', 'UI'
nodes: the service instance nodes list to register
ip: the ip of the service instance node, it could also be a hostname like catalog.onap.org
port: the port of the service instance node
ttl: time to live, this parameter is reserved for later use
status: service status, 1:enabled,0:disabled

Success Code201
Error Code

415 422 Invalid Parameters
500 Internal Server Error

...

OperationUnregister service from the Microservice Bus
URL/api/microservices/v1/services/{serviceName}/version/{version}/nodes/{ip}/{port}
VerbDELETE
Request
ParameterMandatoryParameter typeData TypeDefaultexampleDescription
serviceNameYPathString

Service Name
versionNPathString

Service Version
ipNPathString

the IP address of the service instance, it could also be a hostname like catalog.onap.org
portNPathString

the port of the service instance
Response
Success Code204
Error Code

404 Can't find the service instance
415 422 Invalid Parameters
500 Internal Server Error

...

OperationQuery service from the Microservice Bus
URL/api/microservices/v1/services/{serviceName}/version/{version}
VerbGET
Request
ParameterMandatoryParameter typeData TypeDefaultexampleDescription
serviceNameNPathString

Service Name
versionNPathString

Service Version
Response
exampleDescription
{
  "serviceName": "catalog",
  "version": "v1",
  "url": "/api/catalog/v1",
  "protocol": "REST",
  "visualRange": "1",
  "nodes": [
    {
      "ip": "10.74.55.66",
      "port": "6666",
      "ttl": 0,
      "expiration": "2016-02-18T16:19:40+08:00",
      "created_at": "2016-02-18T16:03:00+08:00",
      "updated_at": "2016-02-18T16:03:00+08:00"
    },
    {
      "ip": "10.74.56.37",
      "port": "8989",
      "ttl": 0,
      "expiration": "2016-02-18T16:13:00+08:00",
      "created_at": "2016-02-18T16:03:00+08:00",
      "updated_at": "2016-02-18T16:03:00+08:00"
    },
    {
      "ip": "10.74.56.36",
      "port": "8988",
      "ttl": 0,
      "expiration": "2016-02-18T17:04:36+08:00",
      "created_at": "2016-02-18T16:03:00+08:00",
      "updated_at": "2016-02-18T16:03:00+08:00"
    }
  ],
  "status": "1"
}

serviceName: service name
version: version
url: url of the created service instance
protocol: supported protocols: 'REST', 'UI', 'TCP'
nodes: the service instance nodes list to register
ip: the ip of the service instance node, it could also be a hostname like catalog.onap.org
port: the port of the service instance node
ttl: time to live, this parameter is reserved for later use
status: service status, 1:eanbled,0:disabled

Success Code200
Error Code

404 Can't find the service instance
415 422 Invalid Parameters
500 Internal Server Error

...