/api/1.0.0/services/{service-name}
34.0
- vcd (alias of vmware-vcd)
- vmware-vcd
- vpostgres
- repmgrd
- appliance-sync.timer
getServiceStatus
Usage and SDK Samples
curl -X GET -H "Accept: application/json" -H "Authorization: Basic [[basicHash]]" -H "Accept: application/json" -H "Authorization: Basic [[basicHash]]" "https://localhost/api/1.0.0/services/{service-name}"
import javax.ws.rs.WebApplicationException;
import com.vmware.vcloud.api.rest.client.VcdClient;
import com.vmware.vcloud.api.rest.client.VcdClientImpl;
import com.vmware.vcloud.api.rest.client.OpenApiClient;
import com.vmware.vcloud.api.rest.client.CxfClientSecurityContext;
import com.vmware.vcloud.rest.openapi.model.*;
import com.vmware.vcloud.rest.openapi.api.ApplianceServiceApi;
import java.io.File;
import java.util.*;
public class ApplianceServiceApiExample {
public static void main(String[] args) {
final VcdClient vcdClient = new VcdClientImpl("https://localhost/cloudapi", "36.0", CxfClientSecurityContext.getDefaultCxfClientSecurityContext());
vcdClient.setCredentials(new VcdBasicLoginCredentials(<username>, <orgname>, <password>));
final OpenApiClient openApiClient = vcdClient.getOpenApiClient();
final ApplianceServiceApi api = openApiClient.createProxy(ApplianceServiceApi.class);
try {
ApplianceService result = api.getServiceStatus(serviceName);
System.out.println(result);
// Print response details:
System.out.println("Response code: " + openApiClient.getLastStatus(api));
System.out.println("Rest Links: " + openApiClient.getLastLinks(api));
} catch (WebApplicationException e) {
System.err.println("Exception when calling ApplianceServiceApi#getServiceStatus");
System.err.println("Error message: " + e.getMessage());
System.err.println("Vcd error code:" + api.getLastVcdError(api).getMinorErrorCode());
System.err.println();
e.printStackTrace();
}
}
}
import com.vmware.vcloud.rest.openapi.api.ApplianceServiceApi;
public class ApplianceServiceApiExample {
public static void main(String[] args) {
ApplianceServiceApi apiInstance = new ApplianceServiceApi();
String serviceName = serviceName_example; // String | Name of service whose details you want returned
try {
ApplianceService result = apiInstance.getServiceStatus(serviceName);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling ApplianceServiceApi#getServiceStatus");
e.printStackTrace();
}
}
}
Configuration *apiConfig = [Configuration sharedConfig];
// Configure HTTP basic authorization (authentication scheme: BasicAuth)
[apiConfig setUsername:@"YOUR_USERNAME"];
[apiConfig setPassword:@"YOUR_PASSWORD"];
// Configure HTTP basic authorization (authentication scheme: BearerAuth)
[apiConfig setUsername:@"YOUR_USERNAME"];
[apiConfig setPassword:@"YOUR_PASSWORD"];
String *serviceName = serviceName_example; // Name of service whose details you want returned
ApplianceServiceApi *apiInstance = [[ApplianceServiceApi alloc] init];
// Returns current operational state for the requested service running on this appliance.
[apiInstance getServiceStatusWith:serviceName
completionHandler: ^(ApplianceService output, NSError* error) {
if (output) {
NSLog(@"%@", output);
}
if (error) {
NSLog(@"Error: %@", error);
}
}];
var CloudDirectorApplianceApi = require('cloud_director_appliance_api');
var defaultClient = CloudDirectorApplianceApi.ApiClient.instance;
// Configure HTTP basic authorization: BasicAuth
var BasicAuth = defaultClient.authentications['BasicAuth'];
BasicAuth.username = 'YOUR USERNAME'
BasicAuth.password = 'YOUR PASSWORD'
// Configure HTTP basic authorization: BearerAuth
var BearerAuth = defaultClient.authentications['BearerAuth'];
BearerAuth.username = 'YOUR USERNAME'
BearerAuth.password = 'YOUR PASSWORD'
var api = new CloudDirectorApplianceApi.ApplianceServiceApi()
var serviceName = serviceName_example; // {String} Name of service whose details you want returned
var callback = function(error, data, response) {
if (error) {
console.error(error);
} else {
console.log('API called successfully. Returned data: ' + data);
}
};
api.getServiceStatus(serviceName, callback);
using System;
using System.Diagnostics;
using IO.Swagger.Api;
using IO.Swagger.Client;
using IO.Swagger.Model;
namespace Example
{
public class getServiceStatusExample
{
public void main()
{
// Configure HTTP basic authorization: BasicAuth
Configuration.Default.Username = "YOUR_USERNAME";
Configuration.Default.Password = "YOUR_PASSWORD";
// Configure HTTP basic authorization: BearerAuth
Configuration.Default.Username = "YOUR_USERNAME";
Configuration.Default.Password = "YOUR_PASSWORD";
var apiInstance = new ApplianceServiceApi();
var serviceName = serviceName_example; // String | Name of service whose details you want returned
try
{
// Returns current operational state for the requested service running on this appliance.
ApplianceService result = apiInstance.getServiceStatus(serviceName);
Debug.WriteLine(result);
}
catch (Exception e)
{
Debug.Print("Exception when calling ApplianceServiceApi.getServiceStatus: " + 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');
// Configure HTTP basic authorization: BearerAuth
Swagger\Client\Configuration::getDefaultConfiguration()->setUsername('YOUR_USERNAME');
Swagger\Client\Configuration::getDefaultConfiguration()->setPassword('YOUR_PASSWORD');
$api_instance = new Swagger\Client\Api\ApplianceServiceApi();
$serviceName = serviceName_example; // String | Name of service whose details you want returned
try {
$result = $api_instance->getServiceStatus($serviceName);
print_r($result);
} catch (Exception $e) {
echo 'Exception when calling ApplianceServiceApi->getServiceStatus: ', $e->getMessage(), PHP_EOL;
}
?>
use Data::Dumper;
use WWW::SwaggerClient::Configuration;
use WWW::SwaggerClient::ApplianceServiceApi;
# Configure HTTP basic authorization: BasicAuth
$WWW::SwaggerClient::Configuration::username = 'YOUR_USERNAME';
$WWW::SwaggerClient::Configuration::password = 'YOUR_PASSWORD';
# Configure HTTP basic authorization: BearerAuth
$WWW::SwaggerClient::Configuration::username = 'YOUR_USERNAME';
$WWW::SwaggerClient::Configuration::password = 'YOUR_PASSWORD';
my $api_instance = WWW::SwaggerClient::ApplianceServiceApi->new();
my $serviceName = serviceName_example; # String | Name of service whose details you want returned
eval {
my $result = $api_instance->getServiceStatus(serviceName => $serviceName);
print Dumper($result);
};
if ($@) {
warn "Exception when calling ApplianceServiceApi->getServiceStatus: $@\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'
# Configure HTTP basic authorization: BearerAuth
swagger_client.configuration.username = 'YOUR_USERNAME'
swagger_client.configuration.password = 'YOUR_PASSWORD'
# create an instance of the API class
api_instance = swagger_client.ApplianceServiceApi()
serviceName = serviceName_example # String | Name of service whose details you want returned
try:
# Returns current operational state for the requested service running on this appliance.
api_response = api_instance.get_service_status(serviceName)
pprint(api_response)
except ApiException as e:
print("Exception when calling ApplianceServiceApi->getServiceStatus: %s\n" % e)
Parameters
Name | Description |
---|---|
service-name* |
String
Name of service whose details you want returned
Required
|
Responses
Status: 200 - OK
{
"serviceName": "vmware-vcd",
"status": "running"
}