Skip to content

Latest commit

 

History

History
449 lines (310 loc) · 13.5 KB

File metadata and controls

449 lines (310 loc) · 13.5 KB

stratum.ConfigApi

All URIs are relative to http://localhost:3000

Method HTTP request Description
batch_set_config PUT /api/v1/tenants/{id}/config/batch Batch set config
delete_config DELETE /api/v1/tenants/{id}/config/{key} Delete config override
get_config_inheritance GET /api/v1/tenants/{id}/config/inheritance Get config inheritance
resolve_config GET /api/v1/tenants/{id}/config Get resolved config
set_config PUT /api/v1/tenants/{id}/config/{key} Set config value

batch_set_config

List[ConfigEntry] batch_set_config(id, batch_set_config_input)

Batch set config

Set multiple configuration keys atomically. Limited to 200 entries per request.

Example

  • Api Key Authentication (apiKey):
  • Bearer (JWT) Authentication (bearerAuth):
import stratum
from stratum.models.batch_set_config_input import BatchSetConfigInput
from stratum.models.config_entry import ConfigEntry
from stratum.rest import ApiException
from pprint import pprint

# Defining the host is optional and defaults to http://localhost:3000
# See configuration.py for a list of all supported configuration parameters.
configuration = stratum.Configuration(
    host = "http://localhost:3000"
)

# 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 Bearer authorization (JWT): bearerAuth
configuration = stratum.Configuration(
    access_token = os.environ["BEARER_TOKEN"]
)

# Enter a context with an instance of the API client
with stratum.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = stratum.ConfigApi(api_client)
    id = UUID('38400000-8cf0-11bd-b23e-10b96e4ef00d') # UUID | 
    batch_set_config_input = stratum.BatchSetConfigInput() # BatchSetConfigInput | 

    try:
        # Batch set config
        api_response = api_instance.batch_set_config(id, batch_set_config_input)
        print("The response of ConfigApi->batch_set_config:\n")
        pprint(api_response)
    except Exception as e:
        print("Exception when calling ConfigApi->batch_set_config: %s\n" % e)

Parameters

Name Type Description Notes
id UUID
batch_set_config_input BatchSetConfigInput

Return type

List[ConfigEntry]

Authorization

apiKey, bearerAuth

HTTP request headers

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

HTTP response details

Status code Description Response headers
200 Batch set result -
400 Validation error -

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

delete_config

delete_config(id, key)

Delete config override

Delete a configuration override for a tenant, reverting to the inherited value.

Example

  • Api Key Authentication (apiKey):
  • Bearer (JWT) Authentication (bearerAuth):
import stratum
from stratum.rest import ApiException
from pprint import pprint

# Defining the host is optional and defaults to http://localhost:3000
# See configuration.py for a list of all supported configuration parameters.
configuration = stratum.Configuration(
    host = "http://localhost:3000"
)

# 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 Bearer authorization (JWT): bearerAuth
configuration = stratum.Configuration(
    access_token = os.environ["BEARER_TOKEN"]
)

# Enter a context with an instance of the API client
with stratum.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = stratum.ConfigApi(api_client)
    id = UUID('38400000-8cf0-11bd-b23e-10b96e4ef00d') # UUID | 
    key = 'key_example' # str | 

    try:
        # Delete config override
        api_instance.delete_config(id, key)
    except Exception as e:
        print("Exception when calling ConfigApi->delete_config: %s\n" % e)

Parameters

Name Type Description Notes
id UUID
key str

Return type

void (empty response body)

Authorization

apiKey, bearerAuth

HTTP request headers

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

HTTP response details

Status code Description Response headers
204 Config entry deleted -
404 Tenant or config key not found -

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

get_config_inheritance

ConfigInheritanceView get_config_inheritance(id)

Get config inheritance

Get the full inheritance view showing config at each level of the hierarchy.

Example

  • Api Key Authentication (apiKey):
  • Bearer (JWT) Authentication (bearerAuth):
import stratum
from stratum.models.config_inheritance_view import ConfigInheritanceView
from stratum.rest import ApiException
from pprint import pprint

# Defining the host is optional and defaults to http://localhost:3000
# See configuration.py for a list of all supported configuration parameters.
configuration = stratum.Configuration(
    host = "http://localhost:3000"
)

# 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 Bearer authorization (JWT): bearerAuth
configuration = stratum.Configuration(
    access_token = os.environ["BEARER_TOKEN"]
)

# Enter a context with an instance of the API client
with stratum.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = stratum.ConfigApi(api_client)
    id = UUID('38400000-8cf0-11bd-b23e-10b96e4ef00d') # UUID | 

    try:
        # Get config inheritance
        api_response = api_instance.get_config_inheritance(id)
        print("The response of ConfigApi->get_config_inheritance:\n")
        pprint(api_response)
    except Exception as e:
        print("Exception when calling ConfigApi->get_config_inheritance: %s\n" % e)

Parameters

Name Type Description Notes
id UUID

Return type

ConfigInheritanceView

Authorization

apiKey, bearerAuth

HTTP request headers

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

HTTP response details

Status code Description Response headers
200 Config inheritance view -
404 Tenant not found -

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

resolve_config

Dict[str, object] resolve_config(id)

Get resolved config

Get the resolved (inherited) configuration for a tenant.

Example

  • Api Key Authentication (apiKey):
  • Bearer (JWT) Authentication (bearerAuth):
import stratum
from stratum.rest import ApiException
from pprint import pprint

# Defining the host is optional and defaults to http://localhost:3000
# See configuration.py for a list of all supported configuration parameters.
configuration = stratum.Configuration(
    host = "http://localhost:3000"
)

# 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 Bearer authorization (JWT): bearerAuth
configuration = stratum.Configuration(
    access_token = os.environ["BEARER_TOKEN"]
)

# Enter a context with an instance of the API client
with stratum.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = stratum.ConfigApi(api_client)
    id = UUID('38400000-8cf0-11bd-b23e-10b96e4ef00d') # UUID | 

    try:
        # Get resolved config
        api_response = api_instance.resolve_config(id)
        print("The response of ConfigApi->resolve_config:\n")
        pprint(api_response)
    except Exception as e:
        print("Exception when calling ConfigApi->resolve_config: %s\n" % e)

Parameters

Name Type Description Notes
id UUID

Return type

Dict[str, object]

Authorization

apiKey, bearerAuth

HTTP request headers

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

HTTP response details

Status code Description Response headers
200 Resolved config key-value map -
404 Tenant not found -

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

set_config

ConfigEntry set_config(id, key, set_config_input)

Set config value

Set a configuration value for a tenant. Creates or overwrites the key.

Example

  • Api Key Authentication (apiKey):
  • Bearer (JWT) Authentication (bearerAuth):
import stratum
from stratum.models.config_entry import ConfigEntry
from stratum.models.set_config_input import SetConfigInput
from stratum.rest import ApiException
from pprint import pprint

# Defining the host is optional and defaults to http://localhost:3000
# See configuration.py for a list of all supported configuration parameters.
configuration = stratum.Configuration(
    host = "http://localhost:3000"
)

# 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 Bearer authorization (JWT): bearerAuth
configuration = stratum.Configuration(
    access_token = os.environ["BEARER_TOKEN"]
)

# Enter a context with an instance of the API client
with stratum.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = stratum.ConfigApi(api_client)
    id = UUID('38400000-8cf0-11bd-b23e-10b96e4ef00d') # UUID | 
    key = 'key_example' # str | 
    set_config_input = stratum.SetConfigInput() # SetConfigInput | 

    try:
        # Set config value
        api_response = api_instance.set_config(id, key, set_config_input)
        print("The response of ConfigApi->set_config:\n")
        pprint(api_response)
    except Exception as e:
        print("Exception when calling ConfigApi->set_config: %s\n" % e)

Parameters

Name Type Description Notes
id UUID
key str
set_config_input SetConfigInput

Return type

ConfigEntry

Authorization

apiKey, bearerAuth

HTTP request headers

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

HTTP response details

Status code Description Response headers
200 Config entry set -
404 Tenant not found -

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