The Bare Metal Cloud (BMC) Rancher Solution API provisions both management (upstream) and workload (downstream) clusters in a single POST request.
You provide the parameters for a workload cluster in the request body. The workload cluster does not have to be in the same location as the management cluster, and the servers of both clusters do not need to be the same type.
The API requests in this guide are relative to:
https://api.phoenixnap.com/solutions/rancher/v1betaCode language: HTTP (http)
Prerequisites
BMC API access token with the bmc scope (see API credentials).
Create a Management and a Workload Cluster
To provision a management cluster ,send a POST request to:
POST /clustersCode language: HTTP (http)
The only required property is location. To provision a workload cluster in the same request, add the WorkloadClusterConfig property in the request body. Its required property is also location, while name, serverCount, and serverType are optional.
For example:
{
"name": "my-rancher-cluster",
"description": "Deployment of management and workload cluster",
"location": "PHX",
"workloadConfiguration": {
"name": "my-workload-cluster",
"location": "ASH",
"serverCount": 3,
"serverType": "s1.c1.medium"
}
}Code language: JSON / JSON with Comments (json)
The example provisions a management cluster in Phoenix. The workload cluster is in Ashburn, with three s1.c1.medium servers.
Warning
Note the password for the Rancher administrative account. You cannot access the password later.
Once the cluster is provisioned, use the information from the response body to access the Rancher UI. The URL, username, and password are in the metadata category.
Find out more
Identify Rancher Servers
The system assigns a tag to each server during Rancher cluster provisioning. Server tags show whether a server belongs to a Rancher management cluster or a workload cluster.
Example: Tag in a management cluster
{
"id": "[SERVER_ID]",
"name": "_bmcRancher",
"value": "Management",
"isBillingTag": false,
"createdBy": "SYSTEM"
}Code language: JSON / JSON with Comments (json)
Find out more
View Clusters
Send a GET request to:
GET /clusters Code language: HTTP (http)
The request shows a list of all clusters.
To view a specific cluster, use:
GET /clusters/[CLUSTER_ID]Code language: HTTP (http)
Replace the cluster ID in the URL with the actual value.
Find out more
Rancher Solution API - GET /clusters
Rancher Solutions API - GET /clusters/[CLUSTER_ID]
Delete a Cluster
Send a DELETE request to:
DELETE /clusters/[CLUSTER_ID]Code language: HTTP (http)
The request deletes the solution cluster. Replace [CLUSTER_ID] with the actual ID.