# hyperstack.EnvironmentApi All URIs are relative to *https://infrahub-api.nexgencloud.com/v1* Method | HTTP request | Description ------------- | ------------- | ------------- [**create_environment**](EnvironmentApi.md#create_environment) | **POST** /core/environments | Create Environment [**delete_an_environment**](EnvironmentApi.md#delete_an_environment) | **DELETE** /core/environments/{id} | Delete an environment [**get_an_environment_details**](EnvironmentApi.md#get_an_environment_details) | **GET** /core/environments/{id} | Get an environment detail [**list_environments**](EnvironmentApi.md#list_environments) | **GET** /core/environments | List Environments [**update_an_environment**](EnvironmentApi.md#update_an_environment) | **PUT** /core/environments/{id} | Update Environment # **create_environment** > Environment create_environment(payload) Create Environment ### Example * Api Key Authentication (apiKey): * Api Key Authentication (accessToken): ```python import hyperstack from hyperstack.models.create_environment import CreateEnvironment from hyperstack.models.environment import Environment from hyperstack.rest import ApiException from pprint import pprint # Defining the host is optional and defaults to https://infrahub-api.nexgencloud.com/v1 # See configuration.py for a list of all supported configuration parameters. configuration = hyperstack.Configuration( host = "https://infrahub-api.nexgencloud.com/v1" ) # The client must configure the authentication and authorization parameters # in accordance with the API server security policy. # Examples for each auth method are provided below, use the example that # satisfies your auth use case. # Configure API key authorization: apiKey configuration.api_key['apiKey'] = os.environ["API_KEY"] # Uncomment below to setup prefix (e.g. Bearer) for API key, if needed # configuration.api_key_prefix['apiKey'] = 'Bearer' # Configure API key authorization: accessToken configuration.api_key['accessToken'] = os.environ["API_KEY"] # Uncomment below to setup prefix (e.g. Bearer) for API key, if needed # configuration.api_key_prefix['accessToken'] = 'Bearer' # Enter a context with an instance of the API client with hyperstack.ApiClient(configuration) as api_client: # Create an instance of the API class api_instance = hyperstack.EnvironmentApi(api_client) payload = hyperstack.CreateEnvironment() # CreateEnvironment | try: # Create Environment api_response = api_instance.create_environment(payload) print("The response of EnvironmentApi->create_environment:\n") pprint(api_response) except Exception as e: print("Exception when calling EnvironmentApi->create_environment: %s\n" % e) ``` ### Parameters Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **payload** | [**CreateEnvironment**](CreateEnvironment.md)| | ### Return type [**Environment**](Environment.md) ### Authorization [apiKey](../README.md#apiKey), [accessToken](../README.md#accessToken) ### HTTP request headers - **Content-Type**: application/json - **Accept**: application/json ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| **200** | Environment is created successfully | - | **400** | Bad Request | - | **401** | Unauthorized | - | **404** | Not Found | - | **409** | Conflict | - | **500** | Internal Server Error | - | [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) # **delete_an_environment** > ResponseModel delete_an_environment(id) Delete an environment ### Example * Api Key Authentication (apiKey): * Api Key Authentication (accessToken): ```python import hyperstack from hyperstack.models.response_model import ResponseModel from hyperstack.rest import ApiException from pprint import pprint # Defining the host is optional and defaults to https://infrahub-api.nexgencloud.com/v1 # See configuration.py for a list of all supported configuration parameters. configuration = hyperstack.Configuration( host = "https://infrahub-api.nexgencloud.com/v1" ) # The client must configure the authentication and authorization parameters # in accordance with the API server security policy. # Examples for each auth method are provided below, use the example that # satisfies your auth use case. # Configure API key authorization: apiKey configuration.api_key['apiKey'] = os.environ["API_KEY"] # Uncomment below to setup prefix (e.g. Bearer) for API key, if needed # configuration.api_key_prefix['apiKey'] = 'Bearer' # Configure API key authorization: accessToken configuration.api_key['accessToken'] = os.environ["API_KEY"] # Uncomment below to setup prefix (e.g. Bearer) for API key, if needed # configuration.api_key_prefix['accessToken'] = 'Bearer' # Enter a context with an instance of the API client with hyperstack.ApiClient(configuration) as api_client: # Create an instance of the API class api_instance = hyperstack.EnvironmentApi(api_client) id = 56 # int | try: # Delete an environment api_response = api_instance.delete_an_environment(id) print("The response of EnvironmentApi->delete_an_environment:\n") pprint(api_response) except Exception as e: print("Exception when calling EnvironmentApi->delete_an_environment: %s\n" % e) ``` ### Parameters Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **id** | **int**| | ### Return type [**ResponseModel**](ResponseModel.md) ### Authorization [apiKey](../README.md#apiKey), [accessToken](../README.md#accessToken) ### HTTP request headers - **Content-Type**: Not defined - **Accept**: application/json ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| **200** | Success | - | **400** | Bad Request | - | **401** | Unauthorized | - | **404** | Not Found | - | **500** | Internal Server Error | - | [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) # **get_an_environment_details** > Environment get_an_environment_details(id) Get an environment detail ### Example * Api Key Authentication (apiKey): * Api Key Authentication (accessToken): ```python import hyperstack from hyperstack.models.environment import Environment from hyperstack.rest import ApiException from pprint import pprint # Defining the host is optional and defaults to https://infrahub-api.nexgencloud.com/v1 # See configuration.py for a list of all supported configuration parameters. configuration = hyperstack.Configuration( host = "https://infrahub-api.nexgencloud.com/v1" ) # The client must configure the authentication and authorization parameters # in accordance with the API server security policy. # Examples for each auth method are provided below, use the example that # satisfies your auth use case. # Configure API key authorization: apiKey configuration.api_key['apiKey'] = os.environ["API_KEY"] # Uncomment below to setup prefix (e.g. Bearer) for API key, if needed # configuration.api_key_prefix['apiKey'] = 'Bearer' # Configure API key authorization: accessToken configuration.api_key['accessToken'] = os.environ["API_KEY"] # Uncomment below to setup prefix (e.g. Bearer) for API key, if needed # configuration.api_key_prefix['accessToken'] = 'Bearer' # Enter a context with an instance of the API client with hyperstack.ApiClient(configuration) as api_client: # Create an instance of the API class api_instance = hyperstack.EnvironmentApi(api_client) id = 56 # int | try: # Get an environment detail api_response = api_instance.get_an_environment_details(id) print("The response of EnvironmentApi->get_an_environment_details:\n") pprint(api_response) except Exception as e: print("Exception when calling EnvironmentApi->get_an_environment_details: %s\n" % e) ``` ### Parameters Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **id** | **int**| | ### Return type [**Environment**](Environment.md) ### Authorization [apiKey](../README.md#apiKey), [accessToken](../README.md#accessToken) ### HTTP request headers - **Content-Type**: Not defined - **Accept**: application/json ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| **200** | Getting detail successful | - | **400** | Bad Request | - | **401** | Unauthorized | - | **404** | Not Found | - | **500** | Internal Server Error | - | [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) # **list_environments** > Environments list_environments() List Environments ### Example * Api Key Authentication (apiKey): * Api Key Authentication (accessToken): ```python import hyperstack from hyperstack.models.environments import Environments from hyperstack.rest import ApiException from pprint import pprint # Defining the host is optional and defaults to https://infrahub-api.nexgencloud.com/v1 # See configuration.py for a list of all supported configuration parameters. configuration = hyperstack.Configuration( host = "https://infrahub-api.nexgencloud.com/v1" ) # The client must configure the authentication and authorization parameters # in accordance with the API server security policy. # Examples for each auth method are provided below, use the example that # satisfies your auth use case. # Configure API key authorization: apiKey configuration.api_key['apiKey'] = os.environ["API_KEY"] # Uncomment below to setup prefix (e.g. Bearer) for API key, if needed # configuration.api_key_prefix['apiKey'] = 'Bearer' # Configure API key authorization: accessToken configuration.api_key['accessToken'] = os.environ["API_KEY"] # Uncomment below to setup prefix (e.g. Bearer) for API key, if needed # configuration.api_key_prefix['accessToken'] = 'Bearer' # Enter a context with an instance of the API client with hyperstack.ApiClient(configuration) as api_client: # Create an instance of the API class api_instance = hyperstack.EnvironmentApi(api_client) try: # List Environments api_response = api_instance.list_environments() print("The response of EnvironmentApi->list_environments:\n") pprint(api_response) except Exception as e: print("Exception when calling EnvironmentApi->list_environments: %s\n" % e) ``` ### Parameters This endpoint does not need any parameter. ### Return type [**Environments**](Environments.md) ### Authorization [apiKey](../README.md#apiKey), [accessToken](../README.md#accessToken) ### HTTP request headers - **Content-Type**: Not defined - **Accept**: application/json ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| **200** | Getting environments successful | - | **400** | Bad Request | - | **401** | Unauthorized | - | **500** | Internal Server Error | - | [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) # **update_an_environment** > Environment update_an_environment(id, payload) Update Environment ### Example * Api Key Authentication (apiKey): * Api Key Authentication (accessToken): ```python import hyperstack from hyperstack.models.environment import Environment from hyperstack.models.update_environment import UpdateEnvironment from hyperstack.rest import ApiException from pprint import pprint # Defining the host is optional and defaults to https://infrahub-api.nexgencloud.com/v1 # See configuration.py for a list of all supported configuration parameters. configuration = hyperstack.Configuration( host = "https://infrahub-api.nexgencloud.com/v1" ) # The client must configure the authentication and authorization parameters # in accordance with the API server security policy. # Examples for each auth method are provided below, use the example that # satisfies your auth use case. # Configure API key authorization: apiKey configuration.api_key['apiKey'] = os.environ["API_KEY"] # Uncomment below to setup prefix (e.g. Bearer) for API key, if needed # configuration.api_key_prefix['apiKey'] = 'Bearer' # Configure API key authorization: accessToken configuration.api_key['accessToken'] = os.environ["API_KEY"] # Uncomment below to setup prefix (e.g. Bearer) for API key, if needed # configuration.api_key_prefix['accessToken'] = 'Bearer' # Enter a context with an instance of the API client with hyperstack.ApiClient(configuration) as api_client: # Create an instance of the API class api_instance = hyperstack.EnvironmentApi(api_client) id = 56 # int | payload = hyperstack.UpdateEnvironment() # UpdateEnvironment | try: # Update Environment api_response = api_instance.update_an_environment(id, payload) print("The response of EnvironmentApi->update_an_environment:\n") pprint(api_response) except Exception as e: print("Exception when calling EnvironmentApi->update_an_environment: %s\n" % e) ``` ### Parameters Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **id** | **int**| | **payload** | [**UpdateEnvironment**](UpdateEnvironment.md)| | ### Return type [**Environment**](Environment.md) ### Authorization [apiKey](../README.md#apiKey), [accessToken](../README.md#accessToken) ### HTTP request headers - **Content-Type**: application/json - **Accept**: application/json ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| **200** | Update an environment success | - | **400** | Bad Request | - | **401** | Unauthorized | - | **404** | Not Found | - | **500** | Internal Server Error | - | [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)