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": "aai",
  "version": "v8",
  "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, ipandportexist 

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' or 'HTTP'String
the actual URL of the service to be registered
protocolYString
supported protocols: 'REST', 'UI', 'HTTP','TCP'
visualRangeNString1Visibility of the service. 
External(can be accessed by external systems):0 
Internal(can only be accessed by ONAP microservices):1

path

NString

Thecustomizedpublish path of this service.

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

The customized publish path should only be used for back-compatible. 

enable_sslNbooleanFalse

True if the registered service is based on https.

False if the registered service is based on http.

nodesYList
ip: the ipoftheservice 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",
"lb_policy":"ip_hash",
  "nodes": [
    {
      "ip": "10.74.55.66",
      "port": "6666",
      "ttl": 0
    },
    {
      "ip": "10.74.56.37",
      "port": "8989",
      "ttl": 0  
    },
    {
      "ip": "10.74.56.36",
      "port": "8988",
      "ttl": 0
    }
  ]
}

serviceName: service name
version: version
url: url of the created service instance
protocol: supported protocols: 'REST', 'UI','HTTP','TCP'
nodes: the service instance nodes list to register
lb_policy: Load balancing method, Currently two LB methods are supported, round-robin and ip-hash.
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


Success Code201
Error Code

422 Invalid Parameters
500 Internal Server Error

...