POST /api/topology/services/{groupID}/withcert

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.


The certificates for the new instance or Node Manager are passed to this method. The certificate has been signed either by 1) an Admin Node Manager with the domain private key, or, 2) managedomain using a user-provided domain private key, or 3) an external CA that was sent the CSR (Certificate Sign Request) generated in a previous API call.


Resource URL

https://localhost:8090/api/topology/services/{groupID}/withcert?certificate=—–BEGIN+CERTIFICATE—–%0AMIIDKDC…


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.
certificate mandatory The signing algorithm. Defaults to sha1.
keyPassphrase optional Passphrase used to decrypt the instance's private key file that was generated when the CSR was created.
passphrase optional If an instance group 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 required in the request body, it is created when the CSR is generated. Refer to Javadoc for com.vordel.api.topology.model.Service.

Response Codes

Response Code Description
201 Success. The response body contains the created service.
400 The response contains an error e.g.:-
  • An attempt was made to create a service that already exists.
  • An attempt is made to create a service on an unregistered host.
  • An attempt is made to create a service in a group that does not exist.
  • An attempt is made to create a service with invalid data.
  • An attempt is made to add a service that uses the same management port as another service on the same host.
  • An attempt is made to add a service that has a services port that is the same as a management port of another service on the same host.
  • An attempt is made to add a service where the management and services ports are the same.
  • An attempt is made to add a service of a type that differs to other processes in the group.
  • An attempt is made to add a service where the service name is invalid, illegal characters include '/', '`', '?', '*', '', '<', '>', '|', '"', ':'.
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}/withcert?certificate=-----BEGIN+CERTIFICATE-----%0AMIIDKDC...&certificate=-----BEGIN+CERTIFICATE-----%0AMIICxDCC...&servicesPort=8080

{
  "service": {
    "name": "APIGateway1",
    "type": "gateway",
    "scheme": "https",
    "hostID": "host-1",
    "managementPort": 8085,
    "tags": {

    },
    "enabled": true
  },
  "keyPassphrase": "pass1"
}   

HTTP 1.1 201 Created

{
    "result": {
        "id": "instance-1",
        "name": "APIServer1",
        "type": "gateway",
        "scheme": "https",
        "hostID": "host-1",
        "managementPort": 8085,
        "tags": {},
        "enabled": true
    }
}