CoreStack External API

CloudAccounts

createCloudAccount

CoreStack allows to onboard AWS cloud account using two different authentication protocols - Access Key & Assume Role. Access key being the default and widely used authentication protocol, Assume Role option is more secure as suggested by AWS. This method allows onboarding of Cloud Account using Access Key. Details on the Access Key can be found in the link https://docs.aws.amazon.com/general/latest/gr/aws-sec-cred-types.html. Use method 'createCloudAccountAssumeRole' for onboarding cloud account in CoreStack using Assume Role.


/v1/{tenant_id}/cloud_accounts

Usage and SDK Samples

curl -X POST -H "X-Auth-Token: [[apiKey]]" -H "X-Auth-User: [[apiKey]]" "https://localhost/v1/{tenant_id}/cloud_accounts"
import io.swagger.client.*;
import io.swagger.client.auth.*;
import io.swagger.client.model.*;
import io.swagger.client.api.CloudAccountsApi;

import java.io.File;
import java.util.*;

public class CloudAccountsApiExample {

    public static void main(String[] args) {
        ApiClient defaultClient = Configuration.getDefaultApiClient();
        
        // Configure API key authorization: auth_token
        ApiKeyAuth auth_token = (ApiKeyAuth) defaultClient.getAuthentication("auth_token");
        auth_token.setApiKey("YOUR API KEY");
        // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
        //auth_token.setApiKeyPrefix("Token");

        // Configure API key authorization: auth_user
        ApiKeyAuth auth_user = (ApiKeyAuth) defaultClient.getAuthentication("auth_user");
        auth_user.setApiKey("YOUR API KEY");
        // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
        //auth_user.setApiKeyPrefix("Token");

        CloudAccountsApi apiInstance = new CloudAccountsApi();
        String tenantId = tenantId_example; // String | Specify the tenant id to create cloud account which is a unique id can be retrieved using the list tenant api.
        CloudAccountCreateRequest cloudAccountCreateRequest = ; // CloudAccountCreateRequest | 
        try {
            CloudAccountCreateResponse result = apiInstance.createCloudAccount(tenantId, cloudAccountCreateRequest);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling CloudAccountsApi#createCloudAccount");
            e.printStackTrace();
        }
    }
}
import io.swagger.client.api.CloudAccountsApi;

public class CloudAccountsApiExample {

    public static void main(String[] args) {
        CloudAccountsApi apiInstance = new CloudAccountsApi();
        String tenantId = tenantId_example; // String | Specify the tenant id to create cloud account which is a unique id can be retrieved using the list tenant api.
        CloudAccountCreateRequest cloudAccountCreateRequest = ; // CloudAccountCreateRequest | 
        try {
            CloudAccountCreateResponse result = apiInstance.createCloudAccount(tenantId, cloudAccountCreateRequest);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling CloudAccountsApi#createCloudAccount");
            e.printStackTrace();
        }
    }
}
Configuration *apiConfig = [Configuration sharedConfig];

// Configure API key authorization: (authentication scheme: auth_token)
[apiConfig setApiKey:@"YOUR_API_KEY" forApiKeyIdentifier:@"X-Auth-Token"];
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
//[apiConfig setApiKeyPrefix:@"Bearer" forApiKeyIdentifier:@"X-Auth-Token"];

// Configure API key authorization: (authentication scheme: auth_user)
[apiConfig setApiKey:@"YOUR_API_KEY" forApiKeyIdentifier:@"X-Auth-User"];
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
//[apiConfig setApiKeyPrefix:@"Bearer" forApiKeyIdentifier:@"X-Auth-User"];

String *tenantId = tenantId_example; // Specify the tenant id to create cloud account which is a unique id can be retrieved using the list tenant api.
CloudAccountCreateRequest *cloudAccountCreateRequest = ; // 

CloudAccountsApi *apiInstance = [[CloudAccountsApi alloc] init];

[apiInstance createCloudAccountWith:tenantId
    cloudAccountCreateRequest:cloudAccountCreateRequest
              completionHandler: ^(CloudAccountCreateResponse output, NSError* error) {
                            if (output) {
                                NSLog(@"%@", output);
                            }
                            if (error) {
                                NSLog(@"Error: %@", error);
                            }
                        }];
var CorestackExternalApi = require('corestack_external_api');
var defaultClient = CorestackExternalApi.ApiClient.instance;

// Configure API key authorization: auth_token
var auth_token = defaultClient.authentications['auth_token'];
auth_token.apiKey = "YOUR API KEY"
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//auth_token.apiKeyPrefix['X-Auth-Token'] = "Token"

// Configure API key authorization: auth_user
var auth_user = defaultClient.authentications['auth_user'];
auth_user.apiKey = "YOUR API KEY"
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//auth_user.apiKeyPrefix['X-Auth-User'] = "Token"

var api = new CorestackExternalApi.CloudAccountsApi()

var tenantId = tenantId_example; // {String} Specify the tenant id to create cloud account which is a unique id can be retrieved using the list tenant api.

var cloudAccountCreateRequest = ; // {CloudAccountCreateRequest} 


var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
api.createCloudAccount(tenantId, cloudAccountCreateRequest, callback);
using System;
using System.Diagnostics;
using IO.Swagger.Api;
using IO.Swagger.Client;
using IO.Swagger.Model;

namespace Example
{
    public class createCloudAccountExample
    {
        public void main()
        {
            
            // Configure API key authorization: auth_token
            Configuration.Default.ApiKey.Add("X-Auth-Token", "YOUR_API_KEY");
            // Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
            // Configuration.Default.ApiKeyPrefix.Add("X-Auth-Token", "Bearer");
            // Configure API key authorization: auth_user
            Configuration.Default.ApiKey.Add("X-Auth-User", "YOUR_API_KEY");
            // Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
            // Configuration.Default.ApiKeyPrefix.Add("X-Auth-User", "Bearer");

            var apiInstance = new CloudAccountsApi();
            var tenantId = tenantId_example;  // String | Specify the tenant id to create cloud account which is a unique id can be retrieved using the list tenant api.
            var cloudAccountCreateRequest = new CloudAccountCreateRequest(); // CloudAccountCreateRequest | 

            try
            {
                CloudAccountCreateResponse result = apiInstance.createCloudAccount(tenantId, cloudAccountCreateRequest);
                Debug.WriteLine(result);
            }
            catch (Exception e)
            {
                Debug.Print("Exception when calling CloudAccountsApi.createCloudAccount: " + e.Message );
            }
        }
    }
}
<?php
require_once(__DIR__ . '/vendor/autoload.php');

