executeCommand
Execute a command
/command
Usage and SDK Samples
curl -X POST\
-H "Authorization: Basic [[basicHash]]"\
-H "Accept: application/json"\
-H "Content-Type: application/json"\
"https://{server}/api/v1/command"
import io.swagger.client.*;
import io.swagger.client.auth.*;
import io.swagger.client.model.*;
import io.swagger.client.api.DefaultApi;
import java.io.File;
import java.util.*;
public class DefaultApiExample {
public static void main(String[] args) {
ApiClient defaultClient = Configuration.getDefaultApiClient();
// Configure HTTP basic authorization: basicAuth
HttpBasicAuth basicAuth = (HttpBasicAuth) defaultClient.getAuthentication("basicAuth");
basicAuth.setUsername("YOUR USERNAME");
basicAuth.setPassword("YOUR PASSWORD");
DefaultApi apiInstance = new DefaultApi();
Command_body body = ; // Command_body | A command to execute
try {
inline_response_200_1 result = apiInstance.executeCommand(body);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling DefaultApi#executeCommand");
e.printStackTrace();
}
}
}
import io.swagger.client.api.DefaultApi;
public class DefaultApiExample {
public static void main(String[] args) {
DefaultApi apiInstance = new DefaultApi();
Command_body body = ; // Command_body | A command to execute
try {
inline_response_200_1 result = apiInstance.executeCommand(body);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling DefaultApi#executeCommand");
e.printStackTrace();
}
}
}
Configuration *apiConfig = [Configuration sharedConfig];
// Configure HTTP basic authorization (authentication scheme: basicAuth)
[apiConfig setUsername:@"YOUR_USERNAME"];
[apiConfig setPassword:@"YOUR_PASSWORD"];
Command_body *body = ; // A command to execute
DefaultApi *apiInstance = [[DefaultApi alloc] init];
// Execute a command
[apiInstance executeCommandWith:body
completionHandler: ^(inline_response_200_1 output, NSError* error) {
if (output) {
NSLog(@"%@", output);
}
if (error) {
NSLog(@"Error: %@", error);
}
}];
var HostManagerApi = require('host_manager_api');
var defaultClient = HostManagerApi.ApiClient.instance;
// Configure HTTP basic authorization: basicAuth
var basicAuth = defaultClient.authentications['basicAuth'];
basicAuth.username = 'YOUR USERNAME'
basicAuth.password = 'YOUR PASSWORD'
var api = new HostManagerApi.DefaultApi()
var body = ; // {{Command_body}} A command to execute
var callback = function(error, data, response) {
if (error) {
console.error(error);
} else {
console.log('API called successfully. Returned data: ' + data);
}
};
api.executeCommand(body, callback);
using System;
using System.Diagnostics;
using IO.Swagger.Api;
using IO.Swagger.Client;
using IO.Swagger.Model;
namespace Example
{
public class executeCommandExample
{
public void main()
{
// Configure HTTP basic authorization: basicAuth
Configuration.Default.Username = "YOUR_USERNAME";
Configuration.Default.Password = "YOUR_PASSWORD";
var apiInstance = new DefaultApi();
var body = new Command_body(); // Command_body | A command to execute
try
{
// Execute a command
inline_response_200_1 result = apiInstance.executeCommand(body);
Debug.WriteLine(result);
}
catch (Exception e)
{
Debug.Print("Exception when calling DefaultApi.executeCommand: " + e.Message );
}
}
}
}
<?php
require_once(__DIR__ . '/vendor/autoload.php');
// Configure HTTP basic authorization: basicAuth
Swagger\Client\Configuration::getDefaultConfiguration()->setUsername('YOUR_USERNAME');
Swagger\Client\Configuration::getDefaultConfiguration()->setPassword('YOUR_PASSWORD');
$api_instance = new Swagger\Client\ApiDefaultApi();
$body = ; // Command_body | A command to execute
try {
$result = $api_instance->executeCommand($body);
print_r($result);
} catch (Exception $e) {
echo 'Exception when calling DefaultApi->executeCommand: ', $e->getMessage(), PHP_EOL;
}
?>
use Data::Dumper;
use WWW::SwaggerClient::Configuration;
use WWW::SwaggerClient::DefaultApi;
# Configure HTTP basic authorization: basicAuth
$WWW::SwaggerClient::Configuration::username = 'YOUR_USERNAME';
$WWW::SwaggerClient::Configuration::password = 'YOUR_PASSWORD';
my $api_instance = WWW::SwaggerClient::DefaultApi->new();
my $body = WWW::SwaggerClient::Object::Command_body->new(); # Command_body | A command to execute
eval {
my $result = $api_instance->executeCommand(body => $body);
print Dumper($result);
};
if ($@) {
warn "Exception when calling DefaultApi->executeCommand: $@\n";
}
from __future__ import print_statement
import time
import swagger_client
from swagger_client.rest import ApiException
from pprint import pprint
# Configure HTTP basic authorization: basicAuth
swagger_client.configuration.username = 'YOUR_USERNAME'
swagger_client.configuration.password = 'YOUR_PASSWORD'
# create an instance of the API class
api_instance = swagger_client.DefaultApi()
body = # Command_body | A command to execute
try:
# Execute a command
api_response = api_instance.execute_command(body)
pprint(api_response)
except ApiException as e:
print("Exception when calling DefaultApi->executeCommand: %s\n" % e)
Parameters
Body parameters
Name | Description |
---|---|
body * |