ensureFlinkSession
ensureFlinkSession
Ensures the Flink session exists and returns session properties.
/api/v1/flink/session-cluster
Usage and SDK Samples
curl -X POST\
-H "Accept: application/json"\
"http://mgergely-1.vpc.cloudera.com:18121//api/v1/flink/session-cluster"
import io.swagger.client.*;
import io.swagger.client.auth.*;
import io.swagger.client.model.*;
import io.swagger.client.api.FlinkSessionClusterOperationsApi;
import java.io.File;
import java.util.*;
public class FlinkSessionClusterOperationsApiExample {
public static void main(String[] args) {
FlinkSessionClusterOperationsApi apiInstance = new FlinkSessionClusterOperationsApi();
String username = username_example; // String |
try {
FlinkStatusDto result = apiInstance.ensureFlinkSession(username);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling FlinkSessionClusterOperationsApi#ensureFlinkSession");
e.printStackTrace();
}
}
}
import io.swagger.client.api.FlinkSessionClusterOperationsApi;
public class FlinkSessionClusterOperationsApiExample {
public static void main(String[] args) {
FlinkSessionClusterOperationsApi apiInstance = new FlinkSessionClusterOperationsApi();
String username = username_example; // String |
try {
FlinkStatusDto result = apiInstance.ensureFlinkSession(username);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling FlinkSessionClusterOperationsApi#ensureFlinkSession");
e.printStackTrace();
}
}
}
String *username = username_example; // (optional)
FlinkSessionClusterOperationsApi *apiInstance = [[FlinkSessionClusterOperationsApi alloc] init];
// ensureFlinkSession
[apiInstance ensureFlinkSessionWith:username
completionHandler: ^(FlinkStatusDto output, NSError* error) {
if (output) {
NSLog(@"%@", output);
}
if (error) {
NSLog(@"Error: %@", error);
}
}];
var StreamingSqlEngineApi = require('streaming_sql_engine_api');
var api = new StreamingSqlEngineApi.FlinkSessionClusterOperationsApi()
var opts = {
'username': username_example // {{String}}
};
var callback = function(error, data, response) {
if (error) {
console.error(error);
} else {
console.log('API called successfully. Returned data: ' + data);
}
};
api.ensureFlinkSession(opts, callback);
using System;
using System.Diagnostics;
using IO.Swagger.Api;
using IO.Swagger.Client;
using IO.Swagger.Model;
namespace Example
{
public class ensureFlinkSessionExample
{
public void main()
{
var apiInstance = new FlinkSessionClusterOperationsApi();
var username = username_example; // String | (optional)
try
{
// ensureFlinkSession
FlinkStatusDto result = apiInstance.ensureFlinkSession(username);
Debug.WriteLine(result);
}
catch (Exception e)
{
Debug.Print("Exception when calling FlinkSessionClusterOperationsApi.ensureFlinkSession: " + e.Message );
}
}
}
}
<?php
require_once(__DIR__ . '/vendor/autoload.php');
$api_instance = new Swagger\Client\ApiFlinkSessionClusterOperationsApi();
$username = username_example; // String |
try {
$result = $api_instance->ensureFlinkSession($username);
print_r($result);
} catch (Exception $e) {
echo 'Exception when calling FlinkSessionClusterOperationsApi->ensureFlinkSession: ', $e->getMessage(), PHP_EOL;
}
?>
use Data::Dumper;
use WWW::SwaggerClient::Configuration;
use WWW::SwaggerClient::FlinkSessionClusterOperationsApi;
my $api_instance = WWW::SwaggerClient::FlinkSessionClusterOperationsApi->new();
my $username = username_example; # String |
eval {
my $result = $api_instance->ensureFlinkSession(username => $username);
print Dumper($result);
};
if ($@) {
warn "Exception when calling FlinkSessionClusterOperationsApi->ensureFlinkSession: $@\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.FlinkSessionClusterOperationsApi()
username = username_example # String | (optional)
try:
# ensureFlinkSession
api_response = api_instance.ensure_flink_session(username=username)
pprint(api_response)
except ApiException as e:
print("Exception when calling FlinkSessionClusterOperationsApi->ensureFlinkSession: %s\n" % e)
Parameters
Name | Description |
---|---|
Username |
String
|