director-sdk

cloudera.director.EnvironmentsApi

All URIs are relative to https://localhost

Method HTTP request Description
create POST /api/d6.2/environments Create a new environment
delete DELETE /api/d6.2/environments/{name} Delete an environment by name
get_redacted GET /api/d6.2/environments/{name} Get an environment by name
list GET /api/d6.2/environments List all environments
update PUT /api/d6.2/environments/{name} Update an existing environment
update_provider_credentials PUT /api/d6.2/environments/{name}/provider/credentials Update provider credentials for a specific environment

create

create(environment)

Create a new environment

Example

from __future__ import print_function
import time
import cloudera.director
from cloudera.director.rest import ApiException
from pprint import pprint

# Configure HTTP basic authorization: basic
configuration = cloudera.director.Configuration()
configuration.username = 'YOUR_USERNAME'
configuration.password = 'YOUR_PASSWORD'

# create an instance of the API class
api_instance = cloudera.director.EnvironmentsApi(cloudera.director.ApiClient(configuration))
environment = cloudera.director.Environment() # Environment | 

try:
    # Create a new environment
    api_instance.create(environment)
except ApiException as e:
    print("Exception when calling EnvironmentsApi->create: %s\n" % e)

Parameters

Name Type Description Notes
environment Environment    

Return type

void (empty response body)

Authorization

basic

HTTP request headers

[Back to top] [Back to API list] [Back to Model list] [Back to README]

delete

delete(name)

Delete an environment by name

Example

from __future__ import print_function
import time
import cloudera.director
from cloudera.director.rest import ApiException
from pprint import pprint

# Configure HTTP basic authorization: basic
configuration = cloudera.director.Configuration()
configuration.username = 'YOUR_USERNAME'
configuration.password = 'YOUR_PASSWORD'

# create an instance of the API class
api_instance = cloudera.director.EnvironmentsApi(cloudera.director.ApiClient(configuration))
name = 'name_example' # str | 

try:
    # Delete an environment by name
    api_instance.delete(name)
except ApiException as e:
    print("Exception when calling EnvironmentsApi->delete: %s\n" % e)

Parameters

Name Type Description Notes
name str    

Return type

void (empty response body)

Authorization

basic

HTTP request headers

[Back to top] [Back to API list] [Back to Model list] [Back to README]

get_redacted

Environment get_redacted(name)

Get an environment by name

Example

from __future__ import print_function
import time
import cloudera.director
from cloudera.director.rest import ApiException
from pprint import pprint

# Configure HTTP basic authorization: basic
configuration = cloudera.director.Configuration()
configuration.username = 'YOUR_USERNAME'
configuration.password = 'YOUR_PASSWORD'

# create an instance of the API class
api_instance = cloudera.director.EnvironmentsApi(cloudera.director.ApiClient(configuration))
name = 'name_example' # str | 

try:
    # Get an environment by name
    api_response = api_instance.get_redacted(name)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling EnvironmentsApi->get_redacted: %s\n" % e)

Parameters

Name Type Description Notes
name str    

Return type

Environment

Authorization

basic

HTTP request headers

[Back to top] [Back to API list] [Back to Model list] [Back to README]

list

list[str] list()

List all environments

Example

from __future__ import print_function
import time
import cloudera.director
from cloudera.director.rest import ApiException
from pprint import pprint

# Configure HTTP basic authorization: basic
configuration = cloudera.director.Configuration()
configuration.username = 'YOUR_USERNAME'
configuration.password = 'YOUR_PASSWORD'

# create an instance of the API class
api_instance = cloudera.director.EnvironmentsApi(cloudera.director.ApiClient(configuration))

try:
    # List all environments
    api_response = api_instance.list()
    pprint(api_response)
except ApiException as e:
    print("Exception when calling EnvironmentsApi->list: %s\n" % e)

Parameters

This endpoint does not need any parameter.

Return type

list[str]

Authorization

basic

HTTP request headers

[Back to top] [Back to API list] [Back to Model list] [Back to README]

update

update(name, environment)

Update an existing environment

Example

from __future__ import print_function
import time
import cloudera.director
from cloudera.director.rest import ApiException
from pprint import pprint

# Configure HTTP basic authorization: basic
configuration = cloudera.director.Configuration()
configuration.username = 'YOUR_USERNAME'
configuration.password = 'YOUR_PASSWORD'

# create an instance of the API class
api_instance = cloudera.director.EnvironmentsApi(cloudera.director.ApiClient(configuration))
name = 'name_example' # str | 
environment = cloudera.director.Environment() # Environment | 

try:
    # Update an existing environment
    api_instance.update(name, environment)
except ApiException as e:
    print("Exception when calling EnvironmentsApi->update: %s\n" % e)

Parameters

Name Type Description Notes
name str    
environment Environment    

Return type

void (empty response body)

Authorization

basic

HTTP request headers

[Back to top] [Back to API list] [Back to Model list] [Back to README]

update_provider_credentials

update_provider_credentials(name, credentials)

Update provider credentials for a specific environment

Example

from __future__ import print_function
import time
import cloudera.director
from cloudera.director.rest import ApiException
from pprint import pprint

# Configure HTTP basic authorization: basic
configuration = cloudera.director.Configuration()
configuration.username = 'YOUR_USERNAME'
configuration.password = 'YOUR_PASSWORD'

# create an instance of the API class
api_instance = cloudera.director.EnvironmentsApi(cloudera.director.ApiClient(configuration))
name = 'name_example' # str | 
credentials = NULL # object | 

try:
    # Update provider credentials for a specific environment
    api_instance.update_provider_credentials(name, credentials)
except ApiException as e:
    print("Exception when calling EnvironmentsApi->update_provider_credentials: %s\n" % e)

Parameters

Name Type Description Notes
name str    
credentials object    

Return type

void (empty response body)

Authorization

basic

HTTP request headers

[Back to top] [Back to API list] [Back to Model list] [Back to README]