Skip to main content
Matrix42 Self-Service Help Center

Rest API – Clusters

How to create, update, query and delete clusters using the FireScope REST API.

Overview

The REST API allows you to work with Clusters in FireScope SPM using a REST client in lieu of the SPM user interface.

  • Retrieve
  • Schema
  • Create or Update
  • Delete

Retrieve

To retrieve the current information about a Cluster in SPM, send unique query parameters in a GET request to the following URL:

http://localhost:38050/web_services/cluster?account=firescope&name=WebServersNote: 

Don’t forget to change the domain name (localhost) and query parameter values (account and name) to match your environment and data.A JSON response will be returned similar in structure to the payload for creation.

Query Parameter Descriptions

Parameter Description Type Required
account Name of the SPM Account. String Yes
name Name of the Cluster. String Yes

Schema

To retrieve the full SPM schema for a Cluster, send the Account name with the schema parameter set to true in a GET request to the following URL:

http://[SPM IP address]:38050/web_services/cluster?account=[Account name]&schema=true

Create or Update

To create or update an Cluster, POST a JSON document with the specific Cluster information to the following URL:

http://[SPM IP address]:38050/web_services/cluster

You can use the following example as a guide, but note that it does not include all optional properties.

{“account_id”: “firescope”,”ciid”: null,”cluster_type”: 3,”cluster_member”: [{“ciid”: null,”dns”: “web1.company.com”,”ip”: “10.0.22.158”,”port”: 80},{“ciid”: null,”dns”: “web2.company.com”,”ip”: “10.0.22.159”,”port”: 80}, {“ciid”: null,”dns”: “web3.company.com”,”ip”: “10.0.22.160”,”port”: 80}],”dns”: “web.company.com”,”ip”: “10.0.22.157”,”load_balancer_ciid”: null,”logicalgroupid”: null,”name”: “WEB VIP”,”port”: 80,”status”: 0}

Property Descriptions

The following table provides information about all required and optional properties available for a Cluster

Property Description Type Default Value Required
account_id Name of the SPM Account. String   Yes
name Name of the Cluster. String   Yes
ciid The CI associated with the Cluster.Example: {“edge_device” : “Edge 1”, “ci” : “WEB VIP”} Object   No
cluster_type A description for the purpose of this Cluster.Possible values: 0=NONE, 1=GENERIC, 2=HIGH_AVAILABILITY, 3=LOAD_BALANCER Number 3 Yes
dns The DNS of the Cluster. String   No
ip The IP of the Cluster. String   Yes
load_balancer_ciid The CI representing the load balancer for which the Cluster belongs. Specifying this field will cause all CIs that are created as the result of approving the Cluster to be created in the same Edge as the Load Balancer.Example: {“edge_device” : “Edge 1”, “ci” : “MyLB”} Object   No
logicalgroupid The LG representing this Cluster. Typically, leave this null when creating the cluster with status = 0 and then when the status is changed to 1, the LG is automatically created and assigned to this field. String   No
port The port of the Cluster. Number   No
status The status of the Cluster. Create the cluster using status = 0 and do not specify any of the ciid or logicalgroupid fields. Then when the cluster is updated with status = 1, all CIs and LGs will be created automatically and these fields will be populated. These CIs will be created in the same Edge as the load_balancer_ciid if specified. It load_balancer_ciid was not specified, an Edge will be chosen for you.Possible values: 0=PENDING, 1=APPROVED Number 0 Yes
cluster_member These fields specify the members of the Cluster:   Object[]   Yes
Property Description Type Default Value Required  
ciid The CI associated with this cluster member.Example: {“edge_device” : “Edge 1”, “ci” : “WEB1”} Object   No
dns The DNS of the cluster member. String   No
ip The IP of the cluster member. String   Yes
port The port of the cluster member. Number   No

Delete

To delete a Cluster send an HTTP DELETE request with the same query parameters as the GET request. See the Retrieve for the URL format and query parameter descriptions.

  • Was this article helpful?