/branding/themes
31.0
createBrandingTheme
Usage and SDK Samples
curl -X POST -H "Authorization: [[apiKey]]" "https://localhost/cloudapi/branding/themes"
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.BrandingApi;
import java.io.File;
import java.util.*;
public class BrandingApiExample {
public static void main(String[] args) {
final VcdClient vcdClient = new VcdClientImpl("https://localhost/cloudapi/cloudapi", "32.0", CxfClientSecurityContext.getDefaultCxfClientSecurityContext());
vcdClient.setCredentials(new VcdBasicLoginCredentials(<username>, <orgname>, <password>));
final OpenApiClient openApiClient = vcdClient.getOpenApiClient();
final BrandingApi api = openApiClient.createProxy(BrandingApi.class);
/*
* UiTheme |
*
*/
UiTheme newTheme = new UiTheme();
// Set properties
try {
UiTheme result = api.createBrandingTheme(newTheme);
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 BrandingApi#createBrandingTheme");
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.BrandingApi;
public class BrandingApiExample {
public static void main(String[] args) {
BrandingApi apiInstance = new BrandingApi();
UiTheme newTheme = ; // UiTheme |
try {
UiTheme result = apiInstance.createBrandingTheme(newTheme);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling BrandingApi#createBrandingTheme");
e.printStackTrace();
}
}
}
Configuration *apiConfig = [Configuration sharedConfig];
// Configure API key authorization: (authentication scheme: ApiKeyAuth)
[apiConfig setApiKey:@"YOUR_API_KEY" forApiKeyIdentifier:@"Authorization"];
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
//[apiConfig setApiKeyPrefix:@"Bearer" forApiKeyIdentifier:@"Authorization"];
UiTheme *newTheme = ; //
BrandingApi *apiInstance = [[BrandingApi alloc] init];
// Create a new custom theme
[apiInstance createBrandingThemeWith:newTheme
completionHandler: ^(UiTheme output, NSError* error) {
if (output) {
NSLog(@"%@", output);
}
if (error) {
NSLog(@"Error: %@", error);
}
}];
var VCloudDirectorOpenApi = require('v_cloud_director_open_api');
var defaultClient = VCloudDirectorOpenApi.ApiClient.instance;
// Configure API key authorization: ApiKeyAuth
var ApiKeyAuth = defaultClient.authentications['ApiKeyAuth'];
ApiKeyAuth.apiKey = "YOUR API KEY"
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//ApiKeyAuth.apiKeyPrefix['Authorization'] = "Token"
var api = new VCloudDirectorOpenApi.BrandingApi()
var newTheme = ; // {UiTheme}
var callback = function(error, data, response) {
if (error) {
console.error(error);
} else {
console.log('API called successfully. Returned data: ' + data);
}
};
api.createBrandingTheme(newTheme, callback);
using System;
using System.Diagnostics;
using IO.Swagger.Api;
using IO.Swagger.Client;
using IO.Swagger.Model;
namespace Example
{
public class createBrandingThemeExample
{
public void main()
{
// Configure API key authorization: ApiKeyAuth
Configuration.Default.ApiKey.Add("Authorization", "YOUR_API_KEY");
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// Configuration.Default.ApiKeyPrefix.Add("Authorization", "Bearer");
var apiInstance = new BrandingApi();
var newTheme = new UiTheme(); // UiTheme |
try
{
// Create a new custom theme
UiTheme result = apiInstance.createBrandingTheme(newTheme);
Debug.WriteLine(result);
}
catch (Exception e)
{
Debug.Print("Exception when calling BrandingApi.createBrandingTheme: " + e.Message );
}
}
}
}
<?php
require_once(__DIR__ . '/vendor/autoload.php');
// Configure API key authorization: ApiKeyAuth
Swagger\Client\Configuration::getDefaultConfiguration()->setApiKey('Authorization', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// Swagger\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('Authorization', 'Bearer');
$api_instance = new Swagger\Client\Api\BrandingApi();
$newTheme = ; // UiTheme |
try {
$result = $api_instance->createBrandingTheme($newTheme);
print_r($result);
} catch (Exception $e) {
echo 'Exception when calling BrandingApi->createBrandingTheme: ', $e->getMessage(), PHP_EOL;
}
?>
use Data::Dumper;
use WWW::SwaggerClient::Configuration;
use WWW::SwaggerClient::BrandingApi;
# Configure API key authorization: ApiKeyAuth
$WWW::SwaggerClient::Configuration::api_key->{'Authorization'} = 'YOUR_API_KEY';
# uncomment below to setup prefix (e.g. Bearer) for API key, if needed
#$WWW::SwaggerClient::Configuration::api_key_prefix->{'Authorization'} = "Bearer";
my $api_instance = WWW::SwaggerClient::BrandingApi->new();
my $newTheme = WWW::SwaggerClient::Object::UiTheme->new(); # UiTheme |
eval {
my $result = $api_instance->createBrandingTheme(newTheme => $newTheme);
print Dumper($result);
};
if ($@) {
warn "Exception when calling BrandingApi->createBrandingTheme: $@\n";
}
from __future__ import print_statement
import time
import swagger_client
from swagger_client.rest import ApiException
from pprint import pprint
# Configure API key authorization: ApiKeyAuth
swagger_client.configuration.api_key['Authorization'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# swagger_client.configuration.api_key_prefix['Authorization'] = 'Bearer'
# create an instance of the API class
api_instance = swagger_client.BrandingApi()
newTheme = # UiTheme |
try:
# Create a new custom theme
api_response = api_instance.create_branding_theme(newTheme)
pprint(api_response)
except ApiException as e:
print("Exception when calling BrandingApi->createBrandingTheme: %s\n" % e)
Parameters
Name | Description |
---|---|
newTheme * |