Restarting an Exclusive Cluster
Sample Code
You can use the API to restart an exclusive cluster. Sample code is as follows:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 | // Import classes:
import com.huaweicloud.cs.java.v1.client.ApiException;
import com.huaweicloud.cs.java.v1.ClusterApi;
ClusterApi apiInstance = new ClusterApi(apiClient);//apiClient is created when initializing a CS API client. System.err.println(e.getResponseBody());
String xProjectId = "xProjectId_example"; // String | Project ID used for obtaining the token for the project.
Integer clusterId = 56; // Integer | ID of an exclusive cluster.
try {
RestartReservedClusterResponse result = apiInstance.restartReservedCluster(xProjectId, clusterId);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling ClusterApi#restartReservedCluster");
System.err.println(e.getResponseBody());
e.printStackTrace();
}
|
Parameters
| Parameter | Mandatory | Type | Description |
|---|---|---|---|
| xProjectId | Yes | String | Project ID. This parameter is used to obtain the token for the project. |
| clusterId | Yes | Integer | ID of an exclusive cluster. |
| Parameter | Mandatory | Type | Description |
|---|---|---|---|
| messageId | No | String | Message type ID. |
| message | No | String | Message content. |
| currentTime | No | Long | Current time, expressed by milliseconds. |
Last Article: Terminating an Exclusive Cluster
Next Article: Querying the List of Jobs Running in an Exclusive Cluster
Did this article solve your problem?
Thank you for your score!Your feedback would help us improve the website.