REST Endpoints

Some REST endpoints are available for basic connection management. The plugin mounts all endpoints at the following location: http://localhost:8980/opennms/rest/plugin/velocloud/.

The Content-Type of the request and response is application/json.

Endpoints

GETs (retrieving data)

Resource Description

/plugin/velocloud/connections

Returns the list of configured connections.

/plugin/velocloud/connections/{alias}

Validates a configured connection.

/plugin/velocloud/partner/{alias}/customers

Returns the associated customers for a configured partner connection.

POSTs (adding data)

Resource Description Query Options

/plugin/velocloud/connections

Validates the incoming credentials and saves the valid connection to SCV. Input requires alias, orchestratorUrl, and apiKey in JSON format.

dryrun - Do not save the connection.

force - Do not validate the connection.

PUTs (modifying data)

Resource Description Query Options

/plugin/velocloud/connections/{alias}

Edit an existing connection. Input requires alias, orchestratorUrl, and apiKey in JSON format.

force - Do not validate the connection.

DELETE (deleting data)

Resource Description

/plugin/velocloud/connections/{alias}

Delete an existing connection with specified alias.

Examples

Retrieve customers for a given partner connection

Request
curl -X GET -u admin:admin http://localhost:8980/opennms/rest/plugin/velocloud/partner/aPartnerAlias/customers
Response
[
  {
    "enterpriseId": "78a92010-9085-4d9c-9537-92eab2522697",
    "id": 342,
    "networkId": 1,
    "gatewayPoolId": 2,
    "bastionState": "UNCONFIGURED",
    "alertsEnabled": true,
    "operatorAlertsEnabled": true,
    "name": "RALEIGH_LAB",
    "domain": "rdulab",
    "accountNumber": "RDU-foo",
    "description": "",
    "address": "PO Box 362",
    "city": "Apex",
    "state": "North Carolina",
    "zip": "27502",
    "country": "US",
    "latitude": 35.770000,
    "longitude": -78.640000,
    "timezone": "America/New_York",
    "locale": "en-US"
  },
  {
    "enterpriseId": "f9adcb3e-21be-451d-997f-fd21e429129c",
    "id": 213,
    "networkId": 1,
    "gatewayPoolId": 2,
    "bastionState": "UNCONFIGURED",
    "alertsEnabled": true,
    "operatorAlertsEnabled": true,
    "name": "OTTAWA_LAB",
    "domain": "yowlab",
    "accountNumber": "YOW-bar",
    "description": "",
    "address": "300 March Rd, Suite 600",
    "city": "Kanata",
    "state": "Ontario",
    "zip": "K2K 2E2",
    "country": "CA",
    "latitude": 45.300000,
    "longitude": -75.916000,
    "timezone": "America/Toronto",
    "locale": "en-US"
  }
]

Retrieve a list of configured connections

Request
curl -u admin:admin http://localhost:8980/opennms/rest/plugin/velocloud/connections
Response
[
  {
    "alias": "aPartnerAlias",
    "orchestratorUrl": "https://something-somewhere.velocloud.net/"
  },
  {
    "alias": "aCustomerAlias",
    "orchestratorUrl": "https://something-somewhere.velocloud.net/"
  }
]

Add a new connection

Request
curl -H "Content-type: application/json" -X POST -u admin:admin http://localhost:8980/opennms/rest/plugin/velocloud/connections --data '{"alias":"anotherAlias","orchestratorUrl":"https://something-somewhere.velocloud.net","apiKey":"juKdsndSJnsjsdH3KnedejS3kNk3mndsfks3.sad8asdkhasd8asdSDSDFhkasd8asdhasd7k32l32kKkjbsdNS01ZGRhNGRlNGU2N2IiLCJleHAiOjE2OTY1NDExODYwMDAsInV1aWQiOiJV1aWQiOiI0MDUwMDJiNS01YjQ4sInR5cCI6IkpXVCQ3OTYtOWRiOS03NmRhODUxMGMyYjEiLCJOjE2OTY1NDExODYwMDAsInV1aWQiOdsJdsSjkSDlJLJ"}'
Response
Connection successfully added

Update a connection

Request
curl -H "Content-type: application/json" -X PUT -u admin:admin http://localhost:8980/opennms/rest/plugin/velocloud/connections/anotherAlias --data '{"orchestratorUrl":"https://something-somewhere.velocloud.net","apiKey":"juKdsndSJnsjsdH3KnedejS3kNk3mndsfks3.sad8asdkhasd8asdSDSDFhkasd8asdhasd7k32l32kKkjbsdNS01ZGRhNGRlNGU2N2IiLCJleHAiOjE2OTY1NDExODYwMDAsInV1aWQiOiJV1aWQiOiI0MDUwMDJiNS01YjQ4sInR5cCI6IkpXVCQ3OTYtOWRiOS03NmRhODUxMGMyYjEiLCJOjE2OTY1NDExODYwMDAsInV1aWQiOdsJdsSjkSDlJLJ"}'
Response
Connection successfully updated

Validate a configured connection

Request
curl -X GET -u admin:admin http://localhost:8980/opennms/rest/plugin/velocloud/connections/anotherAlias
Response
{
"alias": "anotherAlias",
"orchestratorUrl": "https://something-somewhere.velocloud.net",
"valid": true
}