POST /api/topology/services/{groupID}
Description
This method adds a service to the Topology. A service is an API Server instance, or Node Manager.
When a new API Server instance is added, new files will be created on disk for the new instance.
Resource URL
https://localhost:8090/api/topology/services/{groupID}
https://localhost:8090/api/topology/services/{groupID}?servicesPort=8087
Parameters
groupID | mandatory | The group into which the new service must be placed. |
servicesPort | optional | The business services port. This is required when creating a new API Server instance on disk so that the envSettings.props may be updated appropriately. Defaults to 8080. |
signAlg | optional | The signing algorithm. Defaults to sha1. |
keyPassphrase | optional | Passphrase used to encrypt the instance's private key file that is generated. The private key resides on disk temporarily until the signed certificate is generated. The private key will only reside on disk for milliseconds when this method is used. |
domainPassphrase | optional | Passphrase used to unlock the domain private key so that it may be used to sign the SSL certificate for the service. |
passphrase | optional | If a group of instances has their entity store passphrase set to "(prompt)" it must be passed here when a new instance is added to that group to ensure certs.xml is encrypted using the appropriate key. |
service | mandatory | The new service to be created. This is passed in the request body. The id field is not required in the request body. Refer to Javadoc for com.vordel.api.topology.model.Service . |
Response Codes
Response Code | Description |
---|---|
201 | Success. The response body contains the created service. The id will be set. |
400 | The response contains an error e.g.:-
|
500 | The response contains an error e.g. a failure occurred when propagating this topology update to other Node Managers. |
Example Request and Response
POST https://localhost:8090/api/topology/services/{groupID}
{
"service": {
"name": "APIGateway1",
"type": "gateway",
"scheme": "https",
"hostID": "host-1",
"managementPort": 8085,
"tags": {
},
"enabled": true
},
"domainPassphrase": "fred"
}
HTTP 1.1 201 Created
{
"result": {
"id": "instance-1",
"name": "APIServer1",
"type": "gateway",
"scheme": "https",
"hostID": "host-1",
"managementPort": 8085,
"tags": {},
"enabled": true
}
}