// Configure API key authorization: auth_token
Swagger\Client\Configuration::getDefaultConfiguration()->setApiKey('X-Auth-Token', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// Swagger\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('X-Auth-Token', 'Bearer');
// Configure API key authorization: auth_user
Swagger\Client\Configuration::getDefaultConfiguration()->setApiKey('X-Auth-User', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// Swagger\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('X-Auth-User', 'Bearer');

$api_instance = new Swagger\Client\Api\CloudAccountsApi();
$tenantId = tenantId_example; // String | Specify the tenant id to create cloud account which is a unique id can be retrieved using the list tenant api.
$cloudAccountCreateRequest = ; // CloudAccountCreateRequest | 

try {
    $result = $api_instance->createCloudAccount($tenantId, $cloudAccountCreateRequest);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling CloudAccountsApi->createCloudAccount: ', $e->getMessage(), PHP_EOL;
}
?>
use Data::Dumper;
use WWW::SwaggerClient::Configuration;
use WWW::SwaggerClient::CloudAccountsApi;

# Configure API key authorization: auth_token
$WWW::SwaggerClient::Configuration::api_key->{'X-Auth-Token'} = 'YOUR_API_KEY';
# uncomment below to setup prefix (e.g. Bearer) for API key, if needed
#$WWW::SwaggerClient::Configuration::api_key_prefix->{'X-Auth-Token'} = "Bearer";
# Configure API key authorization: auth_user
$WWW::SwaggerClient::Configuration::api_key->{'X-Auth-User'} = 'YOUR_API_KEY';
# uncomment below to setup prefix (e.g. Bearer) for API key, if needed
#$WWW::SwaggerClient::Configuration::api_key_prefix->{'X-Auth-User'} = "Bearer";

my $api_instance = WWW::SwaggerClient::CloudAccountsApi->new();
my $tenantId = tenantId_example; # String | Specify the tenant id to create cloud account which is a unique id can be retrieved using the list tenant api.
my $cloudAccountCreateRequest = WWW::SwaggerClient::Object::CloudAccountCreateRequest->new(); # CloudAccountCreateRequest | 

eval { 
    my $result = $api_instance->createCloudAccount(tenantId => $tenantId, cloudAccountCreateRequest => $cloudAccountCreateRequest);
    print Dumper($result);
};
if ($@) {
    warn "Exception when calling CloudAccountsApi->createCloudAccount: $@\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: auth_token
swagger_client.configuration.api_key['X-Auth-Token'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# swagger_client.configuration.api_key_prefix['X-Auth-Token'] = 'Bearer'
# Configure API key authorization: auth_user
swagger_client.configuration.api_key['X-Auth-User'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# swagger_client.configuration.api_key_prefix['X-Auth-User'] = 'Bearer'

# create an instance of the API class
api_instance = swagger_client.CloudAccountsApi()
tenantId = tenantId_example # String | Specify the tenant id to create cloud account which is a unique id can be retrieved using the list tenant api.
cloudAccountCreateRequest =  # CloudAccountCreateRequest | 

try: 
    api_response = api_instance.create_cloud_account(tenantId, cloudAccountCreateRequest)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling CloudAccountsApi->createCloudAccount: %s\n" % e)

Parameters

Path parameters
Name Description
tenant_id*
String
Specify the tenant id to create cloud account which is a unique id can be retrieved using the list tenant api.
Required
Body parameters
Name Description
cloudAccountCreateRequest *

Responses

Status: 201 - Success

Status: 400 - Bad Request

Status: 401 - Unauthorized

Status: 500 - Internal Server Error


createCloudAccountAssumeRole

CoreStack allows to onboard AWS cloud account using two different authentication protocols - Access Key & Assume Role. Access key being the default and widely used authentication protocol, Assume Role option is more secure as suggested by AWS. This method allows onboarding of Cloud Account using Assume Role. Details on the Assume Role can be found in the link https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_create_for-user.html. Use method 'createCloudAccount' for onboarding cloud account in CoreStack using Access Key.


/v1/{tenant_id}/cloud_accounts/assume_role

Usage and SDK Samples

curl -X POST -H "X-Auth-Token: [[apiKey]]" -H "X-Auth-User: [[apiKey]]" "https://localhost/v1/{tenant_id}/cloud_accounts/assume_role"
import io.swagger.client.*;
import io.swagger.client.auth.*;
import io.swagger.client.model.*;
import io.swagger.client.api.CloudAccountsApi;

import java.io.File;
import java.util.*;

public class CloudAccountsApiExample {

    public static void main(String[] args) {
        ApiClient defaultClient = Configuration.getDefaultApiClient();
        
        // Configure API key authorization: auth_token
        ApiKeyAuth auth_token = (ApiKeyAuth) defaultClient.getAuthentication("auth_token");
        auth_token.setApiKey("YOUR API KEY");
        // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
        //auth_token.setApiKeyPrefix("Token");

        // Configure API key authorization: auth_user
        ApiKeyAuth auth_user = (ApiKeyAuth) defaultClient.getAuthentication("auth_user");
        auth_user.setApiKey("YOUR API KEY");
        // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
        //auth_user.setApiKeyPrefix("Token");

        CloudAccountsApi apiInstance = new CloudAccountsApi();
        String tenantId = tenantId_example; // String | Specify the tenant id to create cloud account which is a unique id can be retrieved using the list tenant api.
        CloudAccountAssumeRoleCreateRequest cloudAccountAssumeRoleCreateRequest = ; // CloudAccountAssumeRoleCreateRequest | 
        try {
            CloudAccountCreateResponse result = apiInstance.createCloudAccountAssumeRole(tenantId, cloudAccountAssumeRoleCreateRequest);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling CloudAccountsApi#createCloudAccountAssumeRole");
            e.printStackTrace();
        }
    }
}
import io.swagger.client.api.CloudAccountsApi;

public class CloudAccountsApiExample {

    public static void main(String[] args) {
        CloudAccountsApi apiInstance = new CloudAccountsApi();
        String tenantId = tenantId_example; // String | Specify the tenant id to create cloud account which is a unique id can be retrieved using the list tenant api.
        CloudAccountAssumeRoleCreateRequest cloudAccountAssumeRoleCreateRequest = ; // CloudAccountAssumeRoleCreateRequest | 
        try {
            CloudAccountCreateResponse result = apiInstance.createCloudAccountAssumeRole(tenantId, cloudAccountAssumeRoleCreateRequest);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling CloudAccountsApi#createCloudAccountAssumeRole");
            e.printStackTrace();
        }
    }
}
Configuration *apiConfig = [Configuration sharedConfig];

// Configure API key authorization: (authentication scheme: auth_token)
[apiConfig setApiKey:@"YOUR_API_KEY" forApiKeyIdentifier:@"X-Auth-Token"];
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
//[apiConfig setApiKeyPrefix:@"Bearer" forApiKeyIdentifier:@"X-Auth-Token"];

// Configure API key authorization: (authentication scheme: auth_user)
[apiConfig setApiKey:@"YOUR_API_KEY" forApiKeyIdentifier:@"X-Auth-User"];
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
//[apiConfig setApiKeyPrefix:@"Bearer" forApiKeyIdentifier:@"X-Auth-User"];

String *tenantId = tenantId_example; // Specify the tenant id to create cloud account which is a unique id can be retrieved using the list tenant api.
CloudAccountAssumeRoleCreateRequest *cloudAccountAssumeRoleCreateRequest = ; // 

CloudAccountsApi *apiInstance = [[CloudAccountsApi alloc] init];

[apiInstance createCloudAccountAssumeRoleWith:tenantId
    cloudAccountAssumeRoleCreateRequest:cloudAccountAssumeRoleCreateRequest
              completionHandler: ^(CloudAccountCreateResponse output, NSError* error) {
                            if (output) {
                                NSLog(@"%@", output);
                            }
                            if (error) {
                                NSLog(@"Error: %@", error);
                            }
                        }];
var CorestackExternalApi = require('corestack_external_api');
var defaultClient = CorestackExternalApi.ApiClient.instance;

// Configure API key authorization: auth_token
var auth_token = defaultClient.authentications['auth_token'];
auth_token.apiKey = "YOUR API KEY"
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//auth_token.apiKeyPrefix['X-Auth-Token'] = "Token"

// Configure API key authorization: auth_user
var auth_user = defaultClient.authentications['auth_user'];
auth_user.apiKey = "YOUR API KEY"
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//auth_user.apiKeyPrefix['X-Auth-User'] = "Token"

var api = new CorestackExternalApi.CloudAccountsApi()

var tenantId = tenantId_example; // {String} Specify the tenant id to create cloud account which is a unique id can be retrieved using the list tenant api.

var cloudAccountAssumeRoleCreateRequest = ; // {CloudAccountAssumeRoleCreateRequest} 


var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
api.createCloudAccountAssumeRole(tenantId, cloudAccountAssumeRoleCreateRequest, callback);
using System;
using System.Diagnostics;
using IO.Swagger.Api;
using IO.Swagger.Client;
using IO.Swagger.Model;

namespace Example
{
    public class createCloudAccountAssumeRoleExample
    {
        public void main()
        {
            
            // Configure API key authorization: auth_token
            Configuration.Default.ApiKey.Add("X-Auth-Token", "YOUR_API_KEY");
            // Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
            // Configuration.Default.ApiKeyPrefix.Add("X-Auth-Token", "Bearer");
            // Configure API key authorization: auth_user
            Configuration.Default.ApiKey.Add("X-Auth-User", "YOUR_API_KEY");
            // Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
            // Configuration.Default.ApiKeyPrefix.Add("X-Auth-User", "Bearer");

            var apiInstance = new CloudAccountsApi();
            var tenantId = tenantId_example;  // String | Specify the tenant id to create cloud account which is a unique id can be retrieved using the list tenant api.
            var cloudAccountAssumeRoleCreateRequest = new CloudAccountAssumeRoleCreateRequest(); // CloudAccountAssumeRoleCreateRequest | 

            try
            {
                CloudAccountCreateResponse result = apiInstance.createCloudAccountAssumeRole(tenantId, cloudAccountAssumeRoleCreateRequest);
                Debug.WriteLine(result);
            }
            catch (Exception e)
            {
                Debug.Print("Exception when calling CloudAccountsApi.createCloudAccountAssumeRole: " + e.Message );
            }
        }
    }
}
<?php
require_once(__DIR__ . '/vendor/autoload.php');

// Configure API key authorization: auth_token
Swagger\Client\Configuration::getDefaultConfiguration()->setApiKey('X-Auth-Token', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// Swagger\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('X-Auth-Token', 'Bearer');
// Configure API key authorization: auth_user
Swagger\Client\Configuration::getDefaultConfiguration()->setApiKey('X-Auth-User', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// Swagger\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('X-Auth-User', 'Bearer');

$api_instance = new Swagger\Client\Api\CloudAccountsApi();
$tenantId = tenantId_example; // String | Specify the tenant id to create cloud account which is a unique id can be retrieved using the list tenant api.
$cloudAccountAssumeRoleCreateRequest = ; // CloudAccountAssumeRoleCreateRequest | 

try {
    $result = $api_instance->createCloudAccountAssumeRole($tenantId, $cloudAccountAssumeRoleCreateRequest);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling CloudAccountsApi->createCloudAccountAssumeRole: ', $e->getMessage(), PHP_EOL;
}
?>
use Data::Dumper;
use WWW::SwaggerClient::Configuration;
use WWW::SwaggerClient::CloudAccountsApi;

# Configure API key authorization: auth_token
$WWW::SwaggerClient::Configuration::api_key->{'X-Auth-Token'} = 'YOUR_API_KEY';
# uncomment below to setup prefix (e.g. Bearer) for API key, if needed
#$WWW::SwaggerClient::Configuration::api_key_prefix->{'X-Auth-Token'} = "Bearer";
# Configure API key authorization: auth_user
$WWW::SwaggerClient::Configuration::api_key->{'X-Auth-User'} = 'YOUR_API_KEY';
# uncomment below to setup prefix (e.g. Bearer) for API key, if needed
#$WWW::SwaggerClient::Configuration::api_key_prefix->{'X-Auth-User'} = "Bearer";

my $api_instance = WWW::SwaggerClient::CloudAccountsApi->new();
my $tenantId = tenantId_example; # String | Specify the tenant id to create cloud account which is a unique id can be retrieved using the list tenant api.
my $cloudAccountAssumeRoleCreateRequest = WWW::SwaggerClient::Object::CloudAccountAssumeRoleCreateRequest->new(); # CloudAccountAssumeRoleCreateRequest | 

eval { 
    my $result = $api_instance->createCloudAccountAssumeRole(tenantId => $tenantId, cloudAccountAssumeRoleCreateRequest => $cloudAccountAssumeRoleCreateRequest);
    print Dumper($result);
};
if ($@) {
    warn "Exception when calling CloudAccountsApi->createCloudAccountAssumeRole: $@\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: auth_token
swagger_client.configuration.api_key['X-Auth-Token'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# swagger_client.configuration.api_key_prefix['X-Auth-Token'] = 'Bearer'
# Configure API key authorization: auth_user
swagger_client.configuration.api_key['X-Auth-User'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# swagger_client.configuration.api_key_prefix['X-Auth-User'] = 'Bearer'

# create an instance of the API class
api_instance = swagger_client.CloudAccountsApi()
tenantId = tenantId_example # String | Specify the tenant id to create cloud account which is a unique id can be retrieved using the list tenant api.
cloudAccountAssumeRoleCreateRequest =  # CloudAccountAssumeRoleCreateRequest | 

try: 
    api_response = api_instance.create_cloud_account_assume_role(tenantId, cloudAccountAssumeRoleCreateRequest)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling CloudAccountsApi->createCloudAccountAssumeRole: %s\n" % e)

Parameters

Path parameters
Name Description
tenant_id*
String
Specify the tenant id to create cloud account which is a unique id can be retrieved using the list tenant api.
Required
Body parameters
Name Description
cloudAccountAssumeRoleCreateRequest *

Responses

Status: 201 - Success

Status: 400 - Bad Request

Status: 401 - Unauthorized

Status: 500 - Internal Server Error


deleteCloudAccount

Delete a specific cloud account. Please note all the configurations, like jobs, templates, schedules will be delete. An attempt will be made to delete the settings made in Native cloud service by the corestack but the credentials has to be correct and the user should have relevant permissions else it will be left unchanged.


/v1/{tenant_id}/cloud_accounts/{cloud_account_id}

Usage and SDK Samples

curl -X DELETE -H "X-Auth-Token: [[apiKey]]" -H "X-Auth-User: [[apiKey]]" "https://localhost/v1/{tenant_id}/cloud_accounts/{cloud_account_id}"
import io.swagger.client.*;
import io.swagger.client.auth.*;
import io.swagger.client.model.*;
import io.swagger.client.api.CloudAccountsApi;

import java.io.File;
import java.util.*;

public class CloudAccountsApiExample {

    public static void main(String[] args) {
        ApiClient defaultClient = Configuration.getDefaultApiClient();
        
        // Configure API key authorization: auth_token
        ApiKeyAuth auth_token = (ApiKeyAuth) defaultClient.getAuthentication("auth_token");
        auth_token.setApiKey("YOUR API KEY");
        // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
        //auth_token.setApiKeyPrefix("Token");

        // Configure API key authorization: auth_user
        ApiKeyAuth auth_user = (ApiKeyAuth) defaultClient.getAuthentication("auth_user");
        auth_user.setApiKey("YOUR API KEY");
        // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
        //auth_user.setApiKeyPrefix("Token");

        CloudAccountsApi apiInstance = new CloudAccountsApi();
        String tenantId = tenantId_example; // String | Specify the tenant id to create cloud account which is a unique id can be retrieved using the list tenant api.
        String cloudAccountId = cloudAccountId_example; // String | Specify the cloud account id to update, cloud account id is unique can be obtained from the list cloud account api.
        try {
            CloudAccountDeleteResponse result = apiInstance.deleteCloudAccount(tenantId, cloudAccountId);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling CloudAccountsApi#deleteCloudAccount");
            e.printStackTrace();
        }
    }
}
import io.swagger.client.api.CloudAccountsApi;

public class CloudAccountsApiExample {

    public static void main(String[] args) {
        CloudAccountsApi apiInstance = new CloudAccountsApi();
        String tenantId = tenantId_example; // String | Specify the tenant id to create cloud account which is a unique id can be retrieved using the list tenant api.
        String cloudAccountId = cloudAccountId_example; // String | Specify the cloud account id to update, cloud account id is unique can be obtained from the list cloud account api.
        try {
            CloudAccountDeleteResponse result = apiInstance.deleteCloudAccount(tenantId, cloudAccountId);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling CloudAccountsApi#deleteCloudAccount");
            e.printStackTrace();
        }
    }
}
Configuration *apiConfig = [Configuration sharedConfig];

// Configure API key authorization: (authentication scheme: auth_token)
[apiConfig setApiKey:@"YOUR_API_KEY" forApiKeyIdentifier:@"X-Auth-Token"];
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
//[apiConfig setApiKeyPrefix:@"Bearer" forApiKeyIdentifier:@"X-Auth-Token"];

// Configure API key authorization: (authentication scheme: auth_user)
[apiConfig setApiKey:@"YOUR_API_KEY" forApiKeyIdentifier:@"X-Auth-User"];
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
//[apiConfig setApiKeyPrefix:@"Bearer" forApiKeyIdentifier:@"X-Auth-User"];

String *tenantId = tenantId_example; // Specify the tenant id to create cloud account which is a unique id can be retrieved using the list tenant api.
String *cloudAccountId = cloudAccountId_example; // Specify the cloud account id to update, cloud account id is unique can be obtained from the list cloud account api.

CloudAccountsApi *apiInstance = [[CloudAccountsApi alloc] init];

[apiInstance deleteCloudAccountWith:tenantId
    cloudAccountId:cloudAccountId
              completionHandler: ^(CloudAccountDeleteResponse output, NSError* error) {
                            if (output) {
                                NSLog(@"%@", output);
                            }
                            if (error) {
                                NSLog(@"Error: %@", error);
                            }
                        }];
var CorestackExternalApi = require('corestack_external_api');
var defaultClient = CorestackExternalApi.ApiClient.instance;

// Configure API key authorization: auth_token
var auth_token = defaultClient.authentications['auth_token'];
auth_token.apiKey = "YOUR API KEY"
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//auth_token.apiKeyPrefix['X-Auth-Token'] = "Token"

// Configure API key authorization: auth_user
var auth_user = defaultClient.authentications['auth_user'];
auth_user.apiKey = "YOUR API KEY"
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//auth_user.apiKeyPrefix['X-Auth-User'] = "Token"

var api = new CorestackExternalApi.CloudAccountsApi()

var tenantId = tenantId_example; // {String} Specify the tenant id to create cloud account which is a unique id can be retrieved using the list tenant api.

var cloudAccountId = cloudAccountId_example; // {String} Specify the cloud account id to update, cloud account id is unique can be obtained from the list cloud account api.


var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
api.deleteCloudAccount(tenantId, cloudAccountId, callback);
using System;
using System.Diagnostics;
using IO.Swagger.Api;
using IO.Swagger.Client;
using IO.Swagger.Model;

namespace Example
{
    public class deleteCloudAccountExample
    {
        public void main()
        {
            
            // Configure API key authorization: auth_token
            Configuration.Default.ApiKey.Add("X-Auth-Token", "YOUR_API_KEY");
            // Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
            // Configuration.Default.ApiKeyPrefix.Add("X-Auth-Token", "Bearer");
            // Configure API key authorization: auth_user
            Configuration.Default.ApiKey.Add("X-Auth-User", "YOUR_API_KEY");
            // Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
            // Configuration.Default.ApiKeyPrefix.Add("X-Auth-User", "Bearer");

            var apiInstance = new CloudAccountsApi();
            var tenantId = tenantId_example;  // String | Specify the tenant id to create cloud account which is a unique id can be retrieved using the list tenant api.
            var cloudAccountId = cloudAccountId_example;  // String | Specify the cloud account id to update, cloud account id is unique can be obtained from the list cloud account api.

            try
            {
                CloudAccountDeleteResponse result = apiInstance.deleteCloudAccount(tenantId, cloudAccountId);
                Debug.WriteLine(result);
            }
            catch (Exception e)
            {
                Debug.Print("Exception when calling CloudAccountsApi.deleteCloudAccount: " + e.Message );
            }
        }
    }
}
<?php
require_once(__DIR__ . '/vendor/autoload.php');

// Configure API key authorization: auth_token
Swagger\Client\Configuration::getDefaultConfiguration()->setApiKey('X-Auth-Token', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// Swagger\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('X-Auth-Token', 'Bearer');
// Configure API key authorization: auth_user
Swagger\Client\Configuration::getDefaultConfiguration()->setApiKey('X-Auth-User', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// Swagger\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('X-Auth-User', 'Bearer');

$api_instance = new Swagger\Client\Api\CloudAccountsApi();
$tenantId = tenantId_example; // String | Specify the tenant id to create cloud account which is a unique id can be retrieved using the list tenant api.
$cloudAccountId = cloudAccountId_example; // String | Specify the cloud account id to update, cloud account id is unique can be obtained from the list cloud account api.

try {
    $result = $api_instance->deleteCloudAccount($tenantId, $cloudAccountId);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling CloudAccountsApi->deleteCloudAccount: ', $e->getMessage(), PHP_EOL;
}
?>
use Data::Dumper;
use WWW::SwaggerClient::Configuration;
use WWW::SwaggerClient::CloudAccountsApi;

# Configure API key authorization: auth_token
$WWW::SwaggerClient::Configuration::api_key->{'X-Auth-Token'} = 'YOUR_API_KEY';
# uncomment below to setup prefix (e.g. Bearer) for API key, if needed
#$WWW::SwaggerClient::Configuration::api_key_prefix->{'X-Auth-Token'} = "Bearer";
# Configure API key authorization: auth_user
$WWW::SwaggerClient::Configuration::api_key->{'X-Auth-User'} = 'YOUR_API_KEY';
# uncomment below to setup prefix (e.g. Bearer) for API key, if needed
#$WWW::SwaggerClient::Configuration::api_key_prefix->{'X-Auth-User'} = "Bearer";

my $api_instance = WWW::SwaggerClient::CloudAccountsApi->new();
my $tenantId = tenantId_example; # String | Specify the tenant id to create cloud account which is a unique id can be retrieved using the list tenant api.
my $cloudAccountId = cloudAccountId_example; # String | Specify the cloud account id to update, cloud account id is unique can be obtained from the list cloud account api.

eval { 
    my $result = $api_instance->deleteCloudAccount(tenantId => $tenantId, cloudAccountId => $cloudAccountId);
    print Dumper($result);
};
if ($@) {
    warn "Exception when calling CloudAccountsApi->deleteCloudAccount: $@\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: auth_token
swagger_client.configuration.api_key['X-Auth-Token'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# swagger_client.configuration.api_key_prefix['X-Auth-Token'] = 'Bearer'
# Configure API key authorization: auth_user
swagger_client.configuration.api_key['X-Auth-User'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# swagger_client.configuration.api_key_prefix['X-Auth-User'] = 'Bearer'

# create an instance of the API class
api_instance = swagger_client.CloudAccountsApi()
tenantId = tenantId_example # String | Specify the tenant id to create cloud account which is a unique id can be retrieved using the list tenant api.
cloudAccountId = cloudAccountId_example # String | Specify the cloud account id to update, cloud account id is unique can be obtained from the list cloud account api.

try: 
    api_response = api_instance.delete_cloud_account(tenantId, cloudAccountId)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling CloudAccountsApi->deleteCloudAccount: %s\n" % e)

Parameters

Path parameters
Name Description
tenant_id*
String
Specify the tenant id to create cloud account which is a unique id can be retrieved using the list tenant api.
Required
cloud_account_id*
String
Specify the cloud account id to update, cloud account id is unique can be obtained from the list cloud account api.
Required

Responses

Status: 200 - Success

Status: 400 - Bad Request

Status: 401 - Unauthorized

Status: 500 - Internal Server Error


describeCloudAccount

Get details of a specific cloud account within a given tenant.


/v1/{tenant_id}/cloud_accounts/{cloud_account_id}

Usage and SDK Samples

curl -X GET -H "X-Auth-Token: [[apiKey]]" -H "X-Auth-User: [[apiKey]]" "https://localhost/v1/{tenant_id}/cloud_accounts/{cloud_account_id}"
import io.swagger.client.*;
import io.swagger.client.auth.*;
import io.swagger.client.model.*;
import io.swagger.client.api.CloudAccountsApi;

import java.io.File;
import java.util.*;

public class CloudAccountsApiExample {

    public static void main(String[] args) {
        ApiClient defaultClient = Configuration.getDefaultApiClient();
        
        // Configure API key authorization: auth_token
        ApiKeyAuth auth_token = (ApiKeyAuth) defaultClient.getAuthentication("auth_token");
        auth_token.setApiKey("YOUR API KEY");
        // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
        //auth_token.setApiKeyPrefix("Token");

        // Configure API key authorization: auth_user
        ApiKeyAuth auth_user = (ApiKeyAuth) defaultClient.getAuthentication("auth_user");
        auth_user.setApiKey("YOUR API KEY");
        // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
        //auth_user.setApiKeyPrefix("Token");

        CloudAccountsApi apiInstance = new CloudAccountsApi();
        String tenantId = tenantId_example; // String | Specify the tenant id to create cloud account which is a unique id can be retrieved using the list tenant api.
        String cloudAccountId = cloudAccountId_example; // String | Specify the cloud account id to update, cloud account id is unique can be obtained from the list cloud account api.
        try {
            CloudAccountDescribeResponse result = apiInstance.describeCloudAccount(tenantId, cloudAccountId);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling CloudAccountsApi#describeCloudAccount");
            e.printStackTrace();
        }
    }
}
import io.swagger.client.api.CloudAccountsApi;

public class CloudAccountsApiExample {

    public static void main(String[] args) {
        CloudAccountsApi apiInstance = new CloudAccountsApi();
        String tenantId = tenantId_example; // String | Specify the tenant id to create cloud account which is a unique id can be retrieved using the list tenant api.
        String cloudAccountId = cloudAccountId_example; // String | Specify the cloud account id to update, cloud account id is unique can be obtained from the list cloud account api.
        try {
            CloudAccountDescribeResponse result = apiInstance.describeCloudAccount(tenantId, cloudAccountId);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling CloudAccountsApi#describeCloudAccount");
            e.printStackTrace();
        }
    }
}
Configuration *apiConfig = [Configuration sharedConfig];

// Configure API key authorization: (authentication scheme: auth_token)
[apiConfig setApiKey:@"YOUR_API_KEY" forApiKeyIdentifier:@"X-Auth-Token"];
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
//[apiConfig setApiKeyPrefix:@"Bearer" forApiKeyIdentifier:@"X-Auth-Token"];

// Configure API key authorization: (authentication scheme: auth_user)
[apiConfig setApiKey:@"YOUR_API_KEY" forApiKeyIdentifier:@"X-Auth-User"];
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
//[apiConfig setApiKeyPrefix:@"Bearer" forApiKeyIdentifier:@"X-Auth-User"];

String *tenantId = tenantId_example; // Specify the tenant id to create cloud account which is a unique id can be retrieved using the list tenant api.
String *cloudAccountId = cloudAccountId_example; // Specify the cloud account id to update, cloud account id is unique can be obtained from the list cloud account api.

CloudAccountsApi *apiInstance = [[CloudAccountsApi alloc] init];

[apiInstance describeCloudAccountWith:tenantId
    cloudAccountId:cloudAccountId
              completionHandler: ^(CloudAccountDescribeResponse output, NSError* error) {
                            if (output) {
                                NSLog(@"%@", output);
                            }
                            if (error) {
                                NSLog(@"Error: %@", error);
                            }
                        }];
var CorestackExternalApi = require('corestack_external_api');
var defaultClient = CorestackExternalApi.ApiClient.instance;

// Configure API key authorization: auth_token
var auth_token = defaultClient.authentications['auth_token'];
auth_token.apiKey = "YOUR API KEY"
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//auth_token.apiKeyPrefix['X-Auth-Token'] = "Token"

// Configure API key authorization: auth_user
var auth_user = defaultClient.authentications['auth_user'];
auth_user.apiKey = "YOUR API KEY"
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//auth_user.apiKeyPrefix['X-Auth-User'] = "Token"

var api = new CorestackExternalApi.CloudAccountsApi()

var tenantId = tenantId_example; // {String} Specify the tenant id to create cloud account which is a unique id can be retrieved using the list tenant api.

var cloudAccountId = cloudAccountId_example; // {String} Specify the cloud account id to update, cloud account id is unique can be obtained from the list cloud account api.


var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
api.describeCloudAccount(tenantId, cloudAccountId, callback);
using System;
using System.Diagnostics;
using IO.Swagger.Api;
using IO.Swagger.Client;
using IO.Swagger.Model;

namespace Example
{
    public class describeCloudAccountExample
    {
        public void main()
        {
            
            // Configure API key authorization: auth_token
            Configuration.Default.ApiKey.Add("X-Auth-Token", "YOUR_API_KEY");
            // Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
            // Configuration.Default.ApiKeyPrefix.Add("X-Auth-Token", "Bearer");
            // Configure API key authorization: auth_user
            Configuration.Default.ApiKey.Add("X-Auth-User", "YOUR_API_KEY");
            // Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
            // Configuration.Default.ApiKeyPrefix.Add("X-Auth-User", "Bearer");

            var apiInstance = new CloudAccountsApi();
            var tenantId = tenantId_example;  // String | Specify the tenant id to create cloud account which is a unique id can be retrieved using the list tenant api.
            var cloudAccountId = cloudAccountId_example;  // String | Specify the cloud account id to update, cloud account id is unique can be obtained from the list cloud account api.

            try
            {
                CloudAccountDescribeResponse result = apiInstance.describeCloudAccount(tenantId, cloudAccountId);
                Debug.WriteLine(result);
            }
            catch (Exception e)
            {
                Debug.Print("Exception when calling CloudAccountsApi.describeCloudAccount: " + e.Message );
            }
        }
    }
}
<?php
require_once(__DIR__ . '/vendor/autoload.php');

// Configure API key authorization: auth_token
Swagger\Client\Configuration::getDefaultConfiguration()->setApiKey('X-Auth-Token', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// Swagger\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('X-Auth-Token', 'Bearer');
// Configure API key authorization: auth_user
Swagger\Client\Configuration::getDefaultConfiguration()->setApiKey('X-Auth-User', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// Swagger\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('X-Auth-User', 'Bearer');

$api_instance = new Swagger\Client\Api\CloudAccountsApi();
$tenantId = tenantId_example; // String | Specify the tenant id to create cloud account which is a unique id can be retrieved using the list tenant api.
$cloudAccountId = cloudAccountId_example; // String | Specify the cloud account id to update, cloud account id is unique can be obtained from the list cloud account api.

try {
    $result = $api_instance->describeCloudAccount($tenantId, $cloudAccountId);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling CloudAccountsApi->describeCloudAccount: ', $e->getMessage(), PHP_EOL;
}
?>
use Data::Dumper;
use WWW::SwaggerClient::Configuration;
use WWW::SwaggerClient::CloudAccountsApi;

# Configure API key authorization: auth_token
$WWW::SwaggerClient::Configuration::api_key->{'X-Auth-Token'} = 'YOUR_API_KEY';
# uncomment below to setup prefix (e.g. Bearer) for API key, if needed
#$WWW::SwaggerClient::Configuration::api_key_prefix->{'X-Auth-Token'} = "Bearer";
# Configure API key authorization: auth_user
$WWW::SwaggerClient::Configuration::api_key->{'X-Auth-User'} = 'YOUR_API_KEY';
# uncomment below to setup prefix (e.g. Bearer) for API key, if needed
#$WWW::SwaggerClient::Configuration::api_key_prefix->{'X-Auth-User'} = "Bearer";

my $api_instance = WWW::SwaggerClient::CloudAccountsApi->new();
my $tenantId = tenantId_example; # String | Specify the tenant id to create cloud account which is a unique id can be retrieved using the list tenant api.
my $cloudAccountId = cloudAccountId_example; # String | Specify the cloud account id to update, cloud account id is unique can be obtained from the list cloud account api.

eval { 
    my $result = $api_instance->describeCloudAccount(tenantId => $tenantId, cloudAccountId => $cloudAccountId);
    print Dumper($result);
};
if ($@) {
    warn "Exception when calling CloudAccountsApi->describeCloudAccount: $@\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: auth_token
swagger_client.configuration.api_key['X-Auth-Token'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# swagger_client.configuration.api_key_prefix['X-Auth-Token'] = 'Bearer'
# Configure API key authorization: auth_user
swagger_client.configuration.api_key['X-Auth-User'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# swagger_client.configuration.api_key_prefix['X-Auth-User'] = 'Bearer'

# create an instance of the API class
api_instance = swagger_client.CloudAccountsApi()
tenantId = tenantId_example # String | Specify the tenant id to create cloud account which is a unique id can be retrieved using the list tenant api.
cloudAccountId = cloudAccountId_example # String | Specify the cloud account id to update, cloud account id is unique can be obtained from the list cloud account api.

try: 
    api_response = api_instance.describe_cloud_account(tenantId, cloudAccountId)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling CloudAccountsApi->describeCloudAccount: %s\n" % e)

Parameters

Path parameters
Name Description
tenant_id*
String
Specify the tenant id to create cloud account which is a unique id can be retrieved using the list tenant api.
Required
cloud_account_id*
String
Specify the cloud account id to update, cloud account id is unique can be obtained from the list cloud account api.
Required

Responses

Status: 200 - Success

Status: 400 - Bad Request

Status: 401 - Unauthorized

Status: 500 - Internal Server Error


listCloudAccounts

List all cloud accounts for a given tenant.


/v1/{tenant_id}/cloud_accounts

Usage and SDK Samples

curl -X GET -H "X-Auth-Token: [[apiKey]]" -H "X-Auth-User: [[apiKey]]" "https://localhost/v1/{tenant_id}/cloud_accounts"
import io.swagger.client.*;
import io.swagger.client.auth.*;
import io.swagger.client.model.*;
import io.swagger.client.api.CloudAccountsApi;

import java.io.File;
import java.util.*;

public class CloudAccountsApiExample {

    public static void main(String[] args) {
        ApiClient defaultClient = Configuration.getDefaultApiClient();
        
        // Configure API key authorization: auth_token
        ApiKeyAuth auth_token = (ApiKeyAuth) defaultClient.getAuthentication("auth_token");
        auth_token.setApiKey("YOUR API KEY");
        // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
        //auth_token.setApiKeyPrefix("Token");

        // Configure API key authorization: auth_user
        ApiKeyAuth auth_user = (ApiKeyAuth) defaultClient.getAuthentication("auth_user");
        auth_user.setApiKey("YOUR API KEY");
        // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
        //auth_user.setApiKeyPrefix("Token");

        CloudAccountsApi apiInstance = new CloudAccountsApi();
        String tenantId = tenantId_example; // String | Specify the tenant id to create cloud account which is a unique id can be retrieved using the list tenant api.
        try {
            CloudAccountListResponse result = apiInstance.listCloudAccounts(tenantId);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling CloudAccountsApi#listCloudAccounts");
            e.printStackTrace();
        }
    }
}
import io.swagger.client.api.CloudAccountsApi;

public class CloudAccountsApiExample {

    public static void main(String[] args) {
        CloudAccountsApi apiInstance = new CloudAccountsApi();
        String tenantId = tenantId_example; // String | Specify the tenant id to create cloud account which is a unique id can be retrieved using the list tenant api.
        try {
            CloudAccountListResponse result = apiInstance.listCloudAccounts(tenantId);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling CloudAccountsApi#listCloudAccounts");
            e.printStackTrace();
        }
    }
}
Configuration *apiConfig = [Configuration sharedConfig];

// Configure API key authorization: (authentication scheme: auth_token)
[apiConfig setApiKey:@"YOUR_API_KEY" forApiKeyIdentifier:@"X-Auth-Token"];
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
//[apiConfig setApiKeyPrefix:@"Bearer" forApiKeyIdentifier:@"X-Auth-Token"];

// Configure API key authorization: (authentication scheme: auth_user)
[apiConfig setApiKey:@"YOUR_API_KEY" forApiKeyIdentifier:@"X-Auth-User"];
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
//[apiConfig setApiKeyPrefix:@"Bearer" forApiKeyIdentifier:@"X-Auth-User"];

String *tenantId = tenantId_example; // Specify the tenant id to create cloud account which is a unique id can be retrieved using the list tenant api.

CloudAccountsApi *apiInstance = [[CloudAccountsApi alloc] init];

[apiInstance listCloudAccountsWith:tenantId
              completionHandler: ^(CloudAccountListResponse output, NSError* error) {
                            if (output) {
                                NSLog(@"%@", output);
                            }
                            if (error) {
                                NSLog(@"Error: %@", error);
                            }
                        }];
var CorestackExternalApi = require('corestack_external_api');
var defaultClient = CorestackExternalApi.ApiClient.instance;

// Configure API key authorization: auth_token
var auth_token = defaultClient.authentications['auth_token'];
auth_token.apiKey = "YOUR API KEY"
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//auth_token.apiKeyPrefix['X-Auth-Token'] = "Token"

// Configure API key authorization: auth_user
var auth_user = defaultClient.authentications['auth_user'];
auth_user.apiKey = "YOUR API KEY"
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//auth_user.apiKeyPrefix['X-Auth-User'] = "Token"

var api = new CorestackExternalApi.CloudAccountsApi()

var tenantId = tenantId_example; // {String} Specify the tenant id to create cloud account which is a unique id can be retrieved using the list tenant api.


var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
api.listCloudAccounts(tenantId, callback);
using System;
using System.Diagnostics;
using IO.Swagger.Api;
using IO.Swagger.Client;
using IO.Swagger.Model;

namespace Example
{
    public class listCloudAccountsExample
    {
        public void main()
        {
            
            // Configure API key authorization: auth_token
            Configuration.Default.ApiKey.Add("X-Auth-Token", "YOUR_API_KEY");
            // Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
            // Configuration.Default.ApiKeyPrefix.Add("X-Auth-Token", "Bearer");
            // Configure API key authorization: auth_user
            Configuration.Default.ApiKey.Add("X-Auth-User", "YOUR_API_KEY");
            // Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
            // Configuration.Default.ApiKeyPrefix.Add("X-Auth-User", "Bearer");

            var apiInstance = new CloudAccountsApi();
            var tenantId = tenantId_example;  // String | Specify the tenant id to create cloud account which is a unique id can be retrieved using the list tenant api.

            try
            {
                CloudAccountListResponse result = apiInstance.listCloudAccounts(tenantId);
                Debug.WriteLine(result);
            }
            catch (Exception e)
            {
                Debug.Print("Exception when calling CloudAccountsApi.listCloudAccounts: " + e.Message );
            }
        }
    }
}
<?php
require_once(__DIR__ . '/vendor/autoload.php');

// Configure API key authorization: auth_token
Swagger\Client\Configuration::getDefaultConfiguration()->setApiKey('X-Auth-Token', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// Swagger\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('X-Auth-Token', 'Bearer');
// Configure API key authorization: auth_user
Swagger\Client\Configuration::getDefaultConfiguration()->setApiKey('X-Auth-User', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// Swagger\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('X-Auth-User', 'Bearer');

$api_instance = new Swagger\Client\Api\CloudAccountsApi();
$tenantId = tenantId_example; // String | Specify the tenant id to create cloud account which is a unique id can be retrieved using the list tenant api.

try {
    $result = $api_instance->listCloudAccounts($tenantId);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling CloudAccountsApi->listCloudAccounts: ', $e->getMessage(), PHP_EOL;
}
?>
use Data::Dumper;
use WWW::SwaggerClient::Configuration;
use WWW::SwaggerClient::CloudAccountsApi;

# Configure API key authorization: auth_token
$WWW::SwaggerClient::Configuration::api_key->{'X-Auth-Token'} = 'YOUR_API_KEY';
# uncomment below to setup prefix (e.g. Bearer) for API key, if needed
#$WWW::SwaggerClient::Configuration::api_key_prefix->{'X-Auth-Token'} = "Bearer";
# Configure API key authorization: auth_user
$WWW::SwaggerClient::Configuration::api_key->{'X-Auth-User'} = 'YOUR_API_KEY';
# uncomment below to setup prefix (e.g. Bearer) for API key, if needed
#$WWW::SwaggerClient::Configuration::api_key_prefix->{'X-Auth-User'} = "Bearer";

my $api_instance = WWW::SwaggerClient::CloudAccountsApi->new();
my $tenantId = tenantId_example; # String | Specify the tenant id to create cloud account which is a unique id can be retrieved using the list tenant api.

eval { 
    my $result = $api_instance->listCloudAccounts(tenantId => $tenantId);
    print Dumper($result);
};
if ($@) {
    warn "Exception when calling CloudAccountsApi->listCloudAccounts: $@\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: auth_token
swagger_client.configuration.api_key['X-Auth-Token'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# swagger_client.configuration.api_key_prefix['X-Auth-Token'] = 'Bearer'
# Configure API key authorization: auth_user
swagger_client.configuration.api_key['X-Auth-User'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# swagger_client.configuration.api_key_prefix['X-Auth-User'] = 'Bearer'

# create an instance of the API class
api_instance = swagger_client.CloudAccountsApi()
tenantId = tenantId_example # String | Specify the tenant id to create cloud account which is a unique id can be retrieved using the list tenant api.

try: 
    api_response = api_instance.list_cloud_accounts(tenantId)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling CloudAccountsApi->listCloudAccounts: %s\n" % e)

Parameters

Path parameters
Name Description
tenant_id*
String
Specify the tenant id to create cloud account which is a unique id can be retrieved using the list tenant api.
Required

Responses

Status: 200 - Success

Status: 400 - Bad Request

Status: 401 - Unauthorized

Status: 500 - Internal Server Error


reDiscoverResources

Triggering Rediscover action will synch all the resources(Created/Deleted/Modified) of the target Cloud account with CoreStack Inventory. Based on the number of resources available in the Subscription and the number of regions managed through CoreStack, rediscovery might take sometime couple of hours.


/v1/{tenant_id}/cloud_accounts/{cloud_account_id}/rediscover

Usage and SDK Samples

curl -X GET -H "X-Auth-Token: [[apiKey]]" -H "X-Auth-User: [[apiKey]]" "https://localhost/v1/{tenant_id}/cloud_accounts/{cloud_account_id}/rediscover"
import io.swagger.client.*;
import io.swagger.client.auth.*;
import io.swagger.client.model.*;
import io.swagger.client.api.CloudAccountsApi;

import java.io.File;
import java.util.*;

public class CloudAccountsApiExample {

    public static void main(String[] args) {
        ApiClient defaultClient = Configuration.getDefaultApiClient();
        
        // Configure API key authorization: auth_token
        ApiKeyAuth auth_token = (ApiKeyAuth) defaultClient.getAuthentication("auth_token");
        auth_token.setApiKey("YOUR API KEY");
        // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
        //auth_token.setApiKeyPrefix("Token");

        // Configure API key authorization: auth_user
        ApiKeyAuth auth_user = (ApiKeyAuth) defaultClient.getAuthentication("auth_user");
        auth_user.setApiKey("YOUR API KEY");
        // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
        //auth_user.setApiKeyPrefix("Token");

        CloudAccountsApi apiInstance = new CloudAccountsApi();
        String tenantId = tenantId_example; // String | 
        String cloudAccountId = cloudAccountId_example; // String | 
        try {
            CloudAccountRediscoverResponse result = apiInstance.reDiscoverResources(tenantId, cloudAccountId);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling CloudAccountsApi#reDiscoverResources");
            e.printStackTrace();
        }
    }
}
import io.swagger.client.api.CloudAccountsApi;

public class CloudAccountsApiExample {

    public static void main(String[] args) {
        CloudAccountsApi apiInstance = new CloudAccountsApi();
        String tenantId = tenantId_example; // String | 
        String cloudAccountId = cloudAccountId_example; // String | 
        try {
            CloudAccountRediscoverResponse result = apiInstance.reDiscoverResources(tenantId, cloudAccountId);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling CloudAccountsApi#reDiscoverResources");
            e.printStackTrace();
        }
    }
}
Configuration *apiConfig = [Configuration sharedConfig];

// Configure API key authorization: (authentication scheme: auth_token)
[apiConfig setApiKey:@"YOUR_API_KEY" forApiKeyIdentifier:@"X-Auth-Token"];
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
//[apiConfig setApiKeyPrefix:@"Bearer" forApiKeyIdentifier:@"X-Auth-Token"];

// Configure API key authorization: (authentication scheme: auth_user)
[apiConfig setApiKey:@"YOUR_API_KEY" forApiKeyIdentifier:@"X-Auth-User"];
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
//[apiConfig setApiKeyPrefix:@"Bearer" forApiKeyIdentifier:@"X-Auth-User"];

String *tenantId = tenantId_example; // 
String *cloudAccountId = cloudAccountId_example; // 

CloudAccountsApi *apiInstance = [[CloudAccountsApi alloc] init];

[apiInstance reDiscoverResourcesWith:tenantId
    cloudAccountId:cloudAccountId
              completionHandler: ^(CloudAccountRediscoverResponse output, NSError* error) {
                            if (output) {
                                NSLog(@"%@", output);
                            }
                            if (error) {
                                NSLog(@"Error: %@", error);
                            }
                        }];
var CorestackExternalApi = require('corestack_external_api');
var defaultClient = CorestackExternalApi.ApiClient.instance;

// Configure API key authorization: auth_token
var auth_token = defaultClient.authentications['auth_token'];
auth_token.apiKey = "YOUR API KEY"
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//auth_token.apiKeyPrefix['X-Auth-Token'] = "Token"

// Configure API key authorization: auth_user
var auth_user = defaultClient.authentications['auth_user'];
auth_user.apiKey = "YOUR API KEY"
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//auth_user.apiKeyPrefix['X-Auth-User'] = "Token"

var api = new CorestackExternalApi.CloudAccountsApi()

var tenantId = tenantId_example; // {String} 

var cloudAccountId = cloudAccountId_example; // {String} 


var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
api.reDiscoverResources(tenantId, cloudAccountId, callback);
using System;
using System.Diagnostics;
using IO.Swagger.Api;
using IO.Swagger.Client;
using IO.Swagger.Model;

namespace Example
{
    public class reDiscoverResourcesExample
    {
        public void main()
        {
            
            // Configure API key authorization: auth_token
            Configuration.Default.ApiKey.Add("X-Auth-Token", "YOUR_API_KEY");
            // Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
            // Configuration.Default.ApiKeyPrefix.Add("X-Auth-Token", "Bearer");
            // Configure API key authorization: auth_user
            Configuration.Default.ApiKey.Add("X-Auth-User", "YOUR_API_KEY");
            // Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
            // Configuration.Default.ApiKeyPrefix.Add("X-Auth-User", "Bearer");

            var apiInstance = new CloudAccountsApi();
            var tenantId = tenantId_example;  // String | 
            var cloudAccountId = cloudAccountId_example;  // String | 

            try
            {
                CloudAccountRediscoverResponse result = apiInstance.reDiscoverResources(tenantId, cloudAccountId);
                Debug.WriteLine(result);
            }
            catch (Exception e)
            {
                Debug.Print("Exception when calling CloudAccountsApi.reDiscoverResources: " + e.Message );
            }
        }
    }
}
<?php
require_once(__DIR__ . '/vendor/autoload.php');

// Configure API key authorization: auth_token
Swagger\Client\Configuration::getDefaultConfiguration()->setApiKey('X-Auth-Token', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// Swagger\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('X-Auth-Token', 'Bearer');
// Configure API key authorization: auth_user
Swagger\Client\Configuration::getDefaultConfiguration()->setApiKey('X-Auth-User', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// Swagger\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('X-Auth-User', 'Bearer');

$api_instance = new Swagger\Client\Api\CloudAccountsApi();
$tenantId = tenantId_example; // String | 
$cloudAccountId = cloudAccountId_example; // String | 

try {
    $result = $api_instance->reDiscoverResources($tenantId, $cloudAccountId);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling CloudAccountsApi->reDiscoverResources: ', $e->getMessage(), PHP_EOL;
}
?>
use Data::Dumper;
use WWW::SwaggerClient::Configuration;
use WWW::SwaggerClient::CloudAccountsApi;

# Configure API key authorization: auth_token
$WWW::SwaggerClient::Configuration::api_key->{'X-Auth-Token'} = 'YOUR_API_KEY';
# uncomment below to setup prefix (e.g. Bearer) for API key, if needed
#$WWW::SwaggerClient::Configuration::api_key_prefix->{'X-Auth-Token'} = "Bearer";
# Configure API key authorization: auth_user
$WWW::SwaggerClient::Configuration::api_key->{'X-Auth-User'} = 'YOUR_API_KEY';
# uncomment below to setup prefix (e.g. Bearer) for API key, if needed
#$WWW::SwaggerClient::Configuration::api_key_prefix->{'X-Auth-User'} = "Bearer";

my $api_instance = WWW::SwaggerClient::CloudAccountsApi->new();
my $tenantId = tenantId_example; # String | 
my $cloudAccountId = cloudAccountId_example; # String | 

eval { 
    my $result = $api_instance->reDiscoverResources(tenantId => $tenantId, cloudAccountId => $cloudAccountId);
    print Dumper($result);
};
if ($@) {
    warn "Exception when calling CloudAccountsApi->reDiscoverResources: $@\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: auth_token
swagger_client.configuration.api_key['X-Auth-Token'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# swagger_client.configuration.api_key_prefix['X-Auth-Token'] = 'Bearer'
# Configure API key authorization: auth_user
swagger_client.configuration.api_key['X-Auth-User'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# swagger_client.configuration.api_key_prefix['X-Auth-User'] = 'Bearer'

# create an instance of the API class
api_instance = swagger_client.CloudAccountsApi()
tenantId = tenantId_example # String | 
cloudAccountId = cloudAccountId_example # String | 

try: 
    api_response = api_instance.re_discover_resources(tenantId, cloudAccountId)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling CloudAccountsApi->reDiscoverResources: %s\n" % e)

Parameters

Path parameters
Name Description
tenant_id*
String
Required
cloud_account_id*
String
Required

Responses

Status: 200 - Success

Status: 400 - Bad Request

Status: 401 - Unauthorized

Status: 500 - Internal Server Error


updateCloudAccount

Updates the existing AWS cloud account created with access_key authentication for a given tenant. It is possible to change the authentication protocol from Access Key to Assume Role and vice versa. Use this method to update cloud account with Access Key authentication. For details to use Assume Role refer to method 'updateCloudAccountAssumeRole'.


/v1/{tenant_id}/cloud_accounts/{cloud_account_id}

Usage and SDK Samples

curl -X PUT -H "X-Auth-Token: [[apiKey]]" -H "X-Auth-User: [[apiKey]]" "https://localhost/v1/{tenant_id}/cloud_accounts/{cloud_account_id}"
import io.swagger.client.*;
import io.swagger.client.auth.*;
import io.swagger.client.model.*;
import io.swagger.client.api.CloudAccountsApi;

import java.io.File;
import java.util.*;

public class CloudAccountsApiExample {

    public static void main(String[] args) {
        ApiClient defaultClient = Configuration.getDefaultApiClient();
        
        // Configure API key authorization: auth_token
        ApiKeyAuth auth_token = (ApiKeyAuth) defaultClient.getAuthentication("auth_token");
        auth_token.setApiKey("YOUR API KEY");
        // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
        //auth_token.setApiKeyPrefix("Token");

        // Configure API key authorization: auth_user
        ApiKeyAuth auth_user = (ApiKeyAuth) defaultClient.getAuthentication("auth_user");
        auth_user.setApiKey("YOUR API KEY");
        // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
        //auth_user.setApiKeyPrefix("Token");

        CloudAccountsApi apiInstance = new CloudAccountsApi();
        String tenantId = tenantId_example; // String | Specify the tenant id to create cloud account which is a unique id can be retrieved using the list tenant api.
        String cloudAccountId = cloudAccountId_example; // String | Specify the cloud account id to update, cloud account id is unique can be obtained from the list cloud account api.
        CloudAccountUpdateRequest cloudAccountUpdateRequest = ; // CloudAccountUpdateRequest | 
        try {
            CloudAccountUpdateResponse result = apiInstance.updateCloudAccount(tenantId, cloudAccountId, cloudAccountUpdateRequest);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling CloudAccountsApi#updateCloudAccount");
            e.printStackTrace();
        }
    }
}
import io.swagger.client.api.CloudAccountsApi;

public class CloudAccountsApiExample {

    public static void main(String[] args) {
        CloudAccountsApi apiInstance = new CloudAccountsApi();
        String tenantId = tenantId_example; // String | Specify the tenant id to create cloud account which is a unique id can be retrieved using the list tenant api.
        String cloudAccountId = cloudAccountId_example; // String | Specify the cloud account id to update, cloud account id is unique can be obtained from the list cloud account api.
        CloudAccountUpdateRequest cloudAccountUpdateRequest = ; // CloudAccountUpdateRequest | 
        try {
            CloudAccountUpdateResponse result = apiInstance.updateCloudAccount(tenantId, cloudAccountId, cloudAccountUpdateRequest);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling CloudAccountsApi#updateCloudAccount");
            e.printStackTrace();
        }
    }
}
Configuration *apiConfig = [Configuration sharedConfig];

// Configure API key authorization: (authentication scheme: auth_token)
[apiConfig setApiKey:@"YOUR_API_KEY" forApiKeyIdentifier:@"X-Auth-Token"];
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
//[apiConfig setApiKeyPrefix:@"Bearer" forApiKeyIdentifier:@"X-Auth-Token"];

// Configure API key authorization: (authentication scheme: auth_user)
[apiConfig setApiKey:@"YOUR_API_KEY" forApiKeyIdentifier:@"X-Auth-User"];
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
//[apiConfig setApiKeyPrefix:@"Bearer" forApiKeyIdentifier:@"X-Auth-User"];

String *tenantId = tenantId_example; // Specify the tenant id to create cloud account which is a unique id can be retrieved using the list tenant api.
String *cloudAccountId = cloudAccountId_example; // Specify the cloud account id to update, cloud account id is unique can be obtained from the list cloud account api.
CloudAccountUpdateRequest *cloudAccountUpdateRequest = ; // 

CloudAccountsApi *apiInstance = [[CloudAccountsApi alloc] init];

[apiInstance updateCloudAccountWith:tenantId
    cloudAccountId:cloudAccountId
    cloudAccountUpdateRequest:cloudAccountUpdateRequest
              completionHandler: ^(CloudAccountUpdateResponse output, NSError* error) {
                            if (output) {
                                NSLog(@"%@", output);
                            }
                            if (error) {
                                NSLog(@"Error: %@", error);
                            }
                        }];
var CorestackExternalApi = require('corestack_external_api');
var defaultClient = CorestackExternalApi.ApiClient.instance;

// Configure API key authorization: auth_token
var auth_token = defaultClient.authentications['auth_token'];
auth_token.apiKey = "YOUR API KEY"
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//auth_token.apiKeyPrefix['X-Auth-Token'] = "Token"

// Configure API key authorization: auth_user
var auth_user = defaultClient.authentications['auth_user'];
auth_user.apiKey = "YOUR API KEY"
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//auth_user.apiKeyPrefix['X-Auth-User'] = "Token"

var api = new CorestackExternalApi.CloudAccountsApi()

var tenantId = tenantId_example; // {String} Specify the tenant id to create cloud account which is a unique id can be retrieved using the list tenant api.

var cloudAccountId = cloudAccountId_example; // {String} Specify the cloud account id to update, cloud account id is unique can be obtained from the list cloud account api.

var cloudAccountUpdateRequest = ; // {CloudAccountUpdateRequest} 


var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
api.updateCloudAccount(tenantId, cloudAccountId, cloudAccountUpdateRequest, callback);
using System;
using System.Diagnostics;
using IO.Swagger.Api;
using IO.Swagger.Client;
using IO.Swagger.Model;

namespace Example
{
    public class updateCloudAccountExample
    {
        public void main()
        {
            
            // Configure API key authorization: auth_token
            Configuration.Default.ApiKey.Add("X-Auth-Token", "YOUR_API_KEY");
            // Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
            // Configuration.Default.ApiKeyPrefix.Add("X-Auth-Token", "Bearer");
            // Configure API key authorization: auth_user
            Configuration.Default.ApiKey.Add("X-Auth-User", "YOUR_API_KEY");
            // Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
            // Configuration.Default.ApiKeyPrefix.Add("X-Auth-User", "Bearer");

            var apiInstance = new CloudAccountsApi();
            var tenantId = tenantId_example;  // String | Specify the tenant id to create cloud account which is a unique id can be retrieved using the list tenant api.
            var cloudAccountId = cloudAccountId_example;  // String | Specify the cloud account id to update, cloud account id is unique can be obtained from the list cloud account api.
            var cloudAccountUpdateRequest = new CloudAccountUpdateRequest(); // CloudAccountUpdateRequest | 

            try
            {
                CloudAccountUpdateResponse result = apiInstance.updateCloudAccount(tenantId, cloudAccountId, cloudAccountUpdateRequest);
                Debug.WriteLine(result);
            }
            catch (Exception e)
            {
                Debug.Print("Exception when calling CloudAccountsApi.updateCloudAccount: " + e.Message );
            }
        }
    }
}
<?php
require_once(__DIR__ . '/vendor/autoload.php');

// Configure API key authorization: auth_token
Swagger\Client\Configuration::getDefaultConfiguration()->setApiKey('X-Auth-Token', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// Swagger\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('X-Auth-Token', 'Bearer');
// Configure API key authorization: auth_user
Swagger\Client\Configuration::getDefaultConfiguration()->setApiKey('X-Auth-User', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// Swagger\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('X-Auth-User', 'Bearer');

$api_instance = new Swagger\Client\Api\CloudAccountsApi();
$tenantId = tenantId_example; // String | Specify the tenant id to create cloud account which is a unique id can be retrieved using the list tenant api.
$cloudAccountId = cloudAccountId_example; // String | Specify the cloud account id to update, cloud account id is unique can be obtained from the list cloud account api.
$cloudAccountUpdateRequest = ; // CloudAccountUpdateRequest | 

try {
    $result = $api_instance->updateCloudAccount($tenantId, $cloudAccountId, $cloudAccountUpdateRequest);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling CloudAccountsApi->updateCloudAccount: ', $e->getMessage(), PHP_EOL;
}
?>
use Data::Dumper;
use WWW::SwaggerClient::Configuration;
use WWW::SwaggerClient::CloudAccountsApi;

# Configure API key authorization: auth_token
$WWW::SwaggerClient::Configuration::api_key->{'X-Auth-Token'} = 'YOUR_API_KEY';
# uncomment below to setup prefix (e.g. Bearer) for API key, if needed
#$WWW::SwaggerClient::Configuration::api_key_prefix->{'X-Auth-Token'} = "Bearer";
# Configure API key authorization: auth_user
$WWW::SwaggerClient::Configuration::api_key->{'X-Auth-User'} = 'YOUR_API_KEY';
# uncomment below to setup prefix (e.g. Bearer) for API key, if needed
#$WWW::SwaggerClient::Configuration::api_key_prefix->{'X-Auth-User'} = "Bearer";

my $api_instance = WWW::SwaggerClient::CloudAccountsApi->new();
my $tenantId = tenantId_example; # String | Specify the tenant id to create cloud account which is a unique id can be retrieved using the list tenant api.
my $cloudAccountId = cloudAccountId_example; # String | Specify the cloud account id to update, cloud account id is unique can be obtained from the list cloud account api.
my $cloudAccountUpdateRequest = WWW::SwaggerClient::Object::CloudAccountUpdateRequest->new(); # CloudAccountUpdateRequest | 

eval { 
    my $result = $api_instance->updateCloudAccount(tenantId => $tenantId, cloudAccountId => $cloudAccountId, cloudAccountUpdateRequest => $cloudAccountUpdateRequest);
    print Dumper($result);
};
if ($@) {
    warn "Exception when calling CloudAccountsApi->updateCloudAccount: $@\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: auth_token
swagger_client.configuration.api_key['X-Auth-Token'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# swagger_client.configuration.api_key_prefix['X-Auth-Token'] = 'Bearer'
# Configure API key authorization: auth_user
swagger_client.configuration.api_key['X-Auth-User'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# swagger_client.configuration.api_key_prefix['X-Auth-User'] = 'Bearer'

# create an instance of the API class
api_instance = swagger_client.CloudAccountsApi()
tenantId = tenantId_example # String | Specify the tenant id to create cloud account which is a unique id can be retrieved using the list tenant api.
cloudAccountId = cloudAccountId_example # String | Specify the cloud account id to update, cloud account id is unique can be obtained from the list cloud account api.
cloudAccountUpdateRequest =  # CloudAccountUpdateRequest | 

try: 
    api_response = api_instance.update_cloud_account(tenantId, cloudAccountId, cloudAccountUpdateRequest)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling CloudAccountsApi->updateCloudAccount: %s\n" % e)

Parameters

Path parameters
Name Description
tenant_id*
String
Specify the tenant id to create cloud account which is a unique id can be retrieved using the list tenant api.
Required
cloud_account_id*
String
Specify the cloud account id to update, cloud account id is unique can be obtained from the list cloud account api.
Required
Body parameters
Name Description
cloudAccountUpdateRequest *

Responses

Status: 200 - Success

Status: 400 - Bad Request

Status: 401 - Unauthorized

Status: 500 - Internal Server Error


updateCloudAccountAssumeRole

Updates the existing AWS cloud account created with assume_role authentication for a given tenant. It is possible to change the authentication protocol from Assume Role to Access Key and vice versa. Use this method to update cloud account with Assume Role authentication. For details to use Access Key refer to method 'updateCloudAccount'.


/v1/{tenant_id}/cloud_accounts/{cloud_account_id}/assume_role

Usage and SDK Samples

curl -X PUT -H "X-Auth-Token: [[apiKey]]" -H "X-Auth-User: [[apiKey]]" "https://localhost/v1/{tenant_id}/cloud_accounts/{cloud_account_id}/assume_role"
import io.swagger.client.*;
import io.swagger.client.auth.*;
import io.swagger.client.model.*;
import io.swagger.client.api.CloudAccountsApi;

import java.io.File;
import java.util.*;

public class CloudAccountsApiExample {

    public static void main(String[] args) {
        ApiClient defaultClient = Configuration.getDefaultApiClient();
        
        // Configure API key authorization: auth_token
        ApiKeyAuth auth_token = (ApiKeyAuth) defaultClient.getAuthentication("auth_token");
        auth_token.setApiKey("YOUR API KEY");
        // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
        //auth_token.setApiKeyPrefix("Token");

        // Configure API key authorization: auth_user
        ApiKeyAuth auth_user = (ApiKeyAuth) defaultClient.getAuthentication("auth_user");
        auth_user.setApiKey("YOUR API KEY");
        // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
        //auth_user.setApiKeyPrefix("Token");

        CloudAccountsApi apiInstance = new CloudAccountsApi();
        String tenantId = tenantId_example; // String | Specify the tenant id to create cloud account which is a unique id can be retrieved using the list tenant api.
        String cloudAccountId = cloudAccountId_example; // String | Specify the cloud account id to update, cloud account id is unique can be obtained from the list cloud account api.
        CloudAccountAssumeRoleUpdateRequest cloudAccountAssumeRoleUpdateRequest = ; // CloudAccountAssumeRoleUpdateRequest | 
        try {
            CloudAccountUpdateResponse result = apiInstance.updateCloudAccountAssumeRole(tenantId, cloudAccountId, cloudAccountAssumeRoleUpdateRequest);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling CloudAccountsApi#updateCloudAccountAssumeRole");
            e.printStackTrace();
        }
    }
}
import io.swagger.client.api.CloudAccountsApi;

public class CloudAccountsApiExample {

    public static void main(String[] args) {
        CloudAccountsApi apiInstance = new CloudAccountsApi();
        String tenantId = tenantId_example; // String | Specify the tenant id to create cloud account which is a unique id can be retrieved using the list tenant api.
        String cloudAccountId = cloudAccountId_example; // String | Specify the cloud account id to update, cloud account id is unique can be obtained from the list cloud account api.
        CloudAccountAssumeRoleUpdateRequest cloudAccountAssumeRoleUpdateRequest = ; // CloudAccountAssumeRoleUpdateRequest | 
        try {
            CloudAccountUpdateResponse result = apiInstance.updateCloudAccountAssumeRole(tenantId, cloudAccountId, cloudAccountAssumeRoleUpdateRequest);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling CloudAccountsApi#updateCloudAccountAssumeRole");
            e.printStackTrace();
        }
    }
}
Configuration *apiConfig = [Configuration sharedConfig];

// Configure API key authorization: (authentication scheme: auth_token)
[apiConfig setApiKey:@"YOUR_API_KEY" forApiKeyIdentifier:@"X-Auth-Token"];
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
//[apiConfig setApiKeyPrefix:@"Bearer" forApiKeyIdentifier:@"X-Auth-Token"];

// Configure API key authorization: (authentication scheme: auth_user)
[apiConfig setApiKey:@"YOUR_API_KEY" forApiKeyIdentifier:@"X-Auth-User"];
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
//[apiConfig setApiKeyPrefix:@"Bearer" forApiKeyIdentifier:@"X-Auth-User"];

String *tenantId = tenantId_example; // Specify the tenant id to create cloud account which is a unique id can be retrieved using the list tenant api.
String *cloudAccountId = cloudAccountId_example; // Specify the cloud account id to update, cloud account id is unique can be obtained from the list cloud account api.
CloudAccountAssumeRoleUpdateRequest *cloudAccountAssumeRoleUpdateRequest = ; // 

CloudAccountsApi *apiInstance = [[CloudAccountsApi alloc] init];

[apiInstance updateCloudAccountAssumeRoleWith:tenantId
    cloudAccountId:cloudAccountId
    cloudAccountAssumeRoleUpdateRequest:cloudAccountAssumeRoleUpdateRequest
              completionHandler: ^(CloudAccountUpdateResponse output, NSError* error) {
                            if (output) {
                                NSLog(@"%@", output);
                            }
                            if (error) {
                                NSLog(@"Error: %@", error);
                            }
                        }];
var CorestackExternalApi = require('corestack_external_api');
var defaultClient = CorestackExternalApi.ApiClient.instance;

// Configure API key authorization: auth_token
var auth_token = defaultClient.authentications['auth_token'];
auth_token.apiKey = "YOUR API KEY"
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//auth_token.apiKeyPrefix['X-Auth-Token'] = "Token"

// Configure API key authorization: auth_user
var auth_user = defaultClient.authentications['auth_user'];
auth_user.apiKey = "YOUR API KEY"
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//auth_user.apiKeyPrefix['X-Auth-User'] = "Token"

var api = new CorestackExternalApi.CloudAccountsApi()

var tenantId = tenantId_example; // {String} Specify the tenant id to create cloud account which is a unique id can be retrieved using the list tenant api.

var cloudAccountId = cloudAccountId_example; // {String} Specify the cloud account id to update, cloud account id is unique can be obtained from the list cloud account api.

var cloudAccountAssumeRoleUpdateRequest = ; // {CloudAccountAssumeRoleUpdateRequest} 


var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
api.updateCloudAccountAssumeRole(tenantId, cloudAccountId, cloudAccountAssumeRoleUpdateRequest, callback);
using System;
using System.Diagnostics;
using IO.Swagger.Api;
using IO.Swagger.Client;
using IO.Swagger.Model;

namespace Example
{
    public class updateCloudAccountAssumeRoleExample
    {
        public void main()
        {
            
            // Configure API key authorization: auth_token
            Configuration.Default.ApiKey.Add("X-Auth-Token", "YOUR_API_KEY");
            // Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
            // Configuration.Default.ApiKeyPrefix.Add("X-Auth-Token", "Bearer");
            // Configure API key authorization: auth_user
            Configuration.Default.ApiKey.Add("X-Auth-User", "YOUR_API_KEY");
            // Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
            // Configuration.Default.ApiKeyPrefix.Add("X-Auth-User", "Bearer");

            var apiInstance = new CloudAccountsApi();
            var tenantId = tenantId_example;  // String | Specify the tenant id to create cloud account which is a unique id can be retrieved using the list tenant api.
            var cloudAccountId = cloudAccountId_example;  // String | Specify the cloud account id to update, cloud account id is unique can be obtained from the list cloud account api.
            var cloudAccountAssumeRoleUpdateRequest = new CloudAccountAssumeRoleUpdateRequest(); // CloudAccountAssumeRoleUpdateRequest | 

            try
            {
                CloudAccountUpdateResponse result = apiInstance.updateCloudAccountAssumeRole(tenantId, cloudAccountId, cloudAccountAssumeRoleUpdateRequest);
                Debug.WriteLine(result);
            }
            catch (Exception e)
            {
                Debug.Print("Exception when calling CloudAccountsApi.updateCloudAccountAssumeRole: " + e.Message );
            }
        }
    }
}
<?php
require_once(__DIR__ . '/vendor/autoload.php');

// Configure API key authorization: auth_token
Swagger\Client\Configuration::getDefaultConfiguration()->setApiKey('X-Auth-Token', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// Swagger\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('X-Auth-Token', 'Bearer');
// Configure API key authorization: auth_user
Swagger\Client\Configuration::getDefaultConfiguration()->setApiKey('X-Auth-User', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// Swagger\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('X-Auth-User', 'Bearer');

$api_instance = new Swagger\Client\Api\CloudAccountsApi();
$tenantId = tenantId_example; // String | Specify the tenant id to create cloud account which is a unique id can be retrieved using the list tenant api.
$cloudAccountId = cloudAccountId_example; // String | Specify the cloud account id to update, cloud account id is unique can be obtained from the list cloud account api.
$cloudAccountAssumeRoleUpdateRequest = ; // CloudAccountAssumeRoleUpdateRequest | 

try {
    $result = $api_instance->updateCloudAccountAssumeRole($tenantId, $cloudAccountId, $cloudAccountAssumeRoleUpdateRequest);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling CloudAccountsApi->updateCloudAccountAssumeRole: ', $e->getMessage(), PHP_EOL;
}
?>
use Data::Dumper;
use WWW::SwaggerClient::Configuration;
use WWW::SwaggerClient::CloudAccountsApi;

# Configure API key authorization: auth_token
$WWW::SwaggerClient::Configuration::api_key->{'X-Auth-Token'} = 'YOUR_API_KEY';
# uncomment below to setup prefix (e.g. Bearer) for API key, if needed
#$WWW::SwaggerClient::Configuration::api_key_prefix->{'X-Auth-Token'} = "Bearer";
# Configure API key authorization: auth_user
$WWW::SwaggerClient::Configuration::api_key->{'X-Auth-User'} = 'YOUR_API_KEY';
# uncomment below to setup prefix (e.g. Bearer) for API key, if needed
#$WWW::SwaggerClient::Configuration::api_key_prefix->{'X-Auth-User'} = "Bearer";

my $api_instance = WWW::SwaggerClient::CloudAccountsApi->new();
my $tenantId = tenantId_example; # String | Specify the tenant id to create cloud account which is a unique id can be retrieved using the list tenant api.
my $cloudAccountId = cloudAccountId_example; # String | Specify the cloud account id to update, cloud account id is unique can be obtained from the list cloud account api.
my $cloudAccountAssumeRoleUpdateRequest = WWW::SwaggerClient::Object::CloudAccountAssumeRoleUpdateRequest->new(); # CloudAccountAssumeRoleUpdateRequest | 

eval { 
    my $result = $api_instance->updateCloudAccountAssumeRole(tenantId => $tenantId, cloudAccountId => $cloudAccountId, cloudAccountAssumeRoleUpdateRequest => $cloudAccountAssumeRoleUpdateRequest);
    print Dumper($result);
};
if ($@) {
    warn "Exception when calling CloudAccountsApi->updateCloudAccountAssumeRole: $@\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: auth_token
swagger_client.configuration.api_key['X-Auth-Token'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# swagger_client.configuration.api_key_prefix['X-Auth-Token'] = 'Bearer'
# Configure API key authorization: auth_user
swagger_client.configuration.api_key['X-Auth-User'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# swagger_client.configuration.api_key_prefix['X-Auth-User'] = 'Bearer'

# create an instance of the API class
api_instance = swagger_client.CloudAccountsApi()
tenantId = tenantId_example # String | Specify the tenant id to create cloud account which is a unique id can be retrieved using the list tenant api.
cloudAccountId = cloudAccountId_example # String | Specify the cloud account id to update, cloud account id is unique can be obtained from the list cloud account api.
cloudAccountAssumeRoleUpdateRequest =  # CloudAccountAssumeRoleUpdateRequest | 

try: 
    api_response = api_instance.update_cloud_account_assume_role(tenantId, cloudAccountId, cloudAccountAssumeRoleUpdateRequest)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling CloudAccountsApi->updateCloudAccountAssumeRole: %s\n" % e)

Parameters

Path parameters
Name Description
tenant_id*
String
Specify the tenant id to create cloud account which is a unique id can be retrieved using the list tenant api.
Required
cloud_account_id*
String
Specify the cloud account id to update, cloud account id is unique can be obtained from the list cloud account api.
Required
Body parameters
Name Description
cloudAccountAssumeRoleUpdateRequest *

Responses

Status: 200 - Success

Status: 400 - Bad Request

Status: 401 - Unauthorized

Status: 500 - Internal Server Error


Inventory

getInventoryCount

Get inventory category count based on the cloud and cloud account will list categories & Get inventory resource count based on the cloud and cloud account will list all resources with resource_category, resource_type, resource and will list only the count on number of resources available in particular category


/v1/{tenant_id}/inventory/count

Usage and SDK Samples

curl -X POST -H "X-Auth-Token: [[apiKey]]" -H "X-Auth-User: [[apiKey]]" "https://localhost/v1/{tenant_id}/inventory/count?service_name="
import io.swagger.client.*;
import io.swagger.client.auth.*;
import io.swagger.client.model.*;
import io.swagger.client.api.InventoryApi;

import java.io.File;
import java.util.*;

public class InventoryApiExample {

    public static void main(String[] args) {
        ApiClient defaultClient = Configuration.getDefaultApiClient();
        
        // Configure API key authorization: auth_token
        ApiKeyAuth auth_token = (ApiKeyAuth) defaultClient.getAuthentication("auth_token");
        auth_token.setApiKey("YOUR API KEY");
        // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
        //auth_token.setApiKeyPrefix("Token");

        // Configure API key authorization: auth_user
        ApiKeyAuth auth_user = (ApiKeyAuth) defaultClient.getAuthentication("auth_user");
        auth_user.setApiKey("YOUR API KEY");
        // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
        //auth_user.setApiKeyPrefix("Token");

        InventoryApi apiInstance = new InventoryApi();
        String tenantId = tenantId_example; // String | Specify the tenant Id for the inventory
        CategoryCountRequest categoryCountRequest = ; // CategoryCountRequest | 
        String serviceName = serviceName_example; // String | Name of the cloud
        try {
            CategoryCountResponse result = apiInstance.getInventoryCount(tenantId, categoryCountRequest, serviceName);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling InventoryApi#getInventoryCount");
            e.printStackTrace();
        }
    }
}
import io.swagger.client.api.InventoryApi;

public class InventoryApiExample {

    public static void main(String[] args) {
        InventoryApi apiInstance = new InventoryApi();
        String tenantId = tenantId_example; // String | Specify the tenant Id for the inventory
        CategoryCountRequest categoryCountRequest = ; // CategoryCountRequest | 
        String serviceName = serviceName_example; // String | Name of the cloud
        try {
            CategoryCountResponse result = apiInstance.getInventoryCount(tenantId, categoryCountRequest, serviceName);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling InventoryApi#getInventoryCount");
            e.printStackTrace();
        }
    }
}
Configuration *apiConfig = [Configuration sharedConfig];

// Configure API key authorization: (authentication scheme: auth_token)
[apiConfig setApiKey:@"YOUR_API_KEY" forApiKeyIdentifier:@"X-Auth-Token"];
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
//[apiConfig setApiKeyPrefix:@"Bearer" forApiKeyIdentifier:@"X-Auth-Token"];

// Configure API key authorization: (authentication scheme: auth_user)
[apiConfig setApiKey:@"YOUR_API_KEY" forApiKeyIdentifier:@"X-Auth-User"];
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
//[apiConfig setApiKeyPrefix:@"Bearer" forApiKeyIdentifier:@"X-Auth-User"];

String *tenantId = tenantId_example; // Specify the tenant Id for the inventory
CategoryCountRequest *categoryCountRequest = ; // 
String *serviceName = serviceName_example; // Name of the cloud (optional) (default to AWS)

InventoryApi *apiInstance = [[InventoryApi alloc] init];

[apiInstance getInventoryCountWith:tenantId
    categoryCountRequest:categoryCountRequest
    serviceName:serviceName
              completionHandler: ^(CategoryCountResponse output, NSError* error) {
                            if (output) {
                                NSLog(@"%@", output);
                            }
                            if (error) {
                                NSLog(@"Error: %@", error);
                            }
                        }];
var CorestackExternalApi = require('corestack_external_api');
var defaultClient = CorestackExternalApi.ApiClient.instance;

// Configure API key authorization: auth_token
var auth_token = defaultClient.authentications['auth_token'];
auth_token.apiKey = "YOUR API KEY"
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//auth_token.apiKeyPrefix['X-Auth-Token'] = "Token"

// Configure API key authorization: auth_user
var auth_user = defaultClient.authentications['auth_user'];
auth_user.apiKey = "YOUR API KEY"
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//auth_user.apiKeyPrefix['X-Auth-User'] = "Token"

var api = new CorestackExternalApi.InventoryApi()

var tenantId = tenantId_example; // {String} Specify the tenant Id for the inventory

var categoryCountRequest = ; // {CategoryCountRequest} 

var opts = { 
  'serviceName': serviceName_example // {String} Name of the cloud
};

var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
api.getInventoryCount(tenantId, categoryCountRequest, opts, callback);
using System;
using System.Diagnostics;
using IO.Swagger.Api;
using IO.Swagger.Client;
using IO.Swagger.Model;

namespace Example
{
    public class getInventoryCountExample
    {
        public void main()
        {
            
            // Configure API key authorization: auth_token
            Configuration.Default.ApiKey.Add("X-Auth-Token", "YOUR_API_KEY");
            // Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
            // Configuration.Default.ApiKeyPrefix.Add("X-Auth-Token", "Bearer");
            // Configure API key authorization: auth_user
            Configuration.Default.ApiKey.Add("X-Auth-User", "YOUR_API_KEY");
            // Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
            // Configuration.Default.ApiKeyPrefix.Add("X-Auth-User", "Bearer");

            var apiInstance = new InventoryApi();
            var tenantId = tenantId_example;  // String | Specify the tenant Id for the inventory
            var categoryCountRequest = new CategoryCountRequest(); // CategoryCountRequest | 
            var serviceName = serviceName_example;  // String | Name of the cloud (optional)  (default to AWS)

            try
            {
                CategoryCountResponse result = apiInstance.getInventoryCount(tenantId, categoryCountRequest, serviceName);
                Debug.WriteLine(result);
            }
            catch (Exception e)
            {
                Debug.Print("Exception when calling InventoryApi.getInventoryCount: " + e.Message );
            }
        }
    }
}
<?php
require_once(__DIR__ . '/vendor/autoload.php');

// Configure API key authorization: auth_token
Swagger\Client\Configuration::getDefaultConfiguration()->setApiKey('X-Auth-Token', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// Swagger\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('X-Auth-Token', 'Bearer');
// Configure API key authorization: auth_user
Swagger\Client\Configuration::getDefaultConfiguration()->setApiKey('X-Auth-User', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// Swagger\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('X-Auth-User', 'Bearer');

$api_instance = new Swagger\Client\Api\InventoryApi();
$tenantId = tenantId_example; // String | Specify the tenant Id for the inventory
$categoryCountRequest = ; // CategoryCountRequest | 
$serviceName = serviceName_example; // String | Name of the cloud

try {
    $result = $api_instance->getInventoryCount($tenantId, $categoryCountRequest, $serviceName);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling InventoryApi->getInventoryCount: ', $e->getMessage(), PHP_EOL;
}
?>
use Data::Dumper;
use WWW::SwaggerClient::Configuration;
use WWW::SwaggerClient::InventoryApi;

# Configure API key authorization: auth_token
$WWW::SwaggerClient::Configuration::api_key->{'X-Auth-Token'} = 'YOUR_API_KEY';
# uncomment below to setup prefix (e.g. Bearer) for API key, if needed
#$WWW::SwaggerClient::Configuration::api_key_prefix->{'X-Auth-Token'} = "Bearer";
# Configure API key authorization: auth_user
$WWW::SwaggerClient::Configuration::api_key->{'X-Auth-User'} = 'YOUR_API_KEY';
# uncomment below to setup prefix (e.g. Bearer) for API key, if needed
#$WWW::SwaggerClient::Configuration::api_key_prefix->{'X-Auth-User'} = "Bearer";

my $api_instance = WWW::SwaggerClient::InventoryApi->new();
my $tenantId = tenantId_example; # String | Specify the tenant Id for the inventory
my $categoryCountRequest = WWW::SwaggerClient::Object::CategoryCountRequest->new(); # CategoryCountRequest | 
my $serviceName = serviceName_example; # String | Name of the cloud

eval { 
    my $result = $api_instance->getInventoryCount(tenantId => $tenantId, categoryCountRequest => $categoryCountRequest, serviceName => $serviceName);
    print Dumper($result);
};
if ($@) {
    warn "Exception when calling InventoryApi->getInventoryCount: $@\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: auth_token
swagger_client.configuration.api_key['X-Auth-Token'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# swagger_client.configuration.api_key_prefix['X-Auth-Token'] = 'Bearer'
# Configure API key authorization: auth_user
swagger_client.configuration.api_key['X-Auth-User'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# swagger_client.configuration.api_key_prefix['X-Auth-User'] = 'Bearer'

# create an instance of the API class
api_instance = swagger_client.InventoryApi()
tenantId = tenantId_example # String | Specify the tenant Id for the inventory
categoryCountRequest =  # CategoryCountRequest | 
serviceName = serviceName_example # String | Name of the cloud (optional) (default to AWS)

try: 
    api_response = api_instance.get_inventory_count(tenantId, categoryCountRequest, serviceName=serviceName)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling InventoryApi->getInventoryCount: %s\n" % e)

Parameters

Path parameters
Name Description
tenant_id*
String
Specify the tenant Id for the inventory
Required
Body parameters
Name Description
categoryCountRequest *
Query parameters
Name Description
service_name
String
Name of the cloud

Responses

Status: 200 - Success

Status: 400 - Bad Request

Status: 401 - Unauthorized

Status: 500 - Internal Server Error


getInventoryDetails

Get resource details based on the cloud accounts, category, component, resource and filters can be applied based on the cloud and cloud account for ex: AWS will have regions in filters and Azure will have resource group as filters for listing resources.


/v1/{tenant_id}/inventory/resources

Usage and SDK Samples

curl -X POST -H "X-Auth-Token: [[apiKey]]" -H "X-Auth-User: [[apiKey]]" "https://localhost/v1/{tenant_id}/inventory/resources"
import io.swagger.client.*;
import io.swagger.client.auth.*;
import io.swagger.client.model.*;
import io.swagger.client.api.InventoryApi;

import java.io.File;
import java.util.*;

public class InventoryApiExample {

    public static void main(String[] args) {
        ApiClient defaultClient = Configuration.getDefaultApiClient();
        
        // Configure API key authorization: auth_token
        ApiKeyAuth auth_token = (ApiKeyAuth) defaultClient.getAuthentication("auth_token");
        auth_token.setApiKey("YOUR API KEY");
        // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
        //auth_token.setApiKeyPrefix("Token");

        // Configure API key authorization: auth_user
        ApiKeyAuth auth_user = (ApiKeyAuth) defaultClient.getAuthentication("auth_user");
        auth_user.setApiKey("YOUR API KEY");
        // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
        //auth_user.setApiKeyPrefix("Token");

        InventoryApi apiInstance = new InventoryApi();
        String tenantId = tenantId_example; // String | Specify the tenant Id for the inventory
        InventoryResourceDetailsRequest inventoryResourceDetailsRequest = ; // InventoryResourceDetailsRequest | 
        try {
            InventoryResourceDetails result = apiInstance.getInventoryDetails(tenantId, inventoryResourceDetailsRequest);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling InventoryApi#getInventoryDetails");
            e.printStackTrace();
        }
    }
}
import io.swagger.client.api.InventoryApi;

public class InventoryApiExample {

    public static void main(String[] args) {
        InventoryApi apiInstance = new InventoryApi();
        String tenantId = tenantId_example; // String | Specify the tenant Id for the inventory
        InventoryResourceDetailsRequest inventoryResourceDetailsRequest = ; // InventoryResourceDetailsRequest | 
        try {
            InventoryResourceDetails result = apiInstance.getInventoryDetails(tenantId, inventoryResourceDetailsRequest);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling InventoryApi#getInventoryDetails");
            e.printStackTrace();
        }
    }
}
Configuration *apiConfig = [Configuration sharedConfig];

// Configure API key authorization: (authentication scheme: auth_token)
[apiConfig setApiKey:@"YOUR_API_KEY" forApiKeyIdentifier:@"X-Auth-Token"];
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
//[apiConfig setApiKeyPrefix:@"Bearer" forApiKeyIdentifier:@"X-Auth-Token"];

// Configure API key authorization: (authentication scheme: auth_user)
[apiConfig setApiKey:@"YOUR_API_KEY" forApiKeyIdentifier:@"X-Auth-User"];
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
//[apiConfig setApiKeyPrefix:@"Bearer" forApiKeyIdentifier:@"X-Auth-User"];

String *tenantId = tenantId_example; // Specify the tenant Id for the inventory
InventoryResourceDetailsRequest *inventoryResourceDetailsRequest = ; // 

InventoryApi *apiInstance = [[InventoryApi alloc] init];

[apiInstance getInventoryDetailsWith:tenantId
    inventoryResourceDetailsRequest:inventoryResourceDetailsRequest
              completionHandler: ^(InventoryResourceDetails output, NSError* error) {
                            if (output) {
                                NSLog(@"%@", output);
                            }
                            if (error) {
                                NSLog(@"Error: %@", error);
                            }
                        }];
var CorestackExternalApi = require('corestack_external_api');
var defaultClient = CorestackExternalApi.ApiClient.instance;

// Configure API key authorization: auth_token
var auth_token = defaultClient.authentications['auth_token'];
auth_token.apiKey = "YOUR API KEY"
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//auth_token.apiKeyPrefix['X-Auth-Token'] = "Token"

// Configure API key authorization: auth_user
var auth_user = defaultClient.authentications['auth_user'];
auth_user.apiKey = "YOUR API KEY"
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//auth_user.apiKeyPrefix['X-Auth-User'] = "Token"

var api = new CorestackExternalApi.InventoryApi()

var tenantId = tenantId_example; // {String} Specify the tenant Id for the inventory

var inventoryResourceDetailsRequest = ; // {InventoryResourceDetailsRequest} 


var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
api.getInventoryDetails(tenantId, inventoryResourceDetailsRequest, callback);
using System;
using System.Diagnostics;
using IO.Swagger.Api;
using IO.Swagger.Client;
using IO.Swagger.Model;

namespace Example
{
    public class getInventoryDetailsExample
    {
        public void main()
        {
            
            // Configure API key authorization: auth_token
            Configuration.Default.ApiKey.Add("X-Auth-Token", "YOUR_API_KEY");
            // Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
            // Configuration.Default.ApiKeyPrefix.Add("X-Auth-Token", "Bearer");
            // Configure API key authorization: auth_user
            Configuration.Default.ApiKey.Add("X-Auth-User", "YOUR_API_KEY");
            // Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
            // Configuration.Default.ApiKeyPrefix.Add("X-Auth-User", "Bearer");

            var apiInstance = new InventoryApi();
            var tenantId = tenantId_example;  // String | Specify the tenant Id for the inventory
            var inventoryResourceDetailsRequest = new InventoryResourceDetailsRequest(); // InventoryResourceDetailsRequest | 

            try
            {
                InventoryResourceDetails result = apiInstance.getInventoryDetails(tenantId, inventoryResourceDetailsRequest);
                Debug.WriteLine(result);
            }
            catch (Exception e)
            {
                Debug.Print("Exception when calling InventoryApi.getInventoryDetails: " + e.Message );
            }
        }
    }
}
<?php
require_once(__DIR__ . '/vendor/autoload.php');

// Configure API key authorization: auth_token
Swagger\Client\Configuration::getDefaultConfiguration()->setApiKey('X-Auth-Token', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// Swagger\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('X-Auth-Token', 'Bearer');
// Configure API key authorization: auth_user
Swagger\Client\Configuration::getDefaultConfiguration()->setApiKey('X-Auth-User', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// Swagger\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('X-Auth-User', 'Bearer');

$api_instance = new Swagger\Client\Api\InventoryApi();
$tenantId = tenantId_example; // String | Specify the tenant Id for the inventory
$inventoryResourceDetailsRequest = ; // InventoryResourceDetailsRequest | 

try {
    $result = $api_instance->getInventoryDetails($tenantId, $inventoryResourceDetailsRequest);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling InventoryApi->getInventoryDetails: ', $e->getMessage(), PHP_EOL;
}
?>
use Data::Dumper;
use WWW::SwaggerClient::Configuration;
use WWW::SwaggerClient::InventoryApi;

# Configure API key authorization: auth_token
$WWW::SwaggerClient::Configuration::api_key->{'X-Auth-Token'} = 'YOUR_API_KEY';
# uncomment below to setup prefix (e.g. Bearer) for API key, if needed
#$WWW::SwaggerClient::Configuration::api_key_prefix->{'X-Auth-Token'} = "Bearer";
# Configure API key authorization: auth_user
$WWW::SwaggerClient::Configuration::api_key->{'X-Auth-User'} = 'YOUR_API_KEY';
# uncomment below to setup prefix (e.g. Bearer) for API key, if needed
#$WWW::SwaggerClient::Configuration::api_key_prefix->{'X-Auth-User'} = "Bearer";

my $api_instance = WWW::SwaggerClient::InventoryApi->new();
my $tenantId = tenantId_example; # String | Specify the tenant Id for the inventory
my $inventoryResourceDetailsRequest = WWW::SwaggerClient::Object::InventoryResourceDetailsRequest->new(); # InventoryResourceDetailsRequest | 

eval { 
    my $result = $api_instance->getInventoryDetails(tenantId => $tenantId, inventoryResourceDetailsRequest => $inventoryResourceDetailsRequest);
    print Dumper($result);
};
if ($@) {
    warn "Exception when calling InventoryApi->getInventoryDetails: $@\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: auth_token
swagger_client.configuration.api_key['X-Auth-Token'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# swagger_client.configuration.api_key_prefix['X-Auth-Token'] = 'Bearer'
# Configure API key authorization: auth_user
swagger_client.configuration.api_key['X-Auth-User'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# swagger_client.configuration.api_key_prefix['X-Auth-User'] = 'Bearer'

# create an instance of the API class
api_instance = swagger_client.InventoryApi()
tenantId = tenantId_example # String | Specify the tenant Id for the inventory
inventoryResourceDetailsRequest =  # InventoryResourceDetailsRequest | 

try: 
    api_response = api_instance.get_inventory_details(tenantId, inventoryResourceDetailsRequest)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling InventoryApi->getInventoryDetails: %s\n" % e)

Parameters

Path parameters
Name Description
tenant_id*
String
Specify the tenant Id for the inventory
Required
Body parameters
Name Description
inventoryResourceDetailsRequest *

Responses

Status: 200 - Success

Status: 400 - Bad Request

Status: 401 - Unauthorized

Status: 500 - Internal Server Error


listInventoryFilters

Get all the available filters for the corresponding cloud.Listing filter attributes will help us in getting resource details with the filters listed can be applied on the resource details call and this api is only to list filtersfor ex: AWS will have regions and tags as filters available and Azure will have resource groups and tags as filters


/v1/{tenant_id}/inventory/filters

Usage and SDK Samples

curl -X GET -H "X-Auth-Token: [[apiKey]]" -H "X-Auth-User: [[apiKey]]" "https://localhost/v1/{tenant_id}/inventory/filters?service_name="
import io.swagger.client.*;
import io.swagger.client.auth.*;
import io.swagger.client.model.*;
import io.swagger.client.api.InventoryApi;

import java.io.File;
import java.util.*;

public class InventoryApiExample {

    public static void main(String[] args) {
        ApiClient defaultClient = Configuration.getDefaultApiClient();
        
        // Configure API key authorization: auth_token
        ApiKeyAuth auth_token = (ApiKeyAuth) defaultClient.getAuthentication("auth_token");
        auth_token.setApiKey("YOUR API KEY");
        // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
        //auth_token.setApiKeyPrefix("Token");

        // Configure API key authorization: auth_user
        ApiKeyAuth auth_user = (ApiKeyAuth) defaultClient.getAuthentication("auth_user");
        auth_user.setApiKey("YOUR API KEY");
        // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
        //auth_user.setApiKeyPrefix("Token");

        InventoryApi apiInstance = new InventoryApi();
        String tenantId = tenantId_example; // String | Specify the tenant Id for the inventory
        String serviceName = serviceName_example; // String | Name of the cloud
        try {
            InventoryResponse result = apiInstance.listInventoryFilters(tenantId, serviceName);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling InventoryApi#listInventoryFilters");
            e.printStackTrace();
        }
    }
}
import io.swagger.client.api.InventoryApi;

public class InventoryApiExample {

    public static void main(String[] args) {
        InventoryApi apiInstance = new InventoryApi();
        String tenantId = tenantId_example; // String | Specify the tenant Id for the inventory
        String serviceName = serviceName_example; // String | Name of the cloud
        try {
            InventoryResponse result = apiInstance.listInventoryFilters(tenantId, serviceName);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling InventoryApi#listInventoryFilters");
            e.printStackTrace();
        }
    }
}
Configuration *apiConfig = [Configuration sharedConfig];

// Configure API key authorization: (authentication scheme: auth_token)
[apiConfig setApiKey:@"YOUR_API_KEY" forApiKeyIdentifier:@"X-Auth-Token"];
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
//[apiConfig setApiKeyPrefix:@"Bearer" forApiKeyIdentifier:@"X-Auth-Token"];

// Configure API key authorization: (authentication scheme: auth_user)
[apiConfig setApiKey:@"YOUR_API_KEY" forApiKeyIdentifier:@"X-Auth-User"];
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
//[apiConfig setApiKeyPrefix:@"Bearer" forApiKeyIdentifier:@"X-Auth-User"];

String *tenantId = tenantId_example; // Specify the tenant Id for the inventory
String *serviceName = serviceName_example; // Name of the cloud (optional) (default to AWS)

InventoryApi *apiInstance = [[InventoryApi alloc] init];

[apiInstance listInventoryFiltersWith:tenantId
    serviceName:serviceName
              completionHandler: ^(InventoryResponse output, NSError* error) {
                            if (output) {
                                NSLog(@"%@", output);
                            }
                            if (error) {
                                NSLog(@"Error: %@", error);
                            }
                        }];
var CorestackExternalApi = require('corestack_external_api');
var defaultClient = CorestackExternalApi.ApiClient.instance;

// Configure API key authorization: auth_token
var auth_token = defaultClient.authentications['auth_token'];
auth_token.apiKey = "YOUR API KEY"
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//auth_token.apiKeyPrefix['X-Auth-Token'] = "Token"

// Configure API key authorization: auth_user
var auth_user = defaultClient.authentications['auth_user'];
auth_user.apiKey = "YOUR API KEY"
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//auth_user.apiKeyPrefix['X-Auth-User'] = "Token"

var api = new CorestackExternalApi.InventoryApi()

var tenantId = tenantId_example; // {String} Specify the tenant Id for the inventory

var opts = { 
  'serviceName': serviceName_example // {String} Name of the cloud
};

var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
api.listInventoryFilters(tenantId, opts, callback);
using System;
using System.Diagnostics;
using IO.Swagger.Api;
using IO.Swagger.Client;
using IO.Swagger.Model;

namespace Example
{
    public class listInventoryFiltersExample
    {
        public void main()
        {
            
            // Configure API key authorization: auth_token
            Configuration.Default.ApiKey.Add("X-Auth-Token", "YOUR_API_KEY");
            // Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
            // Configuration.Default.ApiKeyPrefix.Add("X-Auth-Token", "Bearer");
            // Configure API key authorization: auth_user
            Configuration.Default.ApiKey.Add("X-Auth-User", "YOUR_API_KEY");
            // Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
            // Configuration.Default.ApiKeyPrefix.Add("X-Auth-User", "Bearer");

            var apiInstance = new InventoryApi();
            var tenantId = tenantId_example;  // String | Specify the tenant Id for the inventory
            var serviceName = serviceName_example;  // String | Name of the cloud (optional)  (default to AWS)

            try
            {
                InventoryResponse result = apiInstance.listInventoryFilters(tenantId, serviceName);
                Debug.WriteLine(result);
            }
            catch (Exception e)
            {
                Debug.Print("Exception when calling InventoryApi.listInventoryFilters: " + e.Message );
            }
        }
    }
}
<?php
require_once(__DIR__ . '/vendor/autoload.php');

// Configure API key authorization: auth_token
Swagger\Client\Configuration::getDefaultConfiguration()->setApiKey('X-Auth-Token', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// Swagger\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('X-Auth-Token', 'Bearer');
// Configure API key authorization: auth_user
Swagger\Client\Configuration::getDefaultConfiguration()->setApiKey('X-Auth-User', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// Swagger\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('X-Auth-User', 'Bearer');

$api_instance = new Swagger\Client\Api\InventoryApi();
$tenantId = tenantId_example; // String | Specify the tenant Id for the inventory
$serviceName = serviceName_example; // String | Name of the cloud

try {
    $result = $api_instance->listInventoryFilters($tenantId, $serviceName);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling InventoryApi->listInventoryFilters: ', $e->getMessage(), PHP_EOL;
}
?>
use Data::Dumper;
use WWW::SwaggerClient::Configuration;
use WWW::SwaggerClient::InventoryApi;

# Configure API key authorization: auth_token
$WWW::SwaggerClient::Configuration::api_key->{'X-Auth-Token'} = 'YOUR_API_KEY';
# uncomment below to setup prefix (e.g. Bearer) for API key, if needed
#$WWW::SwaggerClient::Configuration::api_key_prefix->{'X-Auth-Token'} = "Bearer";
# Configure API key authorization: auth_user
$WWW::SwaggerClient::Configuration::api_key->{'X-Auth-User'} = 'YOUR_API_KEY';
# uncomment below to setup prefix (e.g. Bearer) for API key, if needed
#$WWW::SwaggerClient::Configuration::api_key_prefix->{'X-Auth-User'} = "Bearer";

my $api_instance = WWW::SwaggerClient::InventoryApi->new();
my $tenantId = tenantId_example; # String | Specify the tenant Id for the inventory
my $serviceName = serviceName_example; # String | Name of the cloud

eval { 
    my $result = $api_instance->listInventoryFilters(tenantId => $tenantId, serviceName => $serviceName);
    print Dumper($result);
};
if ($@) {
    warn "Exception when calling InventoryApi->listInventoryFilters: $@\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: auth_token
swagger_client.configuration.api_key['X-Auth-Token'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# swagger_client.configuration.api_key_prefix['X-Auth-Token'] = 'Bearer'
# Configure API key authorization: auth_user
swagger_client.configuration.api_key['X-Auth-User'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# swagger_client.configuration.api_key_prefix['X-Auth-User'] = 'Bearer'

# create an instance of the API class
api_instance = swagger_client.InventoryApi()
tenantId = tenantId_example # String | Specify the tenant Id for the inventory
serviceName = serviceName_example # String | Name of the cloud (optional) (default to AWS)

try: 
    api_response = api_instance.list_inventory_filters(tenantId, serviceName=serviceName)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling InventoryApi->listInventoryFilters: %s\n" % e)

Parameters

Path parameters
Name Description
tenant_id*
String
Specify the tenant Id for the inventory
Required
Query parameters
Name Description
service_name
String
Name of the cloud

Responses

Status: 200 - Success

Status: 400 - Bad Request

Status: 401 - Unauthorized

Status: 500 - Internal Server Error


Policy

createPolicy

Creates a new policy under the tenant which will generate a unique policy id in the response this is can be used to describe details about the policy, update policy, execute or delete policy. However the policy will be accessible based on its scope Account scope - All users under that account will have access to describe and execute. Only Account admins can update/delete. Tenant - Users with access to the specific tenant will have access scripts to describe and execute. Tenant admins can update/delete. Private - User who created will only have access.


/v1/{tenant_id}/policies

Usage and SDK Samples

curl -X POST -H "X-Auth-Token: [[apiKey]]" -H "X-Auth-User: [[apiKey]]" "https://localhost/v1/{tenant_id}/policies"
import io.swagger.client.*;
import io.swagger.client.auth.*;
import io.swagger.client.model.*;
import io.swagger.client.api.PolicyApi;

import java.io.File;
import java.util.*;

public class PolicyApiExample {

    public static void main(String[] args) {
        ApiClient defaultClient = Configuration.getDefaultApiClient();
        
        // Configure API key authorization: auth_token
        ApiKeyAuth auth_token = (ApiKeyAuth) defaultClient.getAuthentication("auth_token");
        auth_token.setApiKey("YOUR API KEY");
        // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
        //auth_token.setApiKeyPrefix("Token");

        // Configure API key authorization: auth_user
        ApiKeyAuth auth_user = (ApiKeyAuth) defaultClient.getAuthentication("auth_user");
        auth_user.setApiKey("YOUR API KEY");
        // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
        //auth_user.setApiKeyPrefix("Token");

        PolicyApi apiInstance = new PolicyApi();
        String tenantId = tenantId_example; // String | Specify the tenant Id to create policy which is a unique id can be retrieved using the list tenant api
        CreatePolicyRequest createPolicyRequest = ; // CreatePolicyRequest | 
        try {
            PolicyData result = apiInstance.createPolicy(tenantId, createPolicyRequest);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling PolicyApi#createPolicy");
            e.printStackTrace();
        }
    }
}
import io.swagger.client.api.PolicyApi;

public class PolicyApiExample {

    public static void main(String[] args) {
        PolicyApi apiInstance = new PolicyApi();
        String tenantId = tenantId_example; // String | Specify the tenant Id to create policy which is a unique id can be retrieved using the list tenant api
        CreatePolicyRequest createPolicyRequest = ; // CreatePolicyRequest | 
        try {
            PolicyData result = apiInstance.createPolicy(tenantId, createPolicyRequest);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling PolicyApi#createPolicy");
            e.printStackTrace();
        }
    }
}
Configuration *apiConfig = [Configuration sharedConfig];

// Configure API key authorization: (authentication scheme: auth_token)
[apiConfig setApiKey:@"YOUR_API_KEY" forApiKeyIdentifier:@"X-Auth-Token"];
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
//[apiConfig setApiKeyPrefix:@"Bearer" forApiKeyIdentifier:@"X-Auth-Token"];

// Configure API key authorization: (authentication scheme: auth_user)
[apiConfig setApiKey:@"YOUR_API_KEY" forApiKeyIdentifier:@"X-Auth-User"];
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
//[apiConfig setApiKeyPrefix:@"Bearer" forApiKeyIdentifier:@"X-Auth-User"];

String *tenantId = tenantId_example; // Specify the tenant Id to create policy which is a unique id can be retrieved using the list tenant api
CreatePolicyRequest *createPolicyRequest = ; // 

PolicyApi *apiInstance = [[PolicyApi alloc] init];

[apiInstance createPolicyWith:tenantId
    createPolicyRequest:createPolicyRequest
              completionHandler: ^(PolicyData output, NSError* error) {
                            if (output) {
                                NSLog(@"%@", output);
                            }
                            if (error) {
                                NSLog(@"Error: %@", error);
                            }
                        }];
var CorestackExternalApi = require('corestack_external_api');
var defaultClient = CorestackExternalApi.ApiClient.instance;

// Configure API key authorization: auth_token
var auth_token = defaultClient.authentications['auth_token'];
auth_token.apiKey = "YOUR API KEY"
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//auth_token.apiKeyPrefix['X-Auth-Token'] = "Token"

// Configure API key authorization: auth_user
var auth_user = defaultClient.authentications['auth_user'];
auth_user.apiKey = "YOUR API KEY"
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//auth_user.apiKeyPrefix['X-Auth-User'] = "Token"

var api = new CorestackExternalApi.PolicyApi()

var tenantId = tenantId_example; // {String} Specify the tenant Id to create policy which is a unique id can be retrieved using the list tenant api

var createPolicyRequest = ; // {CreatePolicyRequest} 


var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
api.createPolicy(tenantId, createPolicyRequest, callback);
using System;
using System.Diagnostics;
using IO.Swagger.Api;
using IO.Swagger.Client;
using IO.Swagger.Model;

namespace Example
{
    public class createPolicyExample
    {
        public void main()
        {
            
            // Configure API key authorization: auth_token
            Configuration.Default.ApiKey.Add("X-Auth-Token", "YOUR_API_KEY");
            // Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
            // Configuration.Default.ApiKeyPrefix.Add("X-Auth-Token", "Bearer");
            // Configure API key authorization: auth_user
            Configuration.Default.ApiKey.Add("X-Auth-User", "YOUR_API_KEY");
            // Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
            // Configuration.Default.ApiKeyPrefix.Add("X-Auth-User", "Bearer");

            var apiInstance = new PolicyApi();
            var tenantId = tenantId_example;  // String | Specify the tenant Id to create policy which is a unique id can be retrieved using the list tenant api
            var createPolicyRequest = new CreatePolicyRequest(); // CreatePolicyRequest | 

            try
            {
                PolicyData result = apiInstance.createPolicy(tenantId, createPolicyRequest);
                Debug.WriteLine(result);
            }
            catch (Exception e)
            {
                Debug.Print("Exception when calling PolicyApi.createPolicy: " + e.Message );
            }
        }
    }
}
<?php
require_once(__DIR__ . '/vendor/autoload.php');

// Configure API key authorization: auth_token
Swagger\Client\Configuration::getDefaultConfiguration()->setApiKey('X-Auth-Token', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// Swagger\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('X-Auth-Token', 'Bearer');
// Configure API key authorization: auth_user
Swagger\Client\Configuration::getDefaultConfiguration()->setApiKey('X-Auth-User', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// Swagger\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('X-Auth-User', 'Bearer');

$api_instance = new Swagger\Client\Api\PolicyApi();
$tenantId = tenantId_example; // String | Specify the tenant Id to create policy which is a unique id can be retrieved using the list tenant api
$createPolicyRequest = ; // CreatePolicyRequest | 

try {
    $result = $api_instance->createPolicy($tenantId, $createPolicyRequest);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling PolicyApi->createPolicy: ', $e->getMessage(), PHP_EOL;
}
?>
use Data::Dumper;
use WWW::SwaggerClient::Configuration;
use WWW::SwaggerClient::PolicyApi;

# Configure API key authorization: auth_token
$WWW::SwaggerClient::Configuration::api_key->{'X-Auth-Token'} = 'YOUR_API_KEY';
# uncomment below to setup prefix (e.g. Bearer) for API key, if needed
#$WWW::SwaggerClient::Configuration::api_key_prefix->{'X-Auth-Token'} = "Bearer";
# Configure API key authorization: auth_user
$WWW::SwaggerClient::Configuration::api_key->{'X-Auth-User'} = 'YOUR_API_KEY';
# uncomment below to setup prefix (e.g. Bearer) for API key, if needed
#$WWW::SwaggerClient::Configuration::api_key_prefix->{'X-Auth-User'} = "Bearer";

my $api_instance = WWW::SwaggerClient::PolicyApi->new();
my $tenantId = tenantId_example; # String | Specify the tenant Id to create policy which is a unique id can be retrieved using the list tenant api
my $createPolicyRequest = WWW::SwaggerClient::Object::CreatePolicyRequest->new(); # CreatePolicyRequest | 

eval { 
    my $result = $api_instance->createPolicy(tenantId => $tenantId, createPolicyRequest => $createPolicyRequest);
    print Dumper($result);
};
if ($@) {
    warn "Exception when calling PolicyApi->createPolicy: $@\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: auth_token
swagger_client.configuration.api_key['X-Auth-Token'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# swagger_client.configuration.api_key_prefix['X-Auth-Token'] = 'Bearer'
# Configure API key authorization: auth_user
swagger_client.configuration.api_key['X-Auth-User'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# swagger_client.configuration.api_key_prefix['X-Auth-User'] = 'Bearer'

# create an instance of the API class
api_instance = swagger_client.PolicyApi()
tenantId = tenantId_example # String | Specify the tenant Id to create policy which is a unique id can be retrieved using the list tenant api
createPolicyRequest =  # CreatePolicyRequest | 

try: 
    api_response = api_instance.create_policy(tenantId, createPolicyRequest)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling PolicyApi->createPolicy: %s\n" % e)

Parameters

Path parameters
Name Description
tenant_id*
String
Specify the tenant Id to create policy which is a unique id can be retrieved using the list tenant api
Required
Body parameters
Name Description
createPolicyRequest *

Responses

Status: 201 - Success

Status: 400 - Bad Request

Status: 401 - Unauthorized

Status: 500 - Internal Server Error


deletePolicy

Delete a policy which is no more required


/v1/{tenant_id}/policies/{policy_id}

Usage and SDK Samples

curl -X DELETE -H "X-Auth-Token: [[apiKey]]" -H "X-Auth-User: [[apiKey]]" "https://localhost/v1/{tenant_id}/policies/{policy_id}"
import io.swagger.client.*;
import io.swagger.client.auth.*;
import io.swagger.client.model.*;
import io.swagger.client.api.PolicyApi;

import java.io.File;
import java.util.*;

public class PolicyApiExample {

    public static void main(String[] args) {
        ApiClient defaultClient = Configuration.getDefaultApiClient();
        
        // Configure API key authorization: auth_token
        ApiKeyAuth auth_token = (ApiKeyAuth) defaultClient.getAuthentication("auth_token");
        auth_token.setApiKey("YOUR API KEY");
        // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
        //auth_token.setApiKeyPrefix("Token");

        // Configure API key authorization: auth_user
        ApiKeyAuth auth_user = (ApiKeyAuth) defaultClient.getAuthentication("auth_user");
        auth_user.setApiKey("YOUR API KEY");
        // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
        //auth_user.setApiKeyPrefix("Token");

        PolicyApi apiInstance = new PolicyApi();
        String tenantId = tenantId_example; // String | Specify the tenant Id to delete policy which is a unique id can be retrieved from the list tenant api
        String policyId = policyId_example; // String | specify the policy id of the policy to delete, policy id is unique can be obtained from the list policy api
        try {
            PolicyRemovalResponse result = apiInstance.deletePolicy(tenantId, policyId);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling PolicyApi#deletePolicy");
            e.printStackTrace();
        }
    }
}
import io.swagger.client.api.PolicyApi;

public class PolicyApiExample {

    public static void main(String[] args) {
        PolicyApi apiInstance = new PolicyApi();
        String tenantId = tenantId_example; // String | Specify the tenant Id to delete policy which is a unique id can be retrieved from the list tenant api
        String policyId = policyId_example; // String | specify the policy id of the policy to delete, policy id is unique can be obtained from the list policy api
        try {
            PolicyRemovalResponse result = apiInstance.deletePolicy(tenantId, policyId);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling PolicyApi#deletePolicy");
            e.printStackTrace();
        }
    }
}
Configuration *apiConfig = [Configuration sharedConfig];

// Configure API key authorization: (authentication scheme: auth_token)
[apiConfig setApiKey:@"YOUR_API_KEY" forApiKeyIdentifier:@"X-Auth-Token"];
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
//[apiConfig setApiKeyPrefix:@"Bearer" forApiKeyIdentifier:@"X-Auth-Token"];

// Configure API key authorization: (authentication scheme: auth_user)
[apiConfig setApiKey:@"YOUR_API_KEY" forApiKeyIdentifier:@"X-Auth-User"];
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
//[apiConfig setApiKeyPrefix:@"Bearer" forApiKeyIdentifier:@"X-Auth-User"];

String *tenantId = tenantId_example; // Specify the tenant Id to delete policy which is a unique id can be retrieved from the list tenant api
String *policyId = policyId_example; // specify the policy id of the policy to delete, policy id is unique can be obtained from the list policy api

PolicyApi *apiInstance = [[PolicyApi alloc] init];

[apiInstance deletePolicyWith:tenantId
    policyId:policyId
              completionHandler: ^(PolicyRemovalResponse output, NSError* error) {
                            if (output) {
                                NSLog(@"%@", output);
                            }
                            if (error) {
                                NSLog(@"Error: %@", error);
                            }
                        }];
var CorestackExternalApi = require('corestack_external_api');
var defaultClient = CorestackExternalApi.ApiClient.instance;

// Configure API key authorization: auth_token
var auth_token = defaultClient.authentications['auth_token'];
auth_token.apiKey = "YOUR API KEY"
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//auth_token.apiKeyPrefix['X-Auth-Token'] = "Token"

// Configure API key authorization: auth_user
var auth_user = defaultClient.authentications['auth_user'];
auth_user.apiKey = "YOUR API KEY"
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//auth_user.apiKeyPrefix['X-Auth-User'] = "Token"

var api = new CorestackExternalApi.PolicyApi()

var tenantId = tenantId_example; // {String} Specify the tenant Id to delete policy which is a unique id can be retrieved from the list tenant api

var policyId = policyId_example; // {String} specify the policy id of the policy to delete, policy id is unique can be obtained from the list policy api


var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
api.deletePolicy(tenantId, policyId, callback);
using System;
using System.Diagnostics;
using IO.Swagger.Api;
using IO.Swagger.Client;
using IO.Swagger.Model;

namespace Example
{
    public class deletePolicyExample
    {
        public void main()
        {
            
            // Configure API key authorization: auth_token
            Configuration.Default.ApiKey.Add("X-Auth-Token", "YOUR_API_KEY");
            // Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
            // Configuration.Default.ApiKeyPrefix.Add("X-Auth-Token", "Bearer");
            // Configure API key authorization: auth_user
            Configuration.Default.ApiKey.Add("X-Auth-User", "YOUR_API_KEY");
            // Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
            // Configuration.Default.ApiKeyPrefix.Add("X-Auth-User", "Bearer");

            var apiInstance = new PolicyApi();
            var tenantId = tenantId_example;  // String | Specify the tenant Id to delete policy which is a unique id can be retrieved from the list tenant api
            var policyId = policyId_example;  // String | specify the policy id of the policy to delete, policy id is unique can be obtained from the list policy api

            try
            {
                PolicyRemovalResponse result = apiInstance.deletePolicy(tenantId, policyId);
                Debug.WriteLine(result);
            }
            catch (Exception e)
            {
                Debug.Print("Exception when calling PolicyApi.deletePolicy: " + e.Message );
            }
        }
    }
}
<?php
require_once(__DIR__ . '/vendor/autoload.php');

// Configure API key authorization: auth_token
Swagger\Client\Configuration::getDefaultConfiguration()->setApiKey('X-Auth-Token', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// Swagger\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('X-Auth-Token', 'Bearer');
// Configure API key authorization: auth_user
Swagger\Client\Configuration::getDefaultConfiguration()->setApiKey('X-Auth-User', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// Swagger\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('X-Auth-User', 'Bearer');

$api_instance = new Swagger\Client\Api\PolicyApi();
$tenantId = tenantId_example; // String | Specify the tenant Id to delete policy which is a unique id can be retrieved from the list tenant api
$policyId = policyId_example; // String | specify the policy id of the policy to delete, policy id is unique can be obtained from the list policy api

try {
    $result = $api_instance->deletePolicy($tenantId, $policyId);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling PolicyApi->deletePolicy: ', $e->getMessage(), PHP_EOL;
}
?>
use Data::Dumper;
use WWW::SwaggerClient::Configuration;
use WWW::SwaggerClient::PolicyApi;

# Configure API key authorization: auth_token
$WWW::SwaggerClient::Configuration::api_key->{'X-Auth-Token'} = 'YOUR_API_KEY';
# uncomment below to setup prefix (e.g. Bearer) for API key, if needed
#$WWW::SwaggerClient::Configuration::api_key_prefix->{'X-Auth-Token'} = "Bearer";
# Configure API key authorization: auth_user
$WWW::SwaggerClient::Configuration::api_key->{'X-Auth-User'} = 'YOUR_API_KEY';
# uncomment below to setup prefix (e.g. Bearer) for API key, if needed
#$WWW::SwaggerClient::Configuration::api_key_prefix->{'X-Auth-User'} = "Bearer";

my $api_instance = WWW::SwaggerClient::PolicyApi->new();
my $tenantId = tenantId_example; # String | Specify the tenant Id to delete policy which is a unique id can be retrieved from the list tenant api
my $policyId = policyId_example; # String | specify the policy id of the policy to delete, policy id is unique can be obtained from the list policy api

eval { 
    my $result = $api_instance->deletePolicy(tenantId => $tenantId, policyId => $policyId);
    print Dumper($result);
};
if ($@) {
    warn "Exception when calling PolicyApi->deletePolicy: $@\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: auth_token
swagger_client.configuration.api_key['X-Auth-Token'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# swagger_client.configuration.api_key_prefix['X-Auth-Token'] = 'Bearer'
# Configure API key authorization: auth_user
swagger_client.configuration.api_key['X-Auth-User'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# swagger_client.configuration.api_key_prefix['X-Auth-User'] = 'Bearer'

# create an instance of the API class
api_instance = swagger_client.PolicyApi()
tenantId = tenantId_example # String | Specify the tenant Id to delete policy which is a unique id can be retrieved from the list tenant api
policyId = policyId_example # String | specify the policy id of the policy to delete, policy id is unique can be obtained from the list policy api

try: 
    api_response = api_instance.delete_policy(tenantId, policyId)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling PolicyApi->deletePolicy: %s\n" % e)

Parameters

Path parameters
Name Description
tenant_id*
String
Specify the tenant Id to delete policy which is a unique id can be retrieved from the list tenant api
Required
policy_id*
String
specify the policy id of the policy to delete, policy id is unique can be obtained from the list policy api
Required

Responses

Status: 200 - Success

Status: 400 - Bad Request

Status: 401 - Unauthorized

Status: 500 - Internal Server Error


describePolicy

Describe the already created Polices


/v1/{tenant_id}/policies/{policy_id}

Usage and SDK Samples

curl -X GET -H "X-Auth-Token: [[apiKey]]" -H "X-Auth-User: [[apiKey]]" "https://localhost/v1/{tenant_id}/policies/{policy_id}"
import io.swagger.client.*;
import io.swagger.client.auth.*;
import io.swagger.client.model.*;
import io.swagger.client.api.PolicyApi;

import java.io.File;
import java.util.*;

public class PolicyApiExample {

    public static void main(String[] args) {
        ApiClient defaultClient = Configuration.getDefaultApiClient();
        
        // Configure API key authorization: auth_token
        ApiKeyAuth auth_token = (ApiKeyAuth) defaultClient.getAuthentication("auth_token");
        auth_token.setApiKey("YOUR API KEY");
        // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
        //auth_token.setApiKeyPrefix("Token");

        // Configure API key authorization: auth_user
        ApiKeyAuth auth_user = (ApiKeyAuth) defaultClient.getAuthentication("auth_user");
        auth_user.setApiKey("YOUR API KEY");
        // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
        //auth_user.setApiKeyPrefix("Token");

        PolicyApi apiInstance = new PolicyApi();
        String tenantId = tenantId_example; // String | Specify the tenant Id to get policy which is a unique id can be obtained using the list tenant api
        String policyId = policyId_example; // String | specify the policy id to retrieve which is a unique id can be obtained using list policy api
        try {
            PolicyViewResponse result = apiInstance.describePolicy(tenantId, policyId);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling PolicyApi#describePolicy");
            e.printStackTrace();
        }
    }
}
import io.swagger.client.api.PolicyApi;

public class PolicyApiExample {

    public static void main(String[] args) {
        PolicyApi apiInstance = new PolicyApi();
        String tenantId = tenantId_example; // String | Specify the tenant Id to get policy which is a unique id can be obtained using the list tenant api
        String policyId = policyId_example; // String | specify the policy id to retrieve which is a unique id can be obtained using list policy api
        try {
            PolicyViewResponse result = apiInstance.describePolicy(tenantId, policyId);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling PolicyApi#describePolicy");
            e.printStackTrace();
        }
    }
}
Configuration *apiConfig = [Configuration sharedConfig];

// Configure API key authorization: (authentication scheme: auth_token)
[apiConfig setApiKey:@"YOUR_API_KEY" forApiKeyIdentifier:@"X-Auth-Token"];
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
//[apiConfig setApiKeyPrefix:@"Bearer" forApiKeyIdentifier:@"X-Auth-Token"];

// Configure API key authorization: (authentication scheme: auth_user)
[apiConfig setApiKey:@"YOUR_API_KEY" forApiKeyIdentifier:@"X-Auth-User"];
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
//[apiConfig setApiKeyPrefix:@"Bearer" forApiKeyIdentifier:@"X-Auth-User"];

String *tenantId = tenantId_example; // Specify the tenant Id to get policy which is a unique id can be obtained using the list tenant api
String *policyId = policyId_example; // specify the policy id to retrieve which is a unique id can be obtained using list policy api

PolicyApi *apiInstance = [[PolicyApi alloc] init];

[apiInstance describePolicyWith:tenantId
    policyId:policyId
              completionHandler: ^(PolicyViewResponse output, NSError* error) {
                            if (output) {
                                NSLog(@"%@", output);
                            }
                            if (error) {
                                NSLog(@"Error: %@", error);
                            }
                        }];
var CorestackExternalApi = require('corestack_external_api');
var defaultClient = CorestackExternalApi.ApiClient.instance;

// Configure API key authorization: auth_token
var auth_token = defaultClient.authentications['auth_token'];
auth_token.apiKey = "YOUR API KEY"
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//auth_token.apiKeyPrefix['X-Auth-Token'] = "Token"

// Configure API key authorization: auth_user
var auth_user = defaultClient.authentications['auth_user'];
auth_user.apiKey = "YOUR API KEY"
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//auth_user.apiKeyPrefix['X-Auth-User'] = "Token"

var api = new CorestackExternalApi.PolicyApi()

var tenantId = tenantId_example; // {String} Specify the tenant Id to get policy which is a unique id can be obtained using the list tenant api

var policyId = policyId_example; // {String} specify the policy id to retrieve which is a unique id can be obtained using list policy api


var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
api.describePolicy(tenantId, policyId, callback);
using System;
using System.Diagnostics;
using IO.Swagger.Api;
using IO.Swagger.Client;
using IO.Swagger.Model;

namespace Example
{
    public class describePolicyExample
    {
        public void main()
        {
            
            // Configure API key authorization: auth_token
            Configuration.Default.ApiKey.Add("X-Auth-Token", "YOUR_API_KEY");
            // Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
            // Configuration.Default.ApiKeyPrefix.Add("X-Auth-Token", "Bearer");
            // Configure API key authorization: auth_user
            Configuration.Default.ApiKey.Add("X-Auth-User", "YOUR_API_KEY");
            // Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
            // Configuration.Default.ApiKeyPrefix.Add("X-Auth-User", "Bearer");

            var apiInstance = new PolicyApi();
            var tenantId = tenantId_example;  // String | Specify the tenant Id to get policy which is a unique id can be obtained using the list tenant api
            var policyId = policyId_example;  // String | specify the policy id to retrieve which is a unique id can be obtained using list policy api

            try
            {
                PolicyViewResponse result = apiInstance.describePolicy(tenantId, policyId);
                Debug.WriteLine(result);
            }
            catch (Exception e)
            {
                Debug.Print("Exception when calling PolicyApi.describePolicy: " + e.Message );
            }
        }
    }
}
<?php
require_once(__DIR__ . '/vendor/autoload.php');

// Configure API key authorization: auth_token
Swagger\Client\Configuration::getDefaultConfiguration()->setApiKey('X-Auth-Token', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// Swagger\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('X-Auth-Token', 'Bearer');
// Configure API key authorization: auth_user
Swagger\Client\Configuration::getDefaultConfiguration()->setApiKey('X-Auth-User', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// Swagger\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('X-Auth-User', 'Bearer');

$api_instance = new Swagger\Client\Api\PolicyApi();
$tenantId = tenantId_example; // String | Specify the tenant Id to get policy which is a unique id can be obtained using the list tenant api
$policyId = policyId_example; // String | specify the policy id to retrieve which is a unique id can be obtained using list policy api

try {
    $result = $api_instance->describePolicy($tenantId, $policyId);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling PolicyApi->describePolicy: ', $e->getMessage(), PHP_EOL;
}
?>
use Data::Dumper;
use WWW::SwaggerClient::Configuration;
use WWW::SwaggerClient::PolicyApi;

# Configure API key authorization: auth_token
$WWW::SwaggerClient::Configuration::api_key->{'X-Auth-Token'} = 'YOUR_API_KEY';
# uncomment below to setup prefix (e.g. Bearer) for API key, if needed
#$WWW::SwaggerClient::Configuration::api_key_prefix->{'X-Auth-Token'} = "Bearer";
# Configure API key authorization: auth_user
$WWW::SwaggerClient::Configuration::api_key->{'X-Auth-User'} = 'YOUR_API_KEY';
# uncomment below to setup prefix (e.g. Bearer) for API key, if needed
#$WWW::SwaggerClient::Configuration::api_key_prefix->{'X-Auth-User'} = "Bearer";

my $api_instance = WWW::SwaggerClient::PolicyApi->new();
my $tenantId = tenantId_example; # String | Specify the tenant Id to get policy which is a unique id can be obtained using the list tenant api
my $policyId = policyId_example; # String | specify the policy id to retrieve which is a unique id can be obtained using list policy api

eval { 
    my $result = $api_instance->describePolicy(tenantId => $tenantId, policyId => $policyId);
    print Dumper($result);
};
if ($@) {
    warn "Exception when calling PolicyApi->describePolicy: $@\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: auth_token
swagger_client.configuration.api_key['X-Auth-Token'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# swagger_client.configuration.api_key_prefix['X-Auth-Token'] = 'Bearer'
# Configure API key authorization: auth_user
swagger_client.configuration.api_key['X-Auth-User'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# swagger_client.configuration.api_key_prefix['X-Auth-User'] = 'Bearer'

# create an instance of the API class
api_instance = swagger_client.PolicyApi()
tenantId = tenantId_example # String | Specify the tenant Id to get policy which is a unique id can be obtained using the list tenant api
policyId = policyId_example # String | specify the policy id to retrieve which is a unique id can be obtained using list policy api

try: 
    api_response = api_instance.describe_policy(tenantId, policyId)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling PolicyApi->describePolicy: %s\n" % e)

Parameters

Path parameters
Name Description
tenant_id*
String
Specify the tenant Id to get policy which is a unique id can be obtained using the list tenant api
Required
policy_id*
String
specify the policy id to retrieve which is a unique id can be obtained using list policy api
Required

Responses

Status: 200 - Success

Status: 400 - Bad Request

Status: 401 - Unauthorized

Status: 500 - Internal Server Error


describePolicyRecommendations

This is the api to view the recommendation associated with the policy and the resourceswhich will get effected on execution of the recommendations. We can also get a idea on theactions which can be performed


/v1/{tenant_id}/recommendations/{recommendation_id}

Usage and SDK Samples

curl -X GET -H "X-Auth-Token: [[apiKey]]" -H "X-Auth-User: [[apiKey]]" "https://localhost/v1/{tenant_id}/recommendations/{recommendation_id}"
import io.swagger.client.*;
import io.swagger.client.auth.*;
import io.swagger.client.model.*;
import io.swagger.client.api.PolicyApi;

import java.io.File;
import java.util.*;

public class PolicyApiExample {

    public static void main(String[] args) {
        ApiClient defaultClient = Configuration.getDefaultApiClient();
        
        // Configure API key authorization: auth_token
        ApiKeyAuth auth_token = (ApiKeyAuth) defaultClient.getAuthentication("auth_token");
        auth_token.setApiKey("YOUR API KEY");
        // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
        //auth_token.setApiKeyPrefix("Token");

        // Configure API key authorization: auth_user
        ApiKeyAuth auth_user = (ApiKeyAuth) defaultClient.getAuthentication("auth_user");
        auth_user.setApiKey("YOUR API KEY");
        // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
        //auth_user.setApiKeyPrefix("Token");

        PolicyApi apiInstance = new PolicyApi();
        String tenantId = tenantId_example; // String | Specify the tenant Id for the recommendation which is a unique value can be obtained from the list tenant api
        String recommendationId = recommendationId_example; // String | This is a unique identifier for recommendation, can be obtained from the  PolicyRecommendations api response
        try {
            PolicyRecommendationViewResponseModel result = apiInstance.describePolicyRecommendations(tenantId, recommendationId);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling PolicyApi#describePolicyRecommendations");
            e.printStackTrace();
        }
    }
}
import io.swagger.client.api.PolicyApi;

public class PolicyApiExample {

    public static void main(String[] args) {
        PolicyApi apiInstance = new PolicyApi();
        String tenantId = tenantId_example; // String | Specify the tenant Id for the recommendation which is a unique value can be obtained from the list tenant api
        String recommendationId = recommendationId_example; // String | This is a unique identifier for recommendation, can be obtained from the  PolicyRecommendations api response
        try {
            PolicyRecommendationViewResponseModel result = apiInstance.describePolicyRecommendations(tenantId, recommendationId);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling PolicyApi#describePolicyRecommendations");
            e.printStackTrace();
        }
    }
}
Configuration *apiConfig = [Configuration sharedConfig];

// Configure API key authorization: (authentication scheme: auth_token)
[apiConfig setApiKey:@"YOUR_API_KEY" forApiKeyIdentifier:@"X-Auth-Token"];
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
//[apiConfig setApiKeyPrefix:@"Bearer" forApiKeyIdentifier:@"X-Auth-Token"];

// Configure API key authorization: (authentication scheme: auth_user)
[apiConfig setApiKey:@"YOUR_API_KEY" forApiKeyIdentifier:@"X-Auth-User"];
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
//[apiConfig setApiKeyPrefix:@"Bearer" forApiKeyIdentifier:@"X-Auth-User"];

String *tenantId = tenantId_example; // Specify the tenant Id for the recommendation which is a unique value can be obtained from the list tenant api
String *recommendationId = recommendationId_example; // This is a unique identifier for recommendation, can be obtained from the  PolicyRecommendations api response

PolicyApi *apiInstance = [[PolicyApi alloc] init];

[apiInstance describePolicyRecommendationsWith:tenantId
    recommendationId:recommendationId
              completionHandler: ^(PolicyRecommendationViewResponseModel output, NSError* error) {
                            if (output) {
                                NSLog(@"%@", output);
                            }
                            if (error) {
                                NSLog(@"Error: %@", error);
                            }
                        }];
var CorestackExternalApi = require('corestack_external_api');
var defaultClient = CorestackExternalApi.ApiClient.instance;

// Configure API key authorization: auth_token
var auth_token = defaultClient.authentications['auth_token'];
auth_token.apiKey = "YOUR API KEY"
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//auth_token.apiKeyPrefix['X-Auth-Token'] = "Token"

// Configure API key authorization: auth_user
var auth_user = defaultClient.authentications['auth_user'];
auth_user.apiKey = "YOUR API KEY"
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//auth_user.apiKeyPrefix['X-Auth-User'] = "Token"

var api = new CorestackExternalApi.PolicyApi()

var tenantId = tenantId_example; // {String} Specify the tenant Id for the recommendation which is a unique value can be obtained from the list tenant api

var recommendationId = recommendationId_example; // {String} This is a unique identifier for recommendation, can be obtained from the  PolicyRecommendations api response


var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
api.describePolicyRecommendations(tenantId, recommendationId, callback);
using System;
using System.Diagnostics;
using IO.Swagger.Api;
using IO.Swagger.Client;
using IO.Swagger.Model;

namespace Example
{
    public class describePolicyRecommendationsExample
    {
        public void main()
        {
            
            // Configure API key authorization: auth_token
            Configuration.Default.ApiKey.Add("X-Auth-Token", "YOUR_API_KEY");
            // Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
            // Configuration.Default.ApiKeyPrefix.Add("X-Auth-Token", "Bearer");
            // Configure API key authorization: auth_user
            Configuration.Default.ApiKey.Add("X-Auth-User", "YOUR_API_KEY");
            // Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
            // Configuration.Default.ApiKeyPrefix.Add("X-Auth-User", "Bearer");

            var apiInstance = new PolicyApi();
            var tenantId = tenantId_example;  // String | Specify the tenant Id for the recommendation which is a unique value can be obtained from the list tenant api
            var recommendationId = recommendationId_example;  // String | This is a unique identifier for recommendation, can be obtained from the  PolicyRecommendations api response

            try
            {
                PolicyRecommendationViewResponseModel result = apiInstance.describePolicyRecommendations(tenantId, recommendationId);
                Debug.WriteLine(result);
            }
            catch (Exception e)
            {
                Debug.Print("Exception when calling PolicyApi.describePolicyRecommendations: " + e.Message );
            }
        }
    }
}
<?php
require_once(__DIR__ . '/vendor/autoload.php');

// Configure API key authorization: auth_token
Swagger\Client\Configuration::getDefaultConfiguration()->setApiKey('X-Auth-Token', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// Swagger\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('X-Auth-Token', 'Bearer');
// Configure API key authorization: auth_user
Swagger\Client\Configuration::getDefaultConfiguration()->setApiKey('X-Auth-User', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// Swagger\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('X-Auth-User', 'Bearer');

$api_instance = new Swagger\Client\Api\PolicyApi();
$tenantId = tenantId_example; // String | Specify the tenant Id for the recommendation which is a unique value can be obtained from the list tenant api
$recommendationId = recommendationId_example; // String | This is a unique identifier for recommendation, can be obtained from the  PolicyRecommendations api response

try {
    $result = $api_instance->describePolicyRecommendations($tenantId, $recommendationId);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling PolicyApi->describePolicyRecommendations: ', $e->getMessage(), PHP_EOL;
}
?>
use Data::Dumper;
use WWW::SwaggerClient::Configuration;
use WWW::SwaggerClient::PolicyApi;

# Configure API key authorization: auth_token
$WWW::SwaggerClient::Configuration::api_key->{'X-Auth-Token'} = 'YOUR_API_KEY';
# uncomment below to setup prefix (e.g. Bearer) for API key, if needed
#$WWW::SwaggerClient::Configuration::api_key_prefix->{'X-Auth-Token'} = "Bearer";
# Configure API key authorization: auth_user
$WWW::SwaggerClient::Configuration::api_key->{'X-Auth-User'} = 'YOUR_API_KEY';
# uncomment below to setup prefix (e.g. Bearer) for API key, if needed
#$WWW::SwaggerClient::Configuration::api_key_prefix->{'X-Auth-User'} = "Bearer";

my $api_instance = WWW::SwaggerClient::PolicyApi->new();
my $tenantId = tenantId_example; # String | Specify the tenant Id for the recommendation which is a unique value can be obtained from the list tenant api
my $recommendationId = recommendationId_example; # String | This is a unique identifier for recommendation, can be obtained from the  PolicyRecommendations api response

eval { 
    my $result = $api_instance->describePolicyRecommendations(tenantId => $tenantId, recommendationId => $recommendationId);
    print Dumper($result);
};
if ($@) {
    warn "Exception when calling PolicyApi->describePolicyRecommendations: $@\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: auth_token
swagger_client.configuration.api_key['X-Auth-Token'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# swagger_client.configuration.api_key_prefix['X-Auth-Token'] = 'Bearer'
# Configure API key authorization: auth_user
swagger_client.configuration.api_key['X-Auth-User'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# swagger_client.configuration.api_key_prefix['X-Auth-User'] = 'Bearer'

# create an instance of the API class
api_instance = swagger_client.PolicyApi()
tenantId = tenantId_example # String | Specify the tenant Id for the recommendation which is a unique value can be obtained from the list tenant api
recommendationId = recommendationId_example # String | This is a unique identifier for recommendation, can be obtained from the  PolicyRecommendations api response

try: 
    api_response = api_instance.describe_policy_recommendations(tenantId, recommendationId)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling PolicyApi->describePolicyRecommendations: %s\n" % e)

Parameters

Path parameters
Name Description
tenant_id*
String
Specify the tenant Id for the recommendation which is a unique value can be obtained from the list tenant api
Required
recommendation_id*
String
This is a unique identifier for recommendation, can be obtained from the PolicyRecommendations api response
Required

Responses

Status: 200 - Success

Status: 400 - Bad Request

Status: 401 - Unauthorized

Status: 500 - Internal Server Error


executePolicy

Execute policy will return a unique job id the status of the policy can be checked using the Job details api where you can pass the unique id generated to get the details or errors if any on execution


/v1/{tenant_id}/policies/{policy_id}/execute

Usage and SDK Samples

curl -X POST -H "X-Auth-Token: [[apiKey]]" -H "X-Auth-User: [[apiKey]]" "https://localhost/v1/{tenant_id}/policies/{policy_id}/execute"
import io.swagger.client.*;
import io.swagger.client.auth.*;
import io.swagger.client.model.*;
import io.swagger.client.api.PolicyApi;

import java.io.File;
import java.util.*;

public class PolicyApiExample {

    public static void main(String[] args) {
        ApiClient defaultClient = Configuration.getDefaultApiClient();
        
        // Configure API key authorization: auth_token
        ApiKeyAuth auth_token = (ApiKeyAuth) defaultClient.getAuthentication("auth_token");
        auth_token.setApiKey("YOUR API KEY");
        // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
        //auth_token.setApiKeyPrefix("Token");

        // Configure API key authorization: auth_user
        ApiKeyAuth auth_user = (ApiKeyAuth) defaultClient.getAuthentication("auth_user");
        auth_user.setApiKey("YOUR API KEY");
        // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
        //auth_user.setApiKeyPrefix("Token");

        PolicyApi apiInstance = new PolicyApi();
        String tenantId = tenantId_example; // String | Specify the tenant Id of the policy to be executed, this can be obtained using the list tenant api
        String policyId = policyId_example; // String | specify the policy id to execute, policy id can be obtained from the list policy api
        PolicyExecuteRequestModel policyExecuteRequestModel = ; // PolicyExecuteRequestModel | 
        try {
            PolicyExecuteResponseModel result = apiInstance.executePolicy(tenantId, policyId, policyExecuteRequestModel);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling PolicyApi#executePolicy");
            e.printStackTrace();
        }
    }
}
import io.swagger.client.api.PolicyApi;

public class PolicyApiExample {

    public static void main(String[] args) {
        PolicyApi apiInstance = new PolicyApi();
        String tenantId = tenantId_example; // String | Specify the tenant Id of the policy to be executed, this can be obtained using the list tenant api
        String policyId = policyId_example; // String | specify the policy id to execute, policy id can be obtained from the list policy api
        PolicyExecuteRequestModel policyExecuteRequestModel = ; // PolicyExecuteRequestModel | 
        try {
            PolicyExecuteResponseModel result = apiInstance.executePolicy(tenantId, policyId, policyExecuteRequestModel);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling PolicyApi#executePolicy");
            e.printStackTrace();
        }
    }
}
Configuration *apiConfig = [Configuration sharedConfig];

// Configure API key authorization: (authentication scheme: auth_token)
[apiConfig setApiKey:@"YOUR_API_KEY" forApiKeyIdentifier:@"X-Auth-Token"];
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
//[apiConfig setApiKeyPrefix:@"Bearer" forApiKeyIdentifier:@"X-Auth-Token"];

// Configure API key authorization: (authentication scheme: auth_user)
[apiConfig setApiKey:@"YOUR_API_KEY" forApiKeyIdentifier:@"X-Auth-User"];
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
//[apiConfig setApiKeyPrefix:@"Bearer" forApiKeyIdentifier:@"X-Auth-User"];

String *tenantId = tenantId_example; // Specify the tenant Id of the policy to be executed, this can be obtained using the list tenant api
String *policyId = policyId_example; // specify the policy id to execute, policy id can be obtained from the list policy api
PolicyExecuteRequestModel *policyExecuteRequestModel = ; // 

PolicyApi *apiInstance = [[PolicyApi alloc] init];

[apiInstance executePolicyWith:tenantId
    policyId:policyId
    policyExecuteRequestModel:policyExecuteRequestModel
              completionHandler: ^(PolicyExecuteResponseModel output, NSError* error) {
                            if (output) {
                                NSLog(@"%@", output);
                            }
                            if (error) {
                                NSLog(@"Error: %@", error);
                            }
                        }];
var CorestackExternalApi = require('corestack_external_api');
var defaultClient = CorestackExternalApi.ApiClient.instance;

// Configure API key authorization: auth_token
var auth_token = defaultClient.authentications['auth_token'];
auth_token.apiKey = "YOUR API KEY"
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//auth_token.apiKeyPrefix['X-Auth-Token'] = "Token"

// Configure API key authorization: auth_user
var auth_user = defaultClient.authentications['auth_user'];
auth_user.apiKey = "YOUR API KEY"
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//auth_user.apiKeyPrefix['X-Auth-User'] = "Token"

var api = new CorestackExternalApi.PolicyApi()

var tenantId = tenantId_example; // {String} Specify the tenant Id of the policy to be executed, this can be obtained using the list tenant api

var policyId = policyId_example; // {String} specify the policy id to execute, policy id can be obtained from the list policy api

var policyExecuteRequestModel = ; // {PolicyExecuteRequestModel} 


var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
api.executePolicy(tenantId, policyId, policyExecuteRequestModel, callback);
using System;
using System.Diagnostics;
using IO.Swagger.Api;
using IO.Swagger.Client;
using IO.Swagger.Model;

namespace Example
{
    public class executePolicyExample
    {
        public void main()
        {
            
            // Configure API key authorization: auth_token
            Configuration.Default.ApiKey.Add("X-Auth-Token", "YOUR_API_KEY");
            // Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
            // Configuration.Default.ApiKeyPrefix.Add("X-Auth-Token", "Bearer");
            // Configure API key authorization: auth_user
            Configuration.Default.ApiKey.Add("X-Auth-User", "YOUR_API_KEY");
            // Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
            // Configuration.Default.ApiKeyPrefix.Add("X-Auth-User", "Bearer");

            var apiInstance = new PolicyApi();
            var tenantId = tenantId_example;  // String | Specify the tenant Id of the policy to be executed, this can be obtained using the list tenant api
            var policyId = policyId_example;  // String | specify the policy id to execute, policy id can be obtained from the list policy api
            var policyExecuteRequestModel = new PolicyExecuteRequestModel(); // PolicyExecuteRequestModel | 

            try
            {
                PolicyExecuteResponseModel result = apiInstance.executePolicy(tenantId, policyId, policyExecuteRequestModel);
                Debug.WriteLine(result);
            }
            catch (Exception e)
            {
                Debug.Print("Exception when calling PolicyApi.executePolicy: " + e.Message );
            }
        }
    }
}
<?php
require_once(__DIR__ . '/vendor/autoload.php');

// Configure API key authorization: auth_token
Swagger\Client\Configuration::getDefaultConfiguration()->setApiKey('X-Auth-Token', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// Swagger\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('X-Auth-Token', 'Bearer');
// Configure API key authorization: auth_user
Swagger\Client\Configuration::getDefaultConfiguration()->setApiKey('X-Auth-User', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// Swagger\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('X-Auth-User', 'Bearer');

$api_instance = new Swagger\Client\Api\PolicyApi();
$tenantId = tenantId_example; // String | Specify the tenant Id of the policy to be executed, this can be obtained using the list tenant api
$policyId = policyId_example; // String | specify the policy id to execute, policy id can be obtained from the list policy api
$policyExecuteRequestModel = ; // PolicyExecuteRequestModel | 

try {
    $result = $api_instance->executePolicy($tenantId, $policyId, $policyExecuteRequestModel);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling PolicyApi->executePolicy: ', $e->getMessage(), PHP_EOL;
}
?>
use Data::Dumper;
use WWW::SwaggerClient::Configuration;
use WWW::SwaggerClient::PolicyApi;

# Configure API key authorization: auth_token
$WWW::SwaggerClient::Configuration::api_key->{'X-Auth-Token'} = 'YOUR_API_KEY';
# uncomment below to setup prefix (e.g. Bearer) for API key, if needed
#$WWW::SwaggerClient::Configuration::api_key_prefix->{'X-Auth-Token'} = "Bearer";
# Configure API key authorization: auth_user
$WWW::SwaggerClient::Configuration::api_key->{'X-Auth-User'} = 'YOUR_API_KEY';
# uncomment below to setup prefix (e.g. Bearer) for API key, if needed
#$WWW::SwaggerClient::Configuration::api_key_prefix->{'X-Auth-User'} = "Bearer";

my $api_instance = WWW::SwaggerClient::PolicyApi->new();
my $tenantId = tenantId_example; # String | Specify the tenant Id of the policy to be executed, this can be obtained using the list tenant api
my $policyId = policyId_example; # String | specify the policy id to execute, policy id can be obtained from the list policy api
my $policyExecuteRequestModel = WWW::SwaggerClient::Object::PolicyExecuteRequestModel->new(); # PolicyExecuteRequestModel | 

eval { 
    my $result = $api_instance->executePolicy(tenantId => $tenantId, policyId => $policyId, policyExecuteRequestModel => $policyExecuteRequestModel);
    print Dumper($result);
};
if ($@) {
    warn "Exception when calling PolicyApi->executePolicy: $@\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: auth_token
swagger_client.configuration.api_key['X-Auth-Token'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# swagger_client.configuration.api_key_prefix['X-Auth-Token'] = 'Bearer'
# Configure API key authorization: auth_user
swagger_client.configuration.api_key['X-Auth-User'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# swagger_client.configuration.api_key_prefix['X-Auth-User'] = 'Bearer'

# create an instance of the API class
api_instance = swagger_client.PolicyApi()
tenantId = tenantId_example # String | Specify the tenant Id of the policy to be executed, this can be obtained using the list tenant api
policyId = policyId_example # String | specify the policy id to execute, policy id can be obtained from the list policy api
policyExecuteRequestModel =  # PolicyExecuteRequestModel | 

try: 
    api_response = api_instance.execute_policy(tenantId, policyId, policyExecuteRequestModel)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling PolicyApi->executePolicy: %s\n" % e)

Parameters

Path parameters
Name Description
tenant_id*
String
Specify the tenant Id of the policy to be executed, this can be obtained using the list tenant api
Required
policy_id*
String
specify the policy id to execute, policy id can be obtained from the list policy api
Required
Body parameters
Name Description
policyExecuteRequestModel *

Responses

Status: 200 - Success

Status: 400 - Bad Request

Status: 401 - Unauthorized

Status: 500 - Internal Server Error


executeRecommendation

This is the api to execute recommendations for a policy violation, The recommended steps to resolve the violations can be executed with the help of data like action_name, resource_recommendation_id, will be available in Recommendation View API.The Recommendations can be executed with dynamic parameter which may or may not be passed in the input


/v1/{tenant_id}/recommendations/{recommendation_id}

Usage and SDK Samples

curl -X POST -H "X-Auth-Token: [[apiKey]]" -H "X-Auth-User: [[apiKey]]" "https://localhost/v1/{tenant_id}/recommendations/{recommendation_id}"
import io.swagger.client.*;
import io.swagger.client.auth.*;
import io.swagger.client.model.*;
import io.swagger.client.api.PolicyApi;

import java.io.File;
import java.util.*;

public class PolicyApiExample {

    public static void main(String[] args) {
        ApiClient defaultClient = Configuration.getDefaultApiClient();
        
        // Configure API key authorization: auth_token
        ApiKeyAuth auth_token = (ApiKeyAuth) defaultClient.getAuthentication("auth_token");
        auth_token.setApiKey("YOUR API KEY");
        // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
        //auth_token.setApiKeyPrefix("Token");

        // Configure API key authorization: auth_user
        ApiKeyAuth auth_user = (ApiKeyAuth) defaultClient.getAuthentication("auth_user");
        auth_user.setApiKey("YOUR API KEY");
        // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
        //auth_user.setApiKeyPrefix("Token");

        PolicyApi apiInstance = new PolicyApi();
        String tenantId = tenantId_example; // String | Specify the tenant Id to execute recommendation, this is a unique id can be retrieved using the list tenant api
        String recommendationId = recommendationId_example; // String | This is a unique identifier for recommendation, can be obtained from the  PolicyRecommendations api response
        ExecuteRecommendationRequestModel executeRecommendationRequestModel = ; // ExecuteRecommendationRequestModel | 
        try {
            ExecuteRecommendationResponseModel result = apiInstance.executeRecommendation(tenantId, recommendationId, executeRecommendationRequestModel);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling PolicyApi#executeRecommendation");
            e.printStackTrace();
        }
    }
}
import io.swagger.client.api.PolicyApi;

public class PolicyApiExample {

    public static void main(String[] args) {
        PolicyApi apiInstance = new PolicyApi();
        String tenantId = tenantId_example; // String | Specify the tenant Id to execute recommendation, this is a unique id can be retrieved using the list tenant api
        String recommendationId = recommendationId_example; // String | This is a unique identifier for recommendation, can be obtained from the  PolicyRecommendations api response
        ExecuteRecommendationRequestModel executeRecommendationRequestModel = ; // ExecuteRecommendationRequestModel | 
        try {
            ExecuteRecommendationResponseModel result = apiInstance.executeRecommendation(tenantId, recommendationId, executeRecommendationRequestModel);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling PolicyApi#executeRecommendation");
            e.printStackTrace();
        }
    }
}
Configuration *apiConfig = [Configuration sharedConfig];

// Configure API key authorization: (authentication scheme: auth_token)
[apiConfig setApiKey:@"YOUR_API_KEY" forApiKeyIdentifier:@"X-Auth-Token"];
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
//[apiConfig setApiKeyPrefix:@"Bearer" forApiKeyIdentifier:@"X-Auth-Token"];

// Configure API key authorization: (authentication scheme: auth_user)
[apiConfig setApiKey:@"YOUR_API_KEY" forApiKeyIdentifier:@"X-Auth-User"];
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
//[apiConfig setApiKeyPrefix:@"Bearer" forApiKeyIdentifier:@"X-Auth-User"];

String *tenantId = tenantId_example; // Specify the tenant Id to execute recommendation, this is a unique id can be retrieved using the list tenant api
String *recommendationId = recommendationId_example; // This is a unique identifier for recommendation, can be obtained from the  PolicyRecommendations api response
ExecuteRecommendationRequestModel *executeRecommendationRequestModel = ; // 

PolicyApi *apiInstance = [[PolicyApi alloc] init];

[apiInstance executeRecommendationWith:tenantId
    recommendationId:recommendationId
    executeRecommendationRequestModel:executeRecommendationRequestModel
              completionHandler: ^(ExecuteRecommendationResponseModel output, NSError* error) {
                            if (output) {
                                NSLog(@"%@", output);
                            }
                            if (error) {
                                NSLog(@"Error: %@", error);
                            }
                        }];
var CorestackExternalApi = require('corestack_external_api');
var defaultClient = CorestackExternalApi.ApiClient.instance;

// Configure API key authorization: auth_token
var auth_token = defaultClient.authentications['auth_token'];
auth_token.apiKey = "YOUR API KEY"
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//auth_token.apiKeyPrefix['X-Auth-Token'] = "Token"

// Configure API key authorization: auth_user
var auth_user = defaultClient.authentications['auth_user'];
auth_user.apiKey = "YOUR API KEY"
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//auth_user.apiKeyPrefix['X-Auth-User'] = "Token"

var api = new CorestackExternalApi.PolicyApi()

var tenantId = tenantId_example; // {String} Specify the tenant Id to execute recommendation, this is a unique id can be retrieved using the list tenant api

var recommendationId = recommendationId_example; // {String} This is a unique identifier for recommendation, can be obtained from the  PolicyRecommendations api response

var executeRecommendationRequestModel = ; // {ExecuteRecommendationRequestModel} 


var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
api.executeRecommendation(tenantId, recommendationId, executeRecommendationRequestModel, callback);
using System;
using System.Diagnostics;
using IO.Swagger.Api;
using IO.Swagger.Client;
using IO.Swagger.Model;

namespace Example
{
    public class executeRecommendationExample
    {
        public void main()
        {
            
            // Configure API key authorization: auth_token
            Configuration.Default.ApiKey.Add("X-Auth-Token", "YOUR_API_KEY");
            // Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
            // Configuration.Default.ApiKeyPrefix.Add("X-Auth-Token", "Bearer");
            // Configure API key authorization: auth_user
            Configuration.Default.ApiKey.Add("X-Auth-User", "YOUR_API_KEY");
            // Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
            // Configuration.Default.ApiKeyPrefix.Add("X-Auth-User", "Bearer");

            var apiInstance = new PolicyApi();
            var tenantId = tenantId_example;  // String | Specify the tenant Id to execute recommendation, this is a unique id can be retrieved using the list tenant api
            var recommendationId = recommendationId_example;  // String | This is a unique identifier for recommendation, can be obtained from the  PolicyRecommendations api response
            var executeRecommendationRequestModel = new ExecuteRecommendationRequestModel(); // ExecuteRecommendationRequestModel | 

            try
            {
                ExecuteRecommendationResponseModel result = apiInstance.executeRecommendation(tenantId, recommendationId, executeRecommendationRequestModel);
                Debug.WriteLine(result);
            }
            catch (Exception e)
            {
                Debug.Print("Exception when calling PolicyApi.executeRecommendation: " + e.Message );
            }
        }
    }
}
<?php
require_once(__DIR__ . '/vendor/autoload.php');

// Configure API key authorization: auth_token
Swagger\Client\Configuration::getDefaultConfiguration()->setApiKey('X-Auth-Token', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// Swagger\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('X-Auth-Token', 'Bearer');
// Configure API key authorization: auth_user
Swagger\Client\Configuration::getDefaultConfiguration()->setApiKey('X-Auth-User', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// Swagger\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('X-Auth-User', 'Bearer');

$api_instance = new Swagger\Client\Api\PolicyApi();
$tenantId = tenantId_example; // String | Specify the tenant Id to execute recommendation, this is a unique id can be retrieved using the list tenant api
$recommendationId = recommendationId_example; // String | This is a unique identifier for recommendation, can be obtained from the  PolicyRecommendations api response
$executeRecommendationRequestModel = ; // ExecuteRecommendationRequestModel | 

try {
    $result = $api_instance->executeRecommendation($tenantId, $recommendationId, $executeRecommendationRequestModel);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling PolicyApi->executeRecommendation: ', $e->getMessage(), PHP_EOL;
}
?>
use Data::Dumper;
use WWW::SwaggerClient::Configuration;
use WWW::SwaggerClient::PolicyApi;

# Configure API key authorization: auth_token
$WWW::SwaggerClient::Configuration::api_key->{'X-Auth-Token'} = 'YOUR_API_KEY';
# uncomment below to setup prefix (e.g. Bearer) for API key, if needed
#$WWW::SwaggerClient::Configuration::api_key_prefix->{'X-Auth-Token'} = "Bearer";
# Configure API key authorization: auth_user
$WWW::SwaggerClient::Configuration::api_key->{'X-Auth-User'} = 'YOUR_API_KEY';
# uncomment below to setup prefix (e.g. Bearer) for API key, if needed
#$WWW::SwaggerClient::Configuration::api_key_prefix->{'X-Auth-User'} = "Bearer";

my $api_instance = WWW::SwaggerClient::PolicyApi->new();
my $tenantId = tenantId_example; # String | Specify the tenant Id to execute recommendation, this is a unique id can be retrieved using the list tenant api
my $recommendationId = recommendationId_example; # String | This is a unique identifier for recommendation, can be obtained from the  PolicyRecommendations api response
my $executeRecommendationRequestModel = WWW::SwaggerClient::Object::ExecuteRecommendationRequestModel->new(); # ExecuteRecommendationRequestModel | 

eval { 
    my $result = $api_instance->executeRecommendation(tenantId => $tenantId, recommendationId => $recommendationId, executeRecommendationRequestModel => $executeRecommendationRequestModel);
    print Dumper($result);
};
if ($@) {
    warn "Exception when calling PolicyApi->executeRecommendation: $@\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: auth_token
swagger_client.configuration.api_key['X-Auth-Token'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# swagger_client.configuration.api_key_prefix['X-Auth-Token'] = 'Bearer'
# Configure API key authorization: auth_user
swagger_client.configuration.api_key['X-Auth-User'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# swagger_client.configuration.api_key_prefix['X-Auth-User'] = 'Bearer'

# create an instance of the API class
api_instance = swagger_client.PolicyApi()
tenantId = tenantId_example # String | Specify the tenant Id to execute recommendation, this is a unique id can be retrieved using the list tenant api
recommendationId = recommendationId_example # String | This is a unique identifier for recommendation, can be obtained from the  PolicyRecommendations api response
executeRecommendationRequestModel =  # ExecuteRecommendationRequestModel | 

try: 
    api_response = api_instance.execute_recommendation(tenantId, recommendationId, executeRecommendationRequestModel)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling PolicyApi->executeRecommendation: %s\n" % e)

Parameters

Path parameters
Name Description
tenant_id*
String
Specify the tenant Id to execute recommendation, this is a unique id can be retrieved using the list tenant api
Required
recommendation_id*
String
This is a unique identifier for recommendation, can be obtained from the PolicyRecommendations api response
Required
Body parameters
Name Description
executeRecommendationRequestModel *

Responses

Status: 200 - Success

Status: 400 - Bad Request

Status: 401 - Unauthorized

Status: 500 - Internal Server Error


jobDetails

Retrieve policy job details using the unique job id, this can be used to check the statusof the policy execution or any failure


/v1/{tenant_id}/policy_jobs/{job_id}

Usage and SDK Samples

curl -X GET -H "X-Auth-Token: [[apiKey]]" -H "X-Auth-User: [[apiKey]]" "https://localhost/v1/{tenant_id}/policy_jobs/{job_id}"
import io.swagger.client.*;
import io.swagger.client.auth.*;
import io.swagger.client.model.*;
import io.swagger.client.api.PolicyApi;

import java.io.File;
import java.util.*;

public class PolicyApiExample {

    public static void main(String[] args) {
        ApiClient defaultClient = Configuration.getDefaultApiClient();
        
        // Configure API key authorization: auth_token
        ApiKeyAuth auth_token = (ApiKeyAuth) defaultClient.getAuthentication("auth_token");
        auth_token.setApiKey("YOUR API KEY");
        // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
        //auth_token.setApiKeyPrefix("Token");

        // Configure API key authorization: auth_user
        ApiKeyAuth auth_user = (ApiKeyAuth) defaultClient.getAuthentication("auth_user");
        auth_user.setApiKey("YOUR API KEY");
        // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
        //auth_user.setApiKeyPrefix("Token");

        PolicyApi apiInstance = new PolicyApi();
        String tenantId = tenantId_example; // String | Specify the tenant Id for the policy which is a unique value can be obtained from the list tenant api
        String jobId = jobId_example; // String | specify the job id to retrieve details of policy execution, job id is unique can be obtained from the execute policy response
        try {
            JobExecutionDetailsResponseModel result = apiInstance.jobDetails(tenantId, jobId);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling PolicyApi#jobDetails");
            e.printStackTrace();
        }
    }
}
import io.swagger.client.api.PolicyApi;

public class PolicyApiExample {

    public static void main(String[] args) {
        PolicyApi apiInstance = new PolicyApi();
        String tenantId = tenantId_example; // String | Specify the tenant Id for the policy which is a unique value can be obtained from the list tenant api
        String jobId = jobId_example; // String | specify the job id to retrieve details of policy execution, job id is unique can be obtained from the execute policy response
        try {
            JobExecutionDetailsResponseModel result = apiInstance.jobDetails(tenantId, jobId);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling PolicyApi#jobDetails");
            e.printStackTrace();
        }
    }
}
Configuration *apiConfig = [Configuration sharedConfig];

// Configure API key authorization: (authentication scheme: auth_token)
[apiConfig setApiKey:@"YOUR_API_KEY" forApiKeyIdentifier:@"X-Auth-Token"];
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
//[apiConfig setApiKeyPrefix:@"Bearer" forApiKeyIdentifier:@"X-Auth-Token"];

// Configure API key authorization: (authentication scheme: auth_user)
[apiConfig setApiKey:@"YOUR_API_KEY" forApiKeyIdentifier:@"X-Auth-User"];
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
//[apiConfig setApiKeyPrefix:@"Bearer" forApiKeyIdentifier:@"X-Auth-User"];

String *tenantId = tenantId_example; // Specify the tenant Id for the policy which is a unique value can be obtained from the list tenant api
String *jobId = jobId_example; // specify the job id to retrieve details of policy execution, job id is unique can be obtained from the execute policy response

PolicyApi *apiInstance = [[PolicyApi alloc] init];

[apiInstance jobDetailsWith:tenantId
    jobId:jobId
              completionHandler: ^(JobExecutionDetailsResponseModel output, NSError* error) {
                            if (output) {
                                NSLog(@"%@", output);
                            }
                            if (error) {
                                NSLog(@"Error: %@", error);
                            }
                        }];
var CorestackExternalApi = require('corestack_external_api');
var defaultClient = CorestackExternalApi.ApiClient.instance;

// Configure API key authorization: auth_token
var auth_token = defaultClient.authentications['auth_token'];
auth_token.apiKey = "YOUR API KEY"
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//auth_token.apiKeyPrefix['X-Auth-Token'] = "Token"

// Configure API key authorization: auth_user
var auth_user = defaultClient.authentications['auth_user'];
auth_user.apiKey = "YOUR API KEY"
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//auth_user.apiKeyPrefix['X-Auth-User'] = "Token"

var api = new CorestackExternalApi.PolicyApi()

var tenantId = tenantId_example; // {String} Specify the tenant Id for the policy which is a unique value can be obtained from the list tenant api

var jobId = jobId_example; // {String} specify the job id to retrieve details of policy execution, job id is unique can be obtained from the execute policy response


var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
api.jobDetails(tenantId, jobId, callback);
using System;
using System.Diagnostics;
using IO.Swagger.Api;
using IO.Swagger.Client;
using IO.Swagger.Model;

namespace Example
{
    public class jobDetailsExample
    {
        public void main()
        {
            
            // Configure API key authorization: auth_token
            Configuration.Default.ApiKey.Add("X-Auth-Token", "YOUR_API_KEY");
            // Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
            // Configuration.Default.ApiKeyPrefix.Add("X-Auth-Token", "Bearer");
            // Configure API key authorization: auth_user
            Configuration.Default.ApiKey.Add("X-Auth-User", "YOUR_API_KEY");
            // Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
            // Configuration.Default.ApiKeyPrefix.Add("X-Auth-User", "Bearer");

            var apiInstance = new PolicyApi();
            var tenantId = tenantId_example;  // String | Specify the tenant Id for the policy which is a unique value can be obtained from the list tenant api
            var jobId = jobId_example;  // String | specify the job id to retrieve details of policy execution, job id is unique can be obtained from the execute policy response

            try
            {
                JobExecutionDetailsResponseModel result = apiInstance.jobDetails(tenantId, jobId);
                Debug.WriteLine(result);
            }
            catch (Exception e)
            {
                Debug.Print("Exception when calling PolicyApi.jobDetails: " + e.Message );
            }
        }
    }
}
<?php
require_once(__DIR__ . '/vendor/autoload.php');

// Configure API key authorization: auth_token
Swagger\Client\Configuration::getDefaultConfiguration()->setApiKey('X-Auth-Token', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// Swagger\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('X-Auth-Token', 'Bearer');
// Configure API key authorization: auth_user
Swagger\Client\Configuration::getDefaultConfiguration()->setApiKey('X-Auth-User', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// Swagger\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('X-Auth-User', 'Bearer');

$api_instance = new Swagger\Client\Api\PolicyApi();
$tenantId = tenantId_example; // String | Specify the tenant Id for the policy which is a unique value can be obtained from the list tenant api
$jobId = jobId_example; // String | specify the job id to retrieve details of policy execution, job id is unique can be obtained from the execute policy response

try {
    $result = $api_instance->jobDetails($tenantId, $jobId);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling PolicyApi->jobDetails: ', $e->getMessage(), PHP_EOL;
}
?>
use Data::Dumper;
use WWW::SwaggerClient::Configuration;
use WWW::SwaggerClient::PolicyApi;

# Configure API key authorization: auth_token
$WWW::SwaggerClient::Configuration::api_key->{'X-Auth-Token'} = 'YOUR_API_KEY';
# uncomment below to setup prefix (e.g. Bearer) for API key, if needed
#$WWW::SwaggerClient::Configuration::api_key_prefix->{'X-Auth-Token'} = "Bearer";
# Configure API key authorization: auth_user
$WWW::SwaggerClient::Configuration::api_key->{'X-Auth-User'} = 'YOUR_API_KEY';
# uncomment below to setup prefix (e.g. Bearer) for API key, if needed
#$WWW::SwaggerClient::Configuration::api_key_prefix->{'X-Auth-User'} = "Bearer";

my $api_instance = WWW::SwaggerClient::PolicyApi->new();
my $tenantId = tenantId_example; # String | Specify the tenant Id for the policy which is a unique value can be obtained from the list tenant api
my $jobId = jobId_example; # String | specify the job id to retrieve details of policy execution, job id is unique can be obtained from the execute policy response

eval { 
    my $result = $api_instance->jobDetails(tenantId => $tenantId, jobId => $jobId);
    print Dumper($result);
};
if ($@) {
    warn "Exception when calling PolicyApi->jobDetails: $@\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: auth_token
swagger_client.configuration.api_key['X-Auth-Token'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# swagger_client.configuration.api_key_prefix['X-Auth-Token'] = 'Bearer'
# Configure API key authorization: auth_user
swagger_client.configuration.api_key['X-Auth-User'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# swagger_client.configuration.api_key_prefix['X-Auth-User'] = 'Bearer'

# create an instance of the API class
api_instance = swagger_client.PolicyApi()
tenantId = tenantId_example # String | Specify the tenant Id for the policy which is a unique value can be obtained from the list tenant api
jobId = jobId_example # String | specify the job id to retrieve details of policy execution, job id is unique can be obtained from the execute policy response

try: 
    api_response = api_instance.job_details(tenantId, jobId)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling PolicyApi->jobDetails: %s\n" % e)

Parameters

Path parameters
Name Description
tenant_id*
String
Specify the tenant Id for the policy which is a unique value can be obtained from the list tenant api
Required
job_id*
String
specify the job id to retrieve details of policy execution, job id is unique can be obtained from the execute policy response
Required

Responses

Status: 200 - Success

Status: 400 - Bad Request

Status: 401 - Unauthorized

Status: 500 - Internal Server Error


listPolicies

List all the policies. Global Policies Scope- All user will have access to Corestack Marketplace Policies these policies cannot be updated and deleted can be only describe and executed. Account Scope:- All users under that account will have access to view and execute Only Account admins can update/delete the policies.Tenant Scope - Users with access to the specific tenant will have access to policies who can describe or execute policies. Tenant admins can only update/delete. Private Scope - User who created will only have access


/v1/{tenant_id}/policies

Usage and SDK Samples

curl -X GET -H "X-Auth-Token: [[apiKey]]" -H "X-Auth-User: [[apiKey]]" "https://localhost/v1/{tenant_id}/policies?engine_type=&limit=&page="
import io.swagger.client.*;
import io.swagger.client.auth.*;
import io.swagger.client.model.*;
import io.swagger.client.api.PolicyApi;

import java.io.File;
import java.util.*;

public class PolicyApiExample {

    public static void main(String[] args) {
        ApiClient defaultClient = Configuration.getDefaultApiClient();
        
        // Configure API key authorization: auth_token
        ApiKeyAuth auth_token = (ApiKeyAuth) defaultClient.getAuthentication("auth_token");
        auth_token.setApiKey("YOUR API KEY");
        // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
        //auth_token.setApiKeyPrefix("Token");

        // Configure API key authorization: auth_user
        ApiKeyAuth auth_user = (ApiKeyAuth) defaultClient.getAuthentication("auth_user");
        auth_user.setApiKey("YOUR API KEY");
        // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
        //auth_user.setApiKeyPrefix("Token");

        PolicyApi apiInstance = new PolicyApi();
        String tenantId = tenantId_example; // String | Specify the tenant Id to list policies which is a unique id can be obtained using  the list tenant api
        String engineType = engineType_example; // String | Engine types filter
        Integer limit = 56; // Integer | Number of records to display
        Integer page = 56; // Integer | Page number
        try {
            PolicyListResponse result = apiInstance.listPolicies(tenantId, engineType, limit, page);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling PolicyApi#listPolicies");
            e.printStackTrace();
        }
    }
}
import io.swagger.client.api.PolicyApi;

public class PolicyApiExample {

    public static void main(String[] args) {
        PolicyApi apiInstance = new PolicyApi();
        String tenantId = tenantId_example; // String | Specify the tenant Id to list policies which is a unique id can be obtained using  the list tenant api
        String engineType = engineType_example; // String | Engine types filter
        Integer limit = 56; // Integer | Number of records to display
        Integer page = 56; // Integer | Page number
        try {
            PolicyListResponse result = apiInstance.listPolicies(tenantId, engineType, limit, page);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling PolicyApi#listPolicies");
            e.printStackTrace();
        }
    }
}
Configuration *apiConfig = [Configuration sharedConfig];

// Configure API key authorization: (authentication scheme: auth_token)
[apiConfig setApiKey:@"YOUR_API_KEY" forApiKeyIdentifier:@"X-Auth-Token"];
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
//[apiConfig setApiKeyPrefix:@"Bearer" forApiKeyIdentifier:@"X-Auth-Token"];

// Configure API key authorization: (authentication scheme: auth_user)
[apiConfig setApiKey:@"YOUR_API_KEY" forApiKeyIdentifier:@"X-Auth-User"];
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
//[apiConfig setApiKeyPrefix:@"Bearer" forApiKeyIdentifier:@"X-Auth-User"];

String *tenantId = tenantId_example; // Specify the tenant Id to list policies which is a unique id can be obtained using  the list tenant api
String *engineType = engineType_example; // Engine types filter (optional)
Integer *limit = 56; // Number of records to display (optional)
Integer *page = 56; // Page number (optional)

PolicyApi *apiInstance = [[PolicyApi alloc] init];

[apiInstance listPoliciesWith:tenantId
    engineType:engineType
    limit:limit
    page:page
              completionHandler: ^(PolicyListResponse output, NSError* error) {
                            if (output) {
                                NSLog(@"%@", output);
                            }
                            if (error) {
                                NSLog(@"Error: %@", error);
                            }
                        }];
var CorestackExternalApi = require('corestack_external_api');
var defaultClient = CorestackExternalApi.ApiClient.instance;

// Configure API key authorization: auth_token
var auth_token = defaultClient.authentications['auth_token'];
auth_token.apiKey = "YOUR API KEY"
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//auth_token.apiKeyPrefix['X-Auth-Token'] = "Token"

// Configure API key authorization: auth_user
var auth_user = defaultClient.authentications['auth_user'];
auth_user.apiKey = "YOUR API KEY"
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//auth_user.apiKeyPrefix['X-Auth-User'] = "Token"

var api = new CorestackExternalApi.PolicyApi()

var tenantId = tenantId_example; // {String} Specify the tenant Id to list policies which is a unique id can be obtained using  the list tenant api

var opts = { 
  'engineType': engineType_example, // {String} Engine types filter
  'limit': 56, // {Integer} Number of records to display
  'page': 56 // {Integer} Page number
};

var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
api.listPolicies(tenantId, opts, callback);
using System;
using System.Diagnostics;
using IO.Swagger.Api;
using IO.Swagger.Client;
using IO.Swagger.Model;

namespace Example
{
    public class listPoliciesExample
    {
        public void main()
        {
            
            // Configure API key authorization: auth_token
            Configuration.Default.ApiKey.Add("X-Auth-Token", "YOUR_API_KEY");
            // Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
            // Configuration.Default.ApiKeyPrefix.Add("X-Auth-Token", "Bearer");
            // Configure API key authorization: auth_user
            Configuration.Default.ApiKey.Add("X-Auth-User", "YOUR_API_KEY");
            // Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
            // Configuration.Default.ApiKeyPrefix.Add("X-Auth-User", "Bearer");

            var apiInstance = new PolicyApi();
            var tenantId = tenantId_example;  // String | Specify the tenant Id to list policies which is a unique id can be obtained using  the list tenant api
            var engineType = engineType_example;  // String | Engine types filter (optional) 
            var limit = 56;  // Integer | Number of records to display (optional) 
            var page = 56;  // Integer | Page number (optional) 

            try
            {
                PolicyListResponse result = apiInstance.listPolicies(tenantId, engineType, limit, page);
                Debug.WriteLine(result);
            }
            catch (Exception e)
            {
                Debug.Print("Exception when calling PolicyApi.listPolicies: " + e.Message );
            }
        }
    }
}
<?php
require_once(__DIR__ . '/vendor/autoload.php');

// Configure API key authorization: auth_token
Swagger\Client\Configuration::getDefaultConfiguration()->setApiKey('X-Auth-Token', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// Swagger\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('X-Auth-Token', 'Bearer');
// Configure API key authorization: auth_user
Swagger\Client\Configuration::getDefaultConfiguration()->setApiKey('X-Auth-User', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// Swagger\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('X-Auth-User', 'Bearer');

$api_instance = new Swagger\Client\Api\PolicyApi();
$tenantId = tenantId_example; // String | Specify the tenant Id to list policies which is a unique id can be obtained using  the list tenant api
$engineType = engineType_example; // String | Engine types filter
$limit = 56; // Integer | Number of records to display
$page = 56; // Integer | Page number

try {
    $result = $api_instance->listPolicies($tenantId, $engineType, $limit, $page);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling PolicyApi->listPolicies: ', $e->getMessage(), PHP_EOL;
}
?>
use Data::Dumper;
use WWW::SwaggerClient::Configuration;
use WWW::SwaggerClient::PolicyApi;

# Configure API key authorization: auth_token
$WWW::SwaggerClient::Configuration::api_key->{'X-Auth-Token'} = 'YOUR_API_KEY';
# uncomment below to setup prefix (e.g. Bearer) for API key, if needed
#$WWW::SwaggerClient::Configuration::api_key_prefix->{'X-Auth-Token'} = "Bearer";
# Configure API key authorization: auth_user
$WWW::SwaggerClient::Configuration::api_key->{'X-Auth-User'} = 'YOUR_API_KEY';
# uncomment below to setup prefix (e.g. Bearer) for API key, if needed
#$WWW::SwaggerClient::Configuration::api_key_prefix->{'X-Auth-User'} = "Bearer";

my $api_instance = WWW::SwaggerClient::PolicyApi->new();
my $tenantId = tenantId_example; # String | Specify the tenant Id to list policies which is a unique id can be obtained using  the list tenant api
my $engineType = engineType_example; # String | Engine types filter
my $limit = 56; # Integer | Number of records to display
my $page = 56; # Integer | Page number

eval { 
    my $result = $api_instance->listPolicies(tenantId => $tenantId, engineType => $engineType, limit => $limit, page => $page);
    print Dumper($result);
};
if ($@) {
    warn "Exception when calling PolicyApi->listPolicies: $@\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: auth_token
swagger_client.configuration.api_key['X-Auth-Token'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# swagger_client.configuration.api_key_prefix['X-Auth-Token'] = 'Bearer'
# Configure API key authorization: auth_user
swagger_client.configuration.api_key['X-Auth-User'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# swagger_client.configuration.api_key_prefix['X-Auth-User'] = 'Bearer'

# create an instance of the API class
api_instance = swagger_client.PolicyApi()
tenantId = tenantId_example # String | Specify the tenant Id to list policies which is a unique id can be obtained using  the list tenant api
engineType = engineType_example # String | Engine types filter (optional)
limit = 56 # Integer | Number of records to display (optional)
page = 56 # Integer | Page number (optional)

try: 
    api_response = api_instance.list_policies(tenantId, engineType=engineType, limit=limit, page=page)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling PolicyApi->listPolicies: %s\n" % e)

Parameters

Path parameters
Name Description
tenant_id*
String
Specify the tenant Id to list policies which is a unique id can be obtained using the list tenant api
Required
Query parameters
Name Description
engine_type
String
Engine types filter
limit
Integer
Number of records to display
page
Integer
Page number

Responses

Status: 200 - Success

Status: 400 - Bad Request

Status: 401 - Unauthorized

Status: 500 - Internal Server Error


policyRecommendations

Policy recommendations are the guide line to the users to solve a policy violation by executing the recommendations the this can be a instruction or a combination of multipleinstructions defined to solve a problem


/v1/{tenant_id}/recommendations

Usage and SDK Samples

curl -X GET -H "X-Auth-Token: [[apiKey]]" -H "X-Auth-User: [[apiKey]]" "https://localhost/v1/{tenant_id}/recommendations?policy_id=&cloud_account_id="
import io.swagger.client.*;
import io.swagger.client.auth.*;
import io.swagger.client.model.*;
import io.swagger.client.api.PolicyApi;

import java.io.File;
import java.util.*;

public class PolicyApiExample {

    public static void main(String[] args) {
        ApiClient defaultClient = Configuration.getDefaultApiClient();
        
        // Configure API key authorization: auth_token
        ApiKeyAuth auth_token = (ApiKeyAuth) defaultClient.getAuthentication("auth_token");
        auth_token.setApiKey("YOUR API KEY");
        // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
        //auth_token.setApiKeyPrefix("Token");

        // Configure API key authorization: auth_user
        ApiKeyAuth auth_user = (ApiKeyAuth) defaultClient.getAuthentication("auth_user");
        auth_user.setApiKey("YOUR API KEY");
        // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
        //auth_user.setApiKeyPrefix("Token");

        PolicyApi apiInstance = new PolicyApi();
        String tenantId = tenantId_example; // String | Specify the tenant Id for the policy which is a unique value can be obtained from the list tenant api
        String policyId = policyId_example; // String | specify the policy id for the recommendations which is a unique id can be obtained from policy listing api
        String cloudAccountId = cloudAccountId_example; // String | specify the cloud account id  for the recommendation which is a unique id can be retrieved from the cloud listing api
        try {
            PolicyRecommendationResponseModelList result = apiInstance.policyRecommendations(tenantId, policyId, cloudAccountId);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling PolicyApi#policyRecommendations");
            e.printStackTrace();
        }
    }
}
import io.swagger.client.api.PolicyApi;

public class PolicyApiExample {

    public static void main(String[] args) {
        PolicyApi apiInstance = new PolicyApi();
        String tenantId = tenantId_example; // String | Specify the tenant Id for the policy which is a unique value can be obtained from the list tenant api
        String policyId = policyId_example; // String | specify the policy id for the recommendations which is a unique id can be obtained from policy listing api
        String cloudAccountId = cloudAccountId_example; // String | specify the cloud account id  for the recommendation which is a unique id can be retrieved from the cloud listing api
        try {
            PolicyRecommendationResponseModelList result = apiInstance.policyRecommendations(tenantId, policyId, cloudAccountId);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling PolicyApi#policyRecommendations");
            e.printStackTrace();
        }
    }
}
Configuration *apiConfig = [Configuration sharedConfig];

// Configure API key authorization: (authentication scheme: auth_token)
[apiConfig setApiKey:@"YOUR_API_KEY" forApiKeyIdentifier:@"X-Auth-Token"];
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
//[apiConfig setApiKeyPrefix:@"Bearer" forApiKeyIdentifier:@"X-Auth-Token"];

// Configure API key authorization: (authentication scheme: auth_user)
[apiConfig setApiKey:@"YOUR_API_KEY" forApiKeyIdentifier:@"X-Auth-User"];
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
//[apiConfig setApiKeyPrefix:@"Bearer" forApiKeyIdentifier:@"X-Auth-User"];

String *tenantId = tenantId_example; // Specify the tenant Id for the policy which is a unique value can be obtained from the list tenant api
String *policyId = policyId_example; // specify the policy id for the recommendations which is a unique id can be obtained from policy listing api (optional)
String *cloudAccountId = cloudAccountId_example; // specify the cloud account id  for the recommendation which is a unique id can be retrieved from the cloud listing api (optional)

PolicyApi *apiInstance = [[PolicyApi alloc] init];

[apiInstance policyRecommendationsWith:tenantId
    policyId:policyId
    cloudAccountId:cloudAccountId
              completionHandler: ^(PolicyRecommendationResponseModelList output, NSError* error) {
                            if (output) {
                                NSLog(@"%@", output);
                            }
                            if (error) {
                                NSLog(@"Error: %@", error);
                            }
                        }];
var CorestackExternalApi = require('corestack_external_api');
var defaultClient = CorestackExternalApi.ApiClient.instance;

// Configure API key authorization: auth_token
var auth_token = defaultClient.authentications['auth_token'];
auth_token.apiKey = "YOUR API KEY"
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//auth_token.apiKeyPrefix['X-Auth-Token'] = "Token"

// Configure API key authorization: auth_user
var auth_user = defaultClient.authentications['auth_user'];
auth_user.apiKey = "YOUR API KEY"
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//auth_user.apiKeyPrefix['X-Auth-User'] = "Token"

var api = new CorestackExternalApi.PolicyApi()

var tenantId = tenantId_example; // {String} Specify the tenant Id for the policy which is a unique value can be obtained from the list tenant api

var opts = { 
  'policyId': policyId_example, // {String} specify the policy id for the recommendations which is a unique id can be obtained from policy listing api
  'cloudAccountId': cloudAccountId_example // {String} specify the cloud account id  for the recommendation which is a unique id can be retrieved from the cloud listing api
};

var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
api.policyRecommendations(tenantId, opts, callback);
using System;
using System.Diagnostics;
using IO.Swagger.Api;
using IO.Swagger.Client;
using IO.Swagger.Model;

namespace Example
{
    public class policyRecommendationsExample
    {
        public void main()
        {
            
            // Configure API key authorization: auth_token
            Configuration.Default.ApiKey.Add("X-Auth-Token", "YOUR_API_KEY");
            // Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
            // Configuration.Default.ApiKeyPrefix.Add("X-Auth-Token", "Bearer");
            // Configure API key authorization: auth_user
            Configuration.Default.ApiKey.Add("X-Auth-User", "YOUR_API_KEY");
            // Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
            // Configuration.Default.ApiKeyPrefix.Add("X-Auth-User", "Bearer");

            var apiInstance = new PolicyApi();
            var tenantId = tenantId_example;  // String | Specify the tenant Id for the policy which is a unique value can be obtained from the list tenant api
            var policyId = policyId_example;  // String | specify the policy id for the recommendations which is a unique id can be obtained from policy listing api (optional) 
            var cloudAccountId = cloudAccountId_example;  // String | specify the cloud account id  for the recommendation which is a unique id can be retrieved from the cloud listing api (optional) 

            try
            {
                PolicyRecommendationResponseModelList result = apiInstance.policyRecommendations(tenantId, policyId, cloudAccountId);
                Debug.WriteLine(result);
            }
            catch (Exception e)
            {
                Debug.Print("Exception when calling PolicyApi.policyRecommendations: " + e.Message );
            }
        }
    }
}
<?php
require_once(__DIR__ . '/vendor/autoload.php');

// Configure API key authorization: auth_token
Swagger\Client\Configuration::getDefaultConfiguration()->setApiKey('X-Auth-Token', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// Swagger\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('X-Auth-Token', 'Bearer');
// Configure API key authorization: auth_user
Swagger\Client\Configuration::getDefaultConfiguration()->setApiKey('X-Auth-User', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// Swagger\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('X-Auth-User', 'Bearer');

$api_instance = new Swagger\Client\Api\PolicyApi();
$tenantId = tenantId_example; // String | Specify the tenant Id for the policy which is a unique value can be obtained from the list tenant api
$policyId = policyId_example; // String | specify the policy id for the recommendations which is a unique id can be obtained from policy listing api
$cloudAccountId = cloudAccountId_example; // String | specify the cloud account id  for the recommendation which is a unique id can be retrieved from the cloud listing api

try {
    $result = $api_instance->policyRecommendations($tenantId, $policyId, $cloudAccountId);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling PolicyApi->policyRecommendations: ', $e->getMessage(), PHP_EOL;
}
?>
use Data::Dumper;
use WWW::SwaggerClient::Configuration;
use WWW::SwaggerClient::PolicyApi;

# Configure API key authorization: auth_token
$WWW::SwaggerClient::Configuration::api_key->{'X-Auth-Token'} = 'YOUR_API_KEY';
# uncomment below to setup prefix (e.g. Bearer) for API key, if needed
#$WWW::SwaggerClient::Configuration::api_key_prefix->{'X-Auth-Token'} = "Bearer";
# Configure API key authorization: auth_user
$WWW::SwaggerClient::Configuration::api_key->{'X-Auth-User'} = 'YOUR_API_KEY';
# uncomment below to setup prefix (e.g. Bearer) for API key, if needed
#$WWW::SwaggerClient::Configuration::api_key_prefix->{'X-Auth-User'} = "Bearer";

my $api_instance = WWW::SwaggerClient::PolicyApi->new();
my $tenantId = tenantId_example; # String | Specify the tenant Id for the policy which is a unique value can be obtained from the list tenant api
my $policyId = policyId_example; # String | specify the policy id for the recommendations which is a unique id can be obtained from policy listing api
my $cloudAccountId = cloudAccountId_example; # String | specify the cloud account id  for the recommendation which is a unique id can be retrieved from the cloud listing api

eval { 
    my $result = $api_instance->policyRecommendations(tenantId => $tenantId, policyId => $policyId, cloudAccountId => $cloudAccountId);
    print Dumper($result);
};
if ($@) {
    warn "Exception when calling PolicyApi->policyRecommendations: $@\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: auth_token
swagger_client.configuration.api_key['X-Auth-Token'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# swagger_client.configuration.api_key_prefix['X-Auth-Token'] = 'Bearer'
# Configure API key authorization: auth_user
swagger_client.configuration.api_key['X-Auth-User'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# swagger_client.configuration.api_key_prefix['X-Auth-User'] = 'Bearer'

# create an instance of the API class
api_instance = swagger_client.PolicyApi()
tenantId = tenantId_example # String | Specify the tenant Id for the policy which is a unique value can be obtained from the list tenant api
policyId = policyId_example # String | specify the policy id for the recommendations which is a unique id can be obtained from policy listing api (optional)
cloudAccountId = cloudAccountId_example # String | specify the cloud account id  for the recommendation which is a unique id can be retrieved from the cloud listing api (optional)

try: 
    api_response = api_instance.policy_recommendations(tenantId, policyId=policyId, cloudAccountId=cloudAccountId)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling PolicyApi->policyRecommendations: %s\n" % e)

Parameters

Path parameters
Name Description
tenant_id*
String
Specify the tenant Id for the policy which is a unique value can be obtained from the list tenant api
Required
Query parameters
Name Description
policy_id
String
specify the policy id for the recommendations which is a unique id can be obtained from policy listing api
cloud_account_id
String
specify the cloud account id for the recommendation which is a unique id can be retrieved from the cloud listing api

Responses

Status: 200 - Success

Status: 400 - Bad Request

Status: 401 - Unauthorized

Status: 500 - Internal Server Error


updatePolicy

Update Policy details if required after creation using the api, the update by a user depends on the scope of the policy created check create policy docs for more details on the scope


/v1/{tenant_id}/policies/{policy_id}

Usage and SDK Samples

curl -X PUT -H "X-Auth-Token: [[apiKey]]" -H "X-Auth-User: [[apiKey]]" "https://localhost/v1/{tenant_id}/policies/{policy_id}"
import io.swagger.client.*;
import io.swagger.client.auth.*;
import io.swagger.client.model.*;
import io.swagger.client.api.PolicyApi;

import java.io.File;
import java.util.*;

public class PolicyApiExample {

    public static void main(String[] args) {
        ApiClient defaultClient = Configuration.getDefaultApiClient();
        
        // Configure API key authorization: auth_token
        ApiKeyAuth auth_token = (ApiKeyAuth) defaultClient.getAuthentication("auth_token");
        auth_token.setApiKey("YOUR API KEY");
        // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
        //auth_token.setApiKeyPrefix("Token");

        // Configure API key authorization: auth_user
        ApiKeyAuth auth_user = (ApiKeyAuth) defaultClient.getAuthentication("auth_user");
        auth_user.setApiKey("YOUR API KEY");
        // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
        //auth_user.setApiKeyPrefix("Token");

        PolicyApi apiInstance = new PolicyApi();
        String tenantId = tenantId_example; // String | Specify the tenant Id to update policy which is a unique id can be retrieved using the list tenant api
        String policyId = policyId_example; // String | specify the policy id to update which is a unique id can be retrieved using list policy api
        UpdatePolicyRequestModel updatePolicyRequestModel = ; // UpdatePolicyRequestModel | 
        try {
            UpdatePolicyRequest result = apiInstance.updatePolicy(tenantId, policyId, updatePolicyRequestModel);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling PolicyApi#updatePolicy");
            e.printStackTrace();
        }
    }
}
import io.swagger.client.api.PolicyApi;

public class PolicyApiExample {

    public static void main(String[] args) {
        PolicyApi apiInstance = new PolicyApi();
        String tenantId = tenantId_example; // String | Specify the tenant Id to update policy which is a unique id can be retrieved using the list tenant api
        String policyId = policyId_example; // String | specify the policy id to update which is a unique id can be retrieved using list policy api
        UpdatePolicyRequestModel updatePolicyRequestModel = ; // UpdatePolicyRequestModel | 
        try {
            UpdatePolicyRequest result = apiInstance.updatePolicy(tenantId, policyId, updatePolicyRequestModel);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling PolicyApi#updatePolicy");
            e.printStackTrace();
        }
    }
}
Configuration *apiConfig = [Configuration sharedConfig];

// Configure API key authorization: (authentication scheme: auth_token)
[apiConfig setApiKey:@"YOUR_API_KEY" forApiKeyIdentifier:@"X-Auth-Token"];
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
//[apiConfig setApiKeyPrefix:@"Bearer" forApiKeyIdentifier:@"X-Auth-Token"];

// Configure API key authorization: (authentication scheme: auth_user)
[apiConfig setApiKey:@"YOUR_API_KEY" forApiKeyIdentifier:@"X-Auth-User"];
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
//[apiConfig setApiKeyPrefix:@"Bearer" forApiKeyIdentifier:@"X-Auth-User"];

String *tenantId = tenantId_example; // Specify the tenant Id to update policy which is a unique id can be retrieved using the list tenant api
String *policyId = policyId_example; // specify the policy id to update which is a unique id can be retrieved using list policy api
UpdatePolicyRequestModel *updatePolicyRequestModel = ; // 

PolicyApi *apiInstance = [[PolicyApi alloc] init];

[apiInstance updatePolicyWith:tenantId
    policyId:policyId
    updatePolicyRequestModel:updatePolicyRequestModel
              completionHandler: ^(UpdatePolicyRequest output, NSError* error) {
                            if (output) {
                                NSLog(@"%@", output);
                            }
                            if (error) {
                                NSLog(@"Error: %@", error);
                            }
                        }];
var CorestackExternalApi = require('corestack_external_api');
var defaultClient = CorestackExternalApi.ApiClient.instance;

// Configure API key authorization: auth_token
var auth_token = defaultClient.authentications['auth_token'];
auth_token.apiKey = "YOUR API KEY"
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//auth_token.apiKeyPrefix['X-Auth-Token'] = "Token"

// Configure API key authorization: auth_user
var auth_user = defaultClient.authentications['auth_user'];
auth_user.apiKey = "YOUR API KEY"
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//auth_user.apiKeyPrefix['X-Auth-User'] = "Token"

var api = new CorestackExternalApi.PolicyApi()

var tenantId = tenantId_example; // {String} Specify the tenant Id to update policy which is a unique id can be retrieved using the list tenant api

var policyId = policyId_example; // {String} specify the policy id to update which is a unique id can be retrieved using list policy api

var updatePolicyRequestModel = ; // {UpdatePolicyRequestModel} 


var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
api.updatePolicy(tenantId, policyId, updatePolicyRequestModel, callback);
using System;
using System.Diagnostics;
using IO.Swagger.Api;
using IO.Swagger.Client;
using IO.Swagger.Model;

namespace Example
{
    public class updatePolicyExample
    {
        public void main()
        {
            
            // Configure API key authorization: auth_token
            Configuration.Default.ApiKey.Add("X-Auth-Token", "YOUR_API_KEY");
            // Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
            // Configuration.Default.ApiKeyPrefix.Add("X-Auth-Token", "Bearer");
            // Configure API key authorization: auth_user
            Configuration.Default.ApiKey.Add("X-Auth-User", "YOUR_API_KEY");
            // Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
            // Configuration.Default.ApiKeyPrefix.Add("X-Auth-User", "Bearer");

            var apiInstance = new PolicyApi();
            var tenantId = tenantId_example;  // String | Specify the tenant Id to update policy which is a unique id can be retrieved using the list tenant api
            var policyId = policyId_example;  // String | specify the policy id to update which is a unique id can be retrieved using list policy api
            var updatePolicyRequestModel = new UpdatePolicyRequestModel(); // UpdatePolicyRequestModel | 

            try
            {
                UpdatePolicyRequest result = apiInstance.updatePolicy(tenantId, policyId, updatePolicyRequestModel);
                Debug.WriteLine(result);
            }
            catch (Exception e)
            {
                Debug.Print("Exception when calling PolicyApi.updatePolicy: " + e.Message );
            }
        }
    }
}
<?php
require_once(__DIR__ . '/vendor/autoload.php');

// Configure API key authorization: auth_token
Swagger\Client\Configuration::getDefaultConfiguration()->setApiKey('X-Auth-Token', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// Swagger\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('X-Auth-Token', 'Bearer');
// Configure API key authorization: auth_user
Swagger\Client\Configuration::getDefaultConfiguration()->setApiKey('X-Auth-User', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// Swagger\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('X-Auth-User', 'Bearer');

$api_instance = new Swagger\Client\Api\PolicyApi();
$tenantId = tenantId_example; // String | Specify the tenant Id to update policy which is a unique id can be retrieved using the list tenant api
$policyId = policyId_example; // String | specify the policy id to update which is a unique id can be retrieved using list policy api
$updatePolicyRequestModel = ; // UpdatePolicyRequestModel | 

try {
    $result = $api_instance->updatePolicy($tenantId, $policyId, $updatePolicyRequestModel);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling PolicyApi->updatePolicy: ', $e->getMessage(), PHP_EOL;
}
?>
use Data::Dumper;
use WWW::SwaggerClient::Configuration;
use WWW::SwaggerClient::PolicyApi;

# Configure API key authorization: auth_token
$WWW::SwaggerClient::Configuration::api_key->{'X-Auth-Token'} = 'YOUR_API_KEY';
# uncomment below to setup prefix (e.g. Bearer) for API key, if needed
#$WWW::SwaggerClient::Configuration::api_key_prefix->{'X-Auth-Token'} = "Bearer";
# Configure API key authorization: auth_user
$WWW::SwaggerClient::Configuration::api_key->{'X-Auth-User'} = 'YOUR_API_KEY';
# uncomment below to setup prefix (e.g. Bearer) for API key, if needed
#$WWW::SwaggerClient::Configuration::api_key_prefix->{'X-Auth-User'} = "Bearer";

my $api_instance = WWW::SwaggerClient::PolicyApi->new();
my $tenantId = tenantId_example; # String | Specify the tenant Id to update policy which is a unique id can be retrieved using the list tenant api
my $policyId = policyId_example; # String | specify the policy id to update which is a unique id can be retrieved using list policy api
my $updatePolicyRequestModel = WWW::SwaggerClient::Object::UpdatePolicyRequestModel->new(); # UpdatePolicyRequestModel | 

eval { 
    my $result = $api_instance->updatePolicy(tenantId => $tenantId, policyId => $policyId, updatePolicyRequestModel => $updatePolicyRequestModel);
    print Dumper($result);
};
if ($@) {
    warn "Exception when calling PolicyApi->updatePolicy: $@\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: auth_token
swagger_client.configuration.api_key['X-Auth-Token'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# swagger_client.configuration.api_key_prefix['X-Auth-Token'] = 'Bearer'
# Configure API key authorization: auth_user
swagger_client.configuration.api_key['X-Auth-User'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# swagger_client.configuration.api_key_prefix['X-Auth-User'] = 'Bearer'

# create an instance of the API class
api_instance = swagger_client.PolicyApi()
tenantId = tenantId_example # String | Specify the tenant Id to update policy which is a unique id can be retrieved using the list tenant api
policyId = policyId_example # String | specify the policy id to update which is a unique id can be retrieved using list policy api
updatePolicyRequestModel =  # UpdatePolicyRequestModel | 

try: 
    api_response = api_instance.update_policy(tenantId, policyId, updatePolicyRequestModel)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling PolicyApi->updatePolicy: %s\n" % e)

Parameters

Path parameters
Name Description
tenant_id*
String
Specify the tenant Id to update policy which is a unique id can be retrieved using the list tenant api
Required
policy_id*
String
specify the policy id to update which is a unique id can be retrieved using list policy api
Required
Body parameters
Name Description
updatePolicyRequestModel *

Responses

Status: 200 - Success

Status: 400 - Bad Request

Status: 401 - Unauthorized

Status: 500 - Internal Server Error


Roles

listRoles

This GET method is used to retrieve the list of Roles available within a specific tenant.


/v1/{tenant_id}/roles

Usage and SDK Samples

curl -X GET -H "X-Auth-Token: [[apiKey]]" -H "X-Auth-User: [[apiKey]]" "https://localhost/v1/{tenant_id}/roles"
import io.swagger.client.*;
import io.swagger.client.auth.*;
import io.swagger.client.model.*;
import io.swagger.client.api.RolesApi;

import java.io.File;
import java.util.*;

public class RolesApiExample {

    public static void main(String[] args) {
        ApiClient defaultClient = Configuration.getDefaultApiClient();
        
        // Configure API key authorization: auth_token
        ApiKeyAuth auth_token = (ApiKeyAuth) defaultClient.getAuthentication("auth_token");
        auth_token.setApiKey("YOUR API KEY");
        // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
        //auth_token.setApiKeyPrefix("Token");

        // Configure API key authorization: auth_user
        ApiKeyAuth auth_user = (ApiKeyAuth) defaultClient.getAuthentication("auth_user");
        auth_user.setApiKey("YOUR API KEY");
        // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
        //auth_user.setApiKeyPrefix("Token");

        RolesApi apiInstance = new RolesApi();
        String tenantId = tenantId_example; // String | 
        try {
            RoleListResponse result = apiInstance.listRoles(tenantId);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling RolesApi#listRoles");
            e.printStackTrace();
        }
    }
}
import io.swagger.client.api.RolesApi;

public class RolesApiExample {

    public static void main(String[] args) {
        RolesApi apiInstance = new RolesApi();
        String tenantId = tenantId_example; // String | 
        try {
            RoleListResponse result = apiInstance.listRoles(tenantId);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling RolesApi#listRoles");
            e.printStackTrace();
        }
    }
}
Configuration *apiConfig = [Configuration sharedConfig];

// Configure API key authorization: (authentication scheme: auth_token)
[apiConfig setApiKey:@"YOUR_API_KEY" forApiKeyIdentifier:@"X-Auth-Token"];
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
//[apiConfig setApiKeyPrefix:@"Bearer" forApiKeyIdentifier:@"X-Auth-Token"];

// Configure API key authorization: (authentication scheme: auth_user)
[apiConfig setApiKey:@"YOUR_API_KEY" forApiKeyIdentifier:@"X-Auth-User"];
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
//[apiConfig setApiKeyPrefix:@"Bearer" forApiKeyIdentifier:@"X-Auth-User"];

String *tenantId = tenantId_example; // 

RolesApi *apiInstance = [[RolesApi alloc] init];

[apiInstance listRolesWith:tenantId
              completionHandler: ^(RoleListResponse output, NSError* error) {
                            if (output) {
                                NSLog(@"%@", output);
                            }
                            if (error) {
                                NSLog(@"Error: %@", error);
                            }
                        }];
var CorestackExternalApi = require('corestack_external_api');
var defaultClient = CorestackExternalApi.ApiClient.instance;

// Configure API key authorization: auth_token
var auth_token = defaultClient.authentications['auth_token'];
auth_token.apiKey = "YOUR API KEY"
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//auth_token.apiKeyPrefix['X-Auth-Token'] = "Token"

// Configure API key authorization: auth_user
var auth_user = defaultClient.authentications['auth_user'];
auth_user.apiKey = "YOUR API KEY"
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//auth_user.apiKeyPrefix['X-Auth-User'] = "Token"

var api = new CorestackExternalApi.RolesApi()

var tenantId = tenantId_example; // {String} 


var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
api.listRoles(tenantId, callback);
using System;
using System.Diagnostics;
using IO.Swagger.Api;
using IO.Swagger.Client;
using IO.Swagger.Model;

namespace Example
{
    public class listRolesExample
    {
        public void main()
        {
            
            // Configure API key authorization: auth_token
            Configuration.Default.ApiKey.Add("X-Auth-Token", "YOUR_API_KEY");
            // Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
            // Configuration.Default.ApiKeyPrefix.Add("X-Auth-Token", "Bearer");
            // Configure API key authorization: auth_user
            Configuration.Default.ApiKey.Add("X-Auth-User", "YOUR_API_KEY");
            // Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
            // Configuration.Default.ApiKeyPrefix.Add("X-Auth-User", "Bearer");

            var apiInstance = new RolesApi();
            var tenantId = tenantId_example;  // String | 

            try
            {
                RoleListResponse result = apiInstance.listRoles(tenantId);
                Debug.WriteLine(result);
            }
            catch (Exception e)
            {
                Debug.Print("Exception when calling RolesApi.listRoles: " + e.Message );
            }
        }
    }
}
<?php
require_once(__DIR__ . '/vendor/autoload.php');

// Configure API key authorization: auth_token
Swagger\Client\Configuration::getDefaultConfiguration()->setApiKey('X-Auth-Token', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// Swagger\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('X-Auth-Token', 'Bearer');
// Configure API key authorization: auth_user
Swagger\Client\Configuration::getDefaultConfiguration()->setApiKey('X-Auth-User', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// Swagger\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('X-Auth-User', 'Bearer');

$api_instance = new Swagger\Client\Api\RolesApi();
$tenantId = tenantId_example; // String | 

try {
    $result = $api_instance->listRoles($tenantId);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling RolesApi->listRoles: ', $e->getMessage(), PHP_EOL;
}
?>
use Data::Dumper;
use WWW::SwaggerClient::Configuration;
use WWW::SwaggerClient::RolesApi;

# Configure API key authorization: auth_token
$WWW::SwaggerClient::Configuration::api_key->{'X-Auth-Token'} = 'YOUR_API_KEY';
# uncomment below to setup prefix (e.g. Bearer) for API key, if needed
#$WWW::SwaggerClient::Configuration::api_key_prefix->{'X-Auth-Token'} = "Bearer";
# Configure API key authorization: auth_user
$WWW::SwaggerClient::Configuration::api_key->{'X-Auth-User'} = 'YOUR_API_KEY';
# uncomment below to setup prefix (e.g. Bearer) for API key, if needed
#$WWW::SwaggerClient::Configuration::api_key_prefix->{'X-Auth-User'} = "Bearer";

my $api_instance = WWW::SwaggerClient::RolesApi->new();
my $tenantId = tenantId_example; # String | 

eval { 
    my $result = $api_instance->listRoles(tenantId => $tenantId);
    print Dumper($result);
};
if ($@) {
    warn "Exception when calling RolesApi->listRoles: $@\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: auth_token
swagger_client.configuration.api_key['X-Auth-Token'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# swagger_client.configuration.api_key_prefix['X-Auth-Token'] = 'Bearer'
# Configure API key authorization: auth_user
swagger_client.configuration.api_key['X-Auth-User'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# swagger_client.configuration.api_key_prefix['X-Auth-User'] = 'Bearer'

# create an instance of the API class
api_instance = swagger_client.RolesApi()
tenantId = tenantId_example # String | 

try: 
    api_response = api_instance.list_roles(tenantId)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling RolesApi->listRoles: %s\n" % e)

Parameters

Path parameters
Name Description
tenant_id*
String
Required

Responses

Status: 200 - Success

Status: 400 - Bad Request

Status: 401 - Unauthorized

Status: 500 - Internal Server Error


ScriptJobs

describeScriptJob

View script job details.


/v1/{tenant_id}/scriptjobs/{script_job_id}

Usage and SDK Samples

curl -X GET -H "X-Auth-Token: [[apiKey]]" -H "X-Auth-User: [[apiKey]]" "https://localhost/v1/{tenant_id}/scriptjobs/{script_job_id}"
import io.swagger.client.*;
import io.swagger.client.auth.*;
import io.swagger.client.model.*;
import io.swagger.client.api.ScriptJobsApi;

import java.io.File;
import java.util.*;

public class ScriptJobsApiExample {

    public static void main(String[] args) {
        ApiClient defaultClient = Configuration.getDefaultApiClient();
        
        // Configure API key authorization: auth_token
        ApiKeyAuth auth_token = (ApiKeyAuth) defaultClient.getAuthentication("auth_token");
        auth_token.setApiKey("YOUR API KEY");
        // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
        //auth_token.setApiKeyPrefix("Token");

        // Configure API key authorization: auth_user
        ApiKeyAuth auth_user = (ApiKeyAuth) defaultClient.getAuthentication("auth_user");
        auth_user.setApiKey("YOUR API KEY");
        // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
        //auth_user.setApiKeyPrefix("Token");

        ScriptJobsApi apiInstance = new ScriptJobsApi();
        String tenantId = tenantId_example; // String | ID of the tenant. This can be fetched from listTenants API
        String scriptJobId = scriptJobId_example; // String | ID of the script_job. This can be fetched from listScriptJobs API/scriptExecute response
        try {
            ScriptJobDataView result = apiInstance.describeScriptJob(tenantId, scriptJobId);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling ScriptJobsApi#describeScriptJob");
            e.printStackTrace();
        }
    }
}
import io.swagger.client.api.ScriptJobsApi;

public class ScriptJobsApiExample {

    public static void main(String[] args) {
        ScriptJobsApi apiInstance = new ScriptJobsApi();
        String tenantId = tenantId_example; // String | ID of the tenant. This can be fetched from listTenants API
        String scriptJobId = scriptJobId_example; // String | ID of the script_job. This can be fetched from listScriptJobs API/scriptExecute response
        try {
            ScriptJobDataView result = apiInstance.describeScriptJob(tenantId, scriptJobId);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling ScriptJobsApi#describeScriptJob");
            e.printStackTrace();
        }
    }
}
Configuration *apiConfig = [Configuration sharedConfig];

// Configure API key authorization: (authentication scheme: auth_token)
[apiConfig setApiKey:@"YOUR_API_KEY" forApiKeyIdentifier:@"X-Auth-Token"];
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
//[apiConfig setApiKeyPrefix:@"Bearer" forApiKeyIdentifier:@"X-Auth-Token"];

// Configure API key authorization: (authentication scheme: auth_user)
[apiConfig setApiKey:@"YOUR_API_KEY" forApiKeyIdentifier:@"X-Auth-User"];
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
//[apiConfig setApiKeyPrefix:@"Bearer" forApiKeyIdentifier:@"X-Auth-User"];

String *tenantId = tenantId_example; // ID of the tenant. This can be fetched from listTenants API
String *scriptJobId = scriptJobId_example; // ID of the script_job. This can be fetched from listScriptJobs API/scriptExecute response

ScriptJobsApi *apiInstance = [[ScriptJobsApi alloc] init];

[apiInstance describeScriptJobWith:tenantId
    scriptJobId:scriptJobId
              completionHandler: ^(ScriptJobDataView output, NSError* error) {
                            if (output) {
                                NSLog(@"%@", output);
                            }
                            if (error) {
                                NSLog(@"Error: %@", error);
                            }
                        }];
var CorestackExternalApi = require('corestack_external_api');
var defaultClient = CorestackExternalApi.ApiClient.instance;

// Configure API key authorization: auth_token
var auth_token = defaultClient.authentications['auth_token'];
auth_token.apiKey = "YOUR API KEY"
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//auth_token.apiKeyPrefix['X-Auth-Token'] = "Token"

// Configure API key authorization: auth_user
var auth_user = defaultClient.authentications['auth_user'];
auth_user.apiKey = "YOUR API KEY"
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//auth_user.apiKeyPrefix['X-Auth-User'] = "Token"

var api = new CorestackExternalApi.ScriptJobsApi()

var tenantId = tenantId_example; // {String} ID of the tenant. This can be fetched from listTenants API

var scriptJobId = scriptJobId_example; // {String} ID of the script_job. This can be fetched from listScriptJobs API/scriptExecute response


var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
api.describeScriptJob(tenantId, scriptJobId, callback);
using System;
using System.Diagnostics;
using IO.Swagger.Api;
using IO.Swagger.Client;
using IO.Swagger.Model;

namespace Example
{
    public class describeScriptJobExample
    {
        public void main()
        {
            
            // Configure API key authorization: auth_token
            Configuration.Default.ApiKey.Add("X-Auth-Token", "YOUR_API_KEY");
            // Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
            // Configuration.Default.ApiKeyPrefix.Add("X-Auth-Token", "Bearer");
            // Configure API key authorization: auth_user
            Configuration.Default.ApiKey.Add("X-Auth-User", "YOUR_API_KEY");
            // Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
            // Configuration.Default.ApiKeyPrefix.Add("X-Auth-User", "Bearer");

            var apiInstance = new ScriptJobsApi();
            var tenantId = tenantId_example;  // String | ID of the tenant. This can be fetched from listTenants API
            var scriptJobId = scriptJobId_example;  // String | ID of the script_job. This can be fetched from listScriptJobs API/scriptExecute response

            try
            {
                ScriptJobDataView result = apiInstance.describeScriptJob(tenantId, scriptJobId);
                Debug.WriteLine(result);
            }
            catch (Exception e)
            {
                Debug.Print("Exception when calling ScriptJobsApi.describeScriptJob: " + e.Message );
            }
        }
    }
}
<?php
require_once(__DIR__ . '/vendor/autoload.php');

// Configure API key authorization: auth_token
Swagger\Client\Configuration::getDefaultConfiguration()->setApiKey('X-Auth-Token', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// Swagger\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('X-Auth-Token', 'Bearer');
// Configure API key authorization: auth_user
Swagger\Client\Configuration::getDefaultConfiguration()->setApiKey('X-Auth-User', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// Swagger\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('X-Auth-User', 'Bearer');

$api_instance = new Swagger\Client\Api\ScriptJobsApi();
$tenantId = tenantId_example; // String | ID of the tenant. This can be fetched from listTenants API
$scriptJobId = scriptJobId_example; // String | ID of the script_job. This can be fetched from listScriptJobs API/scriptExecute response

try {
    $result = $api_instance->describeScriptJob($tenantId, $scriptJobId);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling ScriptJobsApi->describeScriptJob: ', $e->getMessage(), PHP_EOL;
}
?>
use Data::Dumper;
use WWW::SwaggerClient::Configuration;
use WWW::SwaggerClient::ScriptJobsApi;

# Configure API key authorization: auth_token
$WWW::SwaggerClient::Configuration::api_key->{'X-Auth-Token'} = 'YOUR_API_KEY';
# uncomment below to setup prefix (e.g. Bearer) for API key, if needed
#$WWW::SwaggerClient::Configuration::api_key_prefix->{'X-Auth-Token'} = "Bearer";
# Configure API key authorization: auth_user
$WWW::SwaggerClient::Configuration::api_key->{'X-Auth-User'} = 'YOUR_API_KEY';
# uncomment below to setup prefix (e.g. Bearer) for API key, if needed
#$WWW::SwaggerClient::Configuration::api_key_prefix->{'X-Auth-User'} = "Bearer";

my $api_instance = WWW::SwaggerClient::ScriptJobsApi->new();
my $tenantId = tenantId_example; # String | ID of the tenant. This can be fetched from listTenants API
my $scriptJobId = scriptJobId_example; # String | ID of the script_job. This can be fetched from listScriptJobs API/scriptExecute response

eval { 
    my $result = $api_instance->describeScriptJob(tenantId => $tenantId, scriptJobId => $scriptJobId);
    print Dumper($result);
};
if ($@) {
    warn "Exception when calling ScriptJobsApi->describeScriptJob: $@\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: auth_token
swagger_client.configuration.api_key['X-Auth-Token'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# swagger_client.configuration.api_key_prefix['X-Auth-Token'] = 'Bearer'
# Configure API key authorization: auth_user
swagger_client.configuration.api_key['X-Auth-User'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# swagger_client.configuration.api_key_prefix['X-Auth-User'] = 'Bearer'

# create an instance of the API class
api_instance = swagger_client.ScriptJobsApi()
tenantId = tenantId_example # String | ID of the tenant. This can be fetched from listTenants API
scriptJobId = scriptJobId_example # String | ID of the script_job. This can be fetched from listScriptJobs API/scriptExecute response

try: 
    api_response = api_instance.describe_script_job(tenantId, scriptJobId)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling ScriptJobsApi->describeScriptJob: %s\n" % e)

Parameters

Path parameters
Name Description
tenant_id*
String
ID of the tenant. This can be fetched from listTenants API
Required
script_job_id*
String
ID of the script_job. This can be fetched from listScriptJobs API/scriptExecute response
Required

Responses

Status: 200 - Success

Status: 400 - Bad Request

Status: 401 - Unauthorized

Status: 500 - Internal Server Error


listScriptJobs

This API will list all script jobs initiated by the logged in user.


/v1/{tenant_id}/scriptjobs

Usage and SDK Samples

curl -X GET -H "X-Auth-Token: [[apiKey]]" -H "X-Auth-User: [[apiKey]]" "https://localhost/v1/{tenant_id}/scriptjobs?limit=&page="
import io.swagger.client.*;
import io.swagger.client.auth.*;
import io.swagger.client.model.*;
import io.swagger.client.api.ScriptJobsApi;

import java.io.File;
import java.util.*;

public class ScriptJobsApiExample {

    public static void main(String[] args) {
        ApiClient defaultClient = Configuration.getDefaultApiClient();
        
        // Configure API key authorization: auth_token
        ApiKeyAuth auth_token = (ApiKeyAuth) defaultClient.getAuthentication("auth_token");
        auth_token.setApiKey("YOUR API KEY");
        // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
        //auth_token.setApiKeyPrefix("Token");

        // Configure API key authorization: auth_user
        ApiKeyAuth auth_user = (ApiKeyAuth) defaultClient.getAuthentication("auth_user");
        auth_user.setApiKey("YOUR API KEY");
        // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
        //auth_user.setApiKeyPrefix("Token");

        ScriptJobsApi apiInstance = new ScriptJobsApi();
        String tenantId = tenantId_example; // String | ID of the tenant. This can be fetched from listTenants API
        Integer limit = 56; // Integer | Number of records to display
        Integer page = 56; // Integer | Page number
        try {
            ScriptJobListResponse result = apiInstance.listScriptJobs(tenantId, limit, page);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling ScriptJobsApi#listScriptJobs");
            e.printStackTrace();
        }
    }
}
import io.swagger.client.api.ScriptJobsApi;

public class ScriptJobsApiExample {

    public static void main(String[] args) {
        ScriptJobsApi apiInstance = new ScriptJobsApi();
        String tenantId = tenantId_example; // String | ID of the tenant. This can be fetched from listTenants API
        Integer limit = 56; // Integer | Number of records to display
        Integer page = 56; // Integer | Page number
        try {
            ScriptJobListResponse result = apiInstance.listScriptJobs(tenantId, limit, page);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling ScriptJobsApi#listScriptJobs");
            e.printStackTrace();
        }
    }
}
Configuration *apiConfig = [Configuration sharedConfig];

// Configure API key authorization: (authentication scheme: auth_token)
[apiConfig setApiKey:@"YOUR_API_KEY" forApiKeyIdentifier:@"X-Auth-Token"];
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
//[apiConfig setApiKeyPrefix:@"Bearer" forApiKeyIdentifier:@"X-Auth-Token"];

// Configure API key authorization: (authentication scheme: auth_user)
[apiConfig setApiKey:@"YOUR_API_KEY" forApiKeyIdentifier:@"X-Auth-User"];
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
//[apiConfig setApiKeyPrefix:@"Bearer" forApiKeyIdentifier:@"X-Auth-User"];

String *tenantId = tenantId_example; // ID of the tenant. This can be fetched from listTenants API
Integer *limit = 56; // Number of records to display (optional)
Integer *page = 56; // Page number (optional)

ScriptJobsApi *apiInstance = [[ScriptJobsApi alloc] init];

[apiInstance listScriptJobsWith:tenantId
    limit:limit
    page:page
              completionHandler: ^(ScriptJobListResponse output, NSError* error) {
                            if (output) {
                                NSLog(@"%@", output);
                            }
                            if (error) {
                                NSLog(@"Error: %@", error);
                            }
                        }];
var CorestackExternalApi = require('corestack_external_api');
var defaultClient = CorestackExternalApi.ApiClient.instance;

// Configure API key authorization: auth_token
var auth_token = defaultClient.authentications['auth_token'];
auth_token.apiKey = "YOUR API KEY"
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//auth_token.apiKeyPrefix['X-Auth-Token'] = "Token"

// Configure API key authorization: auth_user
var auth_user = defaultClient.authentications['auth_user'];
auth_user.apiKey = "YOUR API KEY"
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//auth_user.apiKeyPrefix['X-Auth-User'] = "Token"

var api = new CorestackExternalApi.ScriptJobsApi()

var tenantId = tenantId_example; // {String} ID of the tenant. This can be fetched from listTenants API

var opts = { 
  'limit': 56, // {Integer} Number of records to display
  'page': 56 // {Integer} Page number
};

var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
api.listScriptJobs(tenantId, opts, callback);
using System;
using System.Diagnostics;
using IO.Swagger.Api;
using IO.Swagger.Client;
using IO.Swagger.Model;

namespace Example
{
    public class listScriptJobsExample
    {
        public void main()
        {
            
            // Configure API key authorization: auth_token
            Configuration.Default.ApiKey.Add("X-Auth-Token", "YOUR_API_KEY");
            // Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
            // Configuration.Default.ApiKeyPrefix.Add("X-Auth-Token", "Bearer");
            // Configure API key authorization: auth_user
            Configuration.Default.ApiKey.Add("X-Auth-User", "YOUR_API_KEY");
            // Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
            // Configuration.Default.ApiKeyPrefix.Add("X-Auth-User", "Bearer");

            var apiInstance = new ScriptJobsApi();
            var tenantId = tenantId_example;  // String | ID of the tenant. This can be fetched from listTenants API
            var limit = 56;  // Integer | Number of records to display (optional) 
            var page = 56;  // Integer | Page number (optional) 

            try
            {
                ScriptJobListResponse result = apiInstance.listScriptJobs(tenantId, limit, page);
                Debug.WriteLine(result);
            }
            catch (Exception e)
            {
                Debug.Print("Exception when calling ScriptJobsApi.listScriptJobs: " + e.Message );
            }
        }
    }
}
<?php
require_once(__DIR__ . '/vendor/autoload.php');

// Configure API key authorization: auth_token
Swagger\Client\Configuration::getDefaultConfiguration()->setApiKey('X-Auth-Token', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// Swagger\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('X-Auth-Token', 'Bearer');
// Configure API key authorization: auth_user
Swagger\Client\Configuration::getDefaultConfiguration()->setApiKey('X-Auth-User', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// Swagger\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('X-Auth-User', 'Bearer');

$api_instance = new Swagger\Client\Api\ScriptJobsApi();
$tenantId = tenantId_example; // String | ID of the tenant. This can be fetched from listTenants API
$limit = 56; // Integer | Number of records to display
$page = 56; // Integer | Page number

try {
    $result = $api_instance->listScriptJobs($tenantId, $limit, $page);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling ScriptJobsApi->listScriptJobs: ', $e->getMessage(), PHP_EOL;
}
?>
use Data::Dumper;
use WWW::SwaggerClient::Configuration;
use WWW::SwaggerClient::ScriptJobsApi;

# Configure API key authorization: auth_token
$WWW::SwaggerClient::Configuration::api_key->{'X-Auth-Token'} = 'YOUR_API_KEY';
# uncomment below to setup prefix (e.g. Bearer) for API key, if needed
#$WWW::SwaggerClient::Configuration::api_key_prefix->{'X-Auth-Token'} = "Bearer";
# Co