# SecretsApi Method | HTTP request | Description ------------- | ------------- | ------------- [**create_secret**](SecretsApi.md#create-secret) | **POST** /secrets | Create a new secret| **POST** /secrets | Create a new secret [**delete_secret**](SecretsApi.md#delete-secret) | **DELETE** /secrets/{secret-id} | Delete a secret| **DELETE** /secrets/{secret_id} | Delete a secret [**get_secret**](SecretsApi.md#get-secret) | **GET** /secrets/{secret-id} | Get a secret by ID| **GET** /secrets/{secret_id} | Get a secret by ID [**get_secret_value**](SecretsApi.md#get-secret-value) | **GET** /secrets/{secret-id}/value | Get the value of a secret by ID| **GET** /secrets/{secret_id}/value | Get the value of a secret by ID [**list_secret_ids**](SecretsApi.md#list-secret-ids) | **GET** /secrets/ids | Lists available secret IDs from SecureStore.| **GET** /secrets/ids | Lists available secret IDs from SecureStore. [**update_secret**](SecretsApi.md#update-secret) | **PUT** /secrets/{secret-id} | Update a secret| **PUT** /secrets/{secret_id} | Update a secret # **create_secret** > CreateSecret201Response create_secret(create_secret_request) Create a new secret Creates a new secret in SecureStore. ### Example * Bearer Authentication (bearerAuth): ```python import h2ogpte.rest_sync from h2ogpte.rest_sync.models.create_secret201_response import CreateSecret201Response from h2ogpte.rest_sync.models.create_secret_request import CreateSecretRequest from h2ogpte.rest_sync.rest import ApiException from pprint import pprint # Defining the host is optional and defaults to https://h2ogpte.genai.h2o.ai/api/v1 # See configuration.py for a list of all supported configuration parameters. configuration = h2ogpte.rest_sync.Configuration( host = "https://h2ogpte.genai.h2o.ai/api/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 Bearer authorization: bearerAuth configuration = h2ogpte.rest_sync.Configuration( access_token = os.environ["BEARER_TOKEN"] ) # Enter a context with an instance of the API client with h2ogpte.rest_sync.ApiClient(configuration) as api_client: # Create an instance of the API class api_instance = h2ogpte.rest_sync.SecretsApi(api_client) create_secret_request = h2ogpte.rest_sync.CreateSecretRequest() # CreateSecretRequest | try: # Create a new secret api_response = api_instance.create_secret(create_secret_request) print("The response of SecretsApi->create_secret:\n") pprint(api_response) except Exception as e: print("Exception when calling SecretsApi->create_secret: %s\n" % e) ``` ### Parameters Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **create_secret_request** | [**CreateSecretRequest**](CreateSecretRequest.md)| | ### Return type [**CreateSecret201Response**](CreateSecret201Response.md) ### HTTP request headers - **Content-Type**: application/json - **Accept**: application/json ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| **201** | Secret created successfully | - | **401** | Unauthorized - Invalid or missing API key | - | **409** | Conflict | - | **500** | Internal server error | - | # **delete_secret** > delete_secret(secret_id) Delete a secret Deletes a secret from SecureStore by its ID. ### Example * Bearer Authentication (bearerAuth): ```python import h2ogpte.rest_sync from h2ogpte.rest_sync.rest import ApiException from pprint import pprint # Defining the host is optional and defaults to https://h2ogpte.genai.h2o.ai/api/v1 # See configuration.py for a list of all supported configuration parameters. configuration = h2ogpte.rest_sync.Configuration( host = "https://h2ogpte.genai.h2o.ai/api/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 Bearer authorization: bearerAuth configuration = h2ogpte.rest_sync.Configuration( access_token = os.environ["BEARER_TOKEN"] ) # Enter a context with an instance of the API client with h2ogpte.rest_sync.ApiClient(configuration) as api_client: # Create an instance of the API class api_instance = h2ogpte.rest_sync.SecretsApi(api_client) secret_id = 'secret_id_example' # str | The ID of the secret to delete try: # Delete a secret api_instance.delete_secret(secret_id) except Exception as e: print("Exception when calling SecretsApi->delete_secret: %s\n" % e) ``` ### Parameters Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **secret_id** | **str**| The ID of the secret to delete | ### Return type void (empty response body) ### HTTP request headers - **Content-Type**: Not defined - **Accept**: application/json ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| **200** | Secret deleted successfully | - | **401** | Unauthorized - Invalid or missing API key | - | **404** | Not found | - | **500** | Internal server error | - | # **get_secret** > Dict[str, object] get_secret(secret_id) Get a secret by ID Retrieves a secret from SecureStore by its ID. ### Example * Bearer Authentication (bearerAuth): ```python import h2ogpte.rest_sync from h2ogpte.rest_sync.rest import ApiException from pprint import pprint # Defining the host is optional and defaults to https://h2ogpte.genai.h2o.ai/api/v1 # See configuration.py for a list of all supported configuration parameters. configuration = h2ogpte.rest_sync.Configuration( host = "https://h2ogpte.genai.h2o.ai/api/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 Bearer authorization: bearerAuth configuration = h2ogpte.rest_sync.Configuration( access_token = os.environ["BEARER_TOKEN"] ) # Enter a context with an instance of the API client with h2ogpte.rest_sync.ApiClient(configuration) as api_client: # Create an instance of the API class api_instance = h2ogpte.rest_sync.SecretsApi(api_client) secret_id = 'secret_id_example' # str | The ID of the secret to retrieve try: # Get a secret by ID api_response = api_instance.get_secret(secret_id) print("The response of SecretsApi->get_secret:\n") pprint(api_response) except Exception as e: print("Exception when calling SecretsApi->get_secret: %s\n" % e) ``` ### Parameters Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **secret_id** | **str**| The ID of the secret to retrieve | ### Return type **Dict[str, object]** ### HTTP request headers - **Content-Type**: Not defined - **Accept**: application/json ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| **200** | Successful operation | - | **401** | Unauthorized - Invalid or missing API key | - | **404** | Not found | - | **500** | Internal server error | - | # **get_secret_value** > Dict[str, object] get_secret_value(secret_id) Get the value of a secret by ID Retrieves the actual value/credentials of a secret from SecureStore by its ID. ### Example * Bearer Authentication (bearerAuth): ```python import h2ogpte.rest_sync from h2ogpte.rest_sync.rest import ApiException from pprint import pprint # Defining the host is optional and defaults to https://h2ogpte.genai.h2o.ai/api/v1 # See configuration.py for a list of all supported configuration parameters. configuration = h2ogpte.rest_sync.Configuration( host = "https://h2ogpte.genai.h2o.ai/api/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 Bearer authorization: bearerAuth configuration = h2ogpte.rest_sync.Configuration( access_token = os.environ["BEARER_TOKEN"] ) # Enter a context with an instance of the API client with h2ogpte.rest_sync.ApiClient(configuration) as api_client: # Create an instance of the API class api_instance = h2ogpte.rest_sync.SecretsApi(api_client) secret_id = 'secret_id_example' # str | The ID of the secret to retrieve the value for try: # Get the value of a secret by ID api_response = api_instance.get_secret_value(secret_id) print("The response of SecretsApi->get_secret_value:\n") pprint(api_response) except Exception as e: print("Exception when calling SecretsApi->get_secret_value: %s\n" % e) ``` ### Parameters Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **secret_id** | **str**| The ID of the secret to retrieve the value for | ### Return type **Dict[str, object]** ### HTTP request headers - **Content-Type**: Not defined - **Accept**: application/json ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| **200** | Successful operation | - | **401** | Unauthorized - Invalid or missing API key | - | **404** | Not found | - | **500** | Internal server error | - | # **list_secret_ids** > List[str] list_secret_ids(connector_type=connector_type) Lists available secret IDs from SecureStore. Lists available secret IDs from SecureStore for a specific connector type. ### Example * Bearer Authentication (bearerAuth): ```python import h2ogpte.rest_sync from h2ogpte.rest_sync.rest import ApiException from pprint import pprint # Defining the host is optional and defaults to https://h2ogpte.genai.h2o.ai/api/v1 # See configuration.py for a list of all supported configuration parameters. configuration = h2ogpte.rest_sync.Configuration( host = "https://h2ogpte.genai.h2o.ai/api/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 Bearer authorization: bearerAuth configuration = h2ogpte.rest_sync.Configuration( access_token = os.environ["BEARER_TOKEN"] ) # Enter a context with an instance of the API client with h2ogpte.rest_sync.ApiClient(configuration) as api_client: # Create an instance of the API class api_instance = h2ogpte.rest_sync.SecretsApi(api_client) connector_type = 'connector_type_example' # str | Type of connector (s3, gcs, azure_key, azure_sas) (optional) try: # Lists available secret IDs from SecureStore. api_response = api_instance.list_secret_ids(connector_type=connector_type) print("The response of SecretsApi->list_secret_ids:\n") pprint(api_response) except Exception as e: print("Exception when calling SecretsApi->list_secret_ids: %s\n" % e) ``` ### Parameters Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **connector_type** | **str**| Type of connector (s3, gcs, azure_key, azure_sas) | [optional] ### Return type **List[str]** ### HTTP request headers - **Content-Type**: Not defined - **Accept**: application/json ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| **200** | Successful operation | - | **401** | Unauthorized - Invalid or missing API key | - | # **update_secret** > update_secret(secret_id, update_secret_request) Update a secret Updates an existing secret in SecureStore. ### Example * Bearer Authentication (bearerAuth): ```python import h2ogpte.rest_sync from h2ogpte.rest_sync.models.update_secret_request import UpdateSecretRequest from h2ogpte.rest_sync.rest import ApiException from pprint import pprint # Defining the host is optional and defaults to https://h2ogpte.genai.h2o.ai/api/v1 # See configuration.py for a list of all supported configuration parameters. configuration = h2ogpte.rest_sync.Configuration( host = "https://h2ogpte.genai.h2o.ai/api/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 Bearer authorization: bearerAuth configuration = h2ogpte.rest_sync.Configuration( access_token = os.environ["BEARER_TOKEN"] ) # Enter a context with an instance of the API client with h2ogpte.rest_sync.ApiClient(configuration) as api_client: # Create an instance of the API class api_instance = h2ogpte.rest_sync.SecretsApi(api_client) secret_id = 'secret_id_example' # str | The ID of the secret to update update_secret_request = h2ogpte.rest_sync.UpdateSecretRequest() # UpdateSecretRequest | try: # Update a secret api_instance.update_secret(secret_id, update_secret_request) except Exception as e: print("Exception when calling SecretsApi->update_secret: %s\n" % e) ``` ### Parameters Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **secret_id** | **str**| The ID of the secret to update | **update_secret_request** | [**UpdateSecretRequest**](UpdateSecretRequest.md)| | ### Return type void (empty response body) ### HTTP request headers - **Content-Type**: application/json - **Accept**: application/json ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| **200** | Secret updated successfully | - | **401** | Unauthorized - Invalid or missing API key | - | **404** | Not found | - | **500** | Internal server error | - |