Skip to content

CredentialsApi

All URIs are relative to https://app.coactive.ai

Method HTTP request Description
add_aws_credentials POST /api/v0/credentials/aws Add AWS credentials that can be used to fetch data from a cloud provider
add_gcp_credentials POST /api/v0/credentials/gcp Add GCP credentials that can be used to fetch data from a cloud provider
test_configuration POST /api/v0/credentials/credentials/test Test the role associated with the credentials is configured to access a data path

add_aws_credentials

Credentials add_aws_credentials(file)

Add AWS credentials that can be used to fetch data from a cloud provider

Example

  • Bearer Authentication (HTTPBearer):
import time
import coactive
from coactive.apis import CredentialsApi
from coactive.model.credentials import Credentials
from coactive.model.http_validation_error import HTTPValidationError
from coactive.model.error_response import ErrorResponse

# Defining the host is optional and defaults to https://app.coactive.ai.

# The client must configure the authentication and authorization parameters
# in accordance with the API server security policy.
# Example with auth is provided below, use the example that
# satisfies your auth use case.


# Configure Bearer authorization: HTTPBearer


# See configuration.py for a list of all supported configuration parameters.

from YOUR_ENV import CLIENT_ID, CLIENT_SECRET


configuration = coactive.Configuration(
    host = "https://app.coactive.ai",
    access_token = f"{CLIENT_ID}:{CLIENT_SECRET}",
)

# Enter a context with an instance of the API client
with coactive.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = CredentialsApi(api_client)
    file = open('/path/to/file', 'rb')

    # example passing only required values which don't have defaults set
    try:
        # Add AWS credentials that can be used to fetch data from a cloud provider
        api_response = api_instance.add_aws_credentials(file)
        print(api_response)
    except coactive.ApiException as e:
        print("Exception when calling CredentialsApi->add_aws_credentials: %s\n" % e)

Parameters

Name Type Description Notes
file file_type The credentials file

Return type

Credentials

Authorization

HTTPBearer

HTTP request headers

  • Content-Type: multipart/form-data
  • Accept: application/json

HTTP response details

Status code Description Response headers
200 The created credentials -
403 Authentication error -
401 Unauthorized -
404 Not found -
422 Validation Error -

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

add_gcp_credentials

Credentials add_gcp_credentials(file)

Add GCP credentials that can be used to fetch data from a cloud provider

Example

  • Bearer Authentication (HTTPBearer):
import time
import coactive
from coactive.apis import CredentialsApi
from coactive.model.credentials import Credentials
from coactive.model.http_validation_error import HTTPValidationError
from coactive.model.error_response import ErrorResponse

# Defining the host is optional and defaults to https://app.coactive.ai.

# The client must configure the authentication and authorization parameters
# in accordance with the API server security policy.
# Example with auth is provided below, use the example that
# satisfies your auth use case.


# Configure Bearer authorization: HTTPBearer


# See configuration.py for a list of all supported configuration parameters.

from YOUR_ENV import CLIENT_ID, CLIENT_SECRET


configuration = coactive.Configuration(
    host = "https://app.coactive.ai",
    access_token = f"{CLIENT_ID}:{CLIENT_SECRET}",
)

# Enter a context with an instance of the API client
with coactive.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = CredentialsApi(api_client)
    file = open('/path/to/file', 'rb')

    # example passing only required values which don't have defaults set
    try:
        # Add GCP credentials that can be used to fetch data from a cloud provider
        api_response = api_instance.add_gcp_credentials(file)
        print(api_response)
    except coactive.ApiException as e:
        print("Exception when calling CredentialsApi->add_gcp_credentials: %s\n" % e)

Parameters

Name Type Description Notes
file file_type The credentials file

Return type

Credentials

Authorization

HTTPBearer

HTTP request headers

  • Content-Type: multipart/form-data
  • Accept: application/json

HTTP response details

Status code Description Response headers
200 The created credentials -
403 Authentication error -
401 Unauthorized -
404 Not found -
422 Validation Error -

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

test_configuration

TestConfigurationResponse test_configuration(test_configuration_request)

Test the role associated with the credentials is configured to access a data path

Example

  • Bearer Authentication (HTTPBearer):
import time
import coactive
from coactive.apis import CredentialsApi
from coactive.model.test_configuration_request import TestConfigurationRequest
from coactive.model.test_configuration_response import TestConfigurationResponse
from coactive.model.http_validation_error import HTTPValidationError
from coactive.model.error_response import ErrorResponse

# Defining the host is optional and defaults to https://app.coactive.ai.

# The client must configure the authentication and authorization parameters
# in accordance with the API server security policy.
# Example with auth is provided below, use the example that
# satisfies your auth use case.


# Configure Bearer authorization: HTTPBearer


# See configuration.py for a list of all supported configuration parameters.

from YOUR_ENV import CLIENT_ID, CLIENT_SECRET


configuration = coactive.Configuration(
    host = "https://app.coactive.ai",
    access_token = f"{CLIENT_ID}:{CLIENT_SECRET}",
)

# Enter a context with an instance of the API client
with coactive.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = CredentialsApi(api_client)
    test_configuration_request = TestConfigurationRequest(
        credentials_id="382cc760-8e8e-4b97-abab-84438282cb9a",
        data_path="s3://your-s3-bucket/prefix/to/use/",
    )

    # example passing only required values which don't have defaults set
    try:
        # Test the role associated with the credentials is configured to access a data path
        api_response = api_instance.test_configuration(test_configuration_request)
        print(api_response)
    except coactive.ApiException as e:
        print("Exception when calling CredentialsApi->test_configuration: %s\n" % e)

Parameters

Name Type Description Notes
test_configuration_request TestConfigurationRequest

Return type

TestConfigurationResponse

Authorization

HTTPBearer

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

HTTP response details

Status code Description Response headers
200 The data path is accessible using the credentials -
403 Authentication error -
401 Unauthorized -
404 Not found -
422 Validation Error -

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