Start or Terminate a Cluster on Oracle OCI

PUT /api/v2.0/clusters/<cluster-id/cluster-label>/state

Use this API to start or terminate a cluster.

Required Role

The following users can make this API call:

  • Users who belong to the system-user or system-admin group.

  • Users who belong to a group associated with a role that allows start/stop operations on a cluster. See Managing Groups and Managing Roles for more information.

Parameters

Note

Parameters marked in bold below are mandatory. Others are optional and have default values.

Parameter

Description

state

It is used to state the action to perform. Its valid values are start to start a cluster and terminate to terminate it. Starting a running cluster or stopping a terminated cluster will have no effect.

Request API Syntax

Here is the request API syntax to start/terminate a cluster.

curl -X PUT -H "X-AUTH-TOKEN:$X_AUTH_TOKEN" -H "Content-Type: application/json" -H "Accept: application/json" \
-d '{"state":"<start/terminate>"}' \ "https://oraclecloud.qubole.com/api/v2/clusters/<cluster ID/cluster label>/state"

Sample API Requests

Here are sample requests to start and terminate a cluster with 155 as its ID.

Start a Cluster

curl -X PUT -H "X-AUTH-TOKEN:$X_AUTH_TOKEN" -H "Content-Type: application/json" -H "Accept: application/json" \
-d '{"state":"start"}' \ "https://oraclecloud.qubole.com/api/v2/clusters/155/state"

Terminate a Running Cluster

curl -X PUT -H "X-AUTH-TOKEN:$X_AUTH_TOKEN" -H "Content-Type: application/json" -H "Accept: application/json" \
-d '{"state":"terminate"}' \ "https://oraclecloud.qubole.com/api/v2/clusters/155/state"