failoverCluster
Trigger cluster failover
/public/api/v1/cluster/{clusterId}:failover
Usage and SDK Samples
curl -X POST\
-H "Accept: application/json"\
"//public/api/v1/cluster/{clusterId}:failover"
import io.swagger.client.*;
import io.swagger.client.auth.*;
import io.swagger.client.model.*;
import io.swagger.client.api.ClusterServiceApi;
import java.io.File;
import java.util.*;
public class ClusterServiceApiExample {
public static void main(String[] args) {
ClusterServiceApi apiInstance = new ClusterServiceApi();
String clusterId = clusterId_example; // String | A cluster
try {
FailoverResult result = apiInstance.failoverCluster(clusterId);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling ClusterServiceApi#failoverCluster");
e.printStackTrace();
}
}
}
import io.swagger.client.api.ClusterServiceApi;
public class ClusterServiceApiExample {
public static void main(String[] args) {
ClusterServiceApi apiInstance = new ClusterServiceApi();
String clusterId = clusterId_example; // String | A cluster
try {
FailoverResult result = apiInstance.failoverCluster(clusterId);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling ClusterServiceApi#failoverCluster");
e.printStackTrace();
}
}
}
String *clusterId = clusterId_example; // A cluster
ClusterServiceApi *apiInstance = [[ClusterServiceApi alloc] init];
[apiInstance failoverClusterWith:clusterId
completionHandler: ^(FailoverResult output, NSError* error) {
if (output) {
NSLog(@"%@", output);
}
if (error) {
NSLog(@"Error: %@", error);
}
}];
var StarburstControlPlanePublicApi = require('starburst_control_plane_public_api');
var api = new StarburstControlPlanePublicApi.ClusterServiceApi()
var clusterId = clusterId_example; // {{String}} A cluster
var callback = function(error, data, response) {
if (error) {
console.error(error);
} else {
console.log('API called successfully. Returned data: ' + data);
}
};
api.failoverCluster(clusterId, callback);
using System;
using System.Diagnostics;
using IO.Swagger.Api;
using IO.Swagger.Client;
using IO.Swagger.Model;
namespace Example
{
public class failoverClusterExample
{
public void main()
{
var apiInstance = new ClusterServiceApi();
var clusterId = clusterId_example; // String | A cluster
try
{
FailoverResult result = apiInstance.failoverCluster(clusterId);
Debug.WriteLine(result);
}
catch (Exception e)
{
Debug.Print("Exception when calling ClusterServiceApi.failoverCluster: " + e.Message );
}
}
}
}
<?php
require_once(__DIR__ . '/vendor/autoload.php');
$api_instance = new Swagger\Client\ApiClusterServiceApi();
$clusterId = clusterId_example; // String | A cluster
try {
$result = $api_instance->failoverCluster($clusterId);
print_r($result);
} catch (Exception $e) {
echo 'Exception when calling ClusterServiceApi->failoverCluster: ', $e->getMessage(), PHP_EOL;
}
?>
use Data::Dumper;
use WWW::SwaggerClient::Configuration;
use WWW::SwaggerClient::ClusterServiceApi;
my $api_instance = WWW::SwaggerClient::ClusterServiceApi->new();
my $clusterId = clusterId_example; # String | A cluster
eval {
my $result = $api_instance->failoverCluster(clusterId => $clusterId);
print Dumper($result);
};
if ($@) {
warn "Exception when calling ClusterServiceApi->failoverCluster: $@\n";
}
from __future__ import print_statement
import time
import swagger_client
from swagger_client.rest import ApiException
from pprint import pprint
# create an instance of the API class
api_instance = swagger_client.ClusterServiceApi()
clusterId = clusterId_example # String | A cluster
try:
api_response = api_instance.failover_cluster(clusterId)
pprint(api_response)
except ApiException as e:
print("Exception when calling ClusterServiceApi->failoverCluster: %s\n" % e)
Parameters
| Name | Description |
|---|---|
| clusterId* |
String
A cluster
Required
|
Responses
Status: 200 - Success
Cluster failover result