Skip to content

Latest commit

 

History

History
439 lines (301 loc) · 12.5 KB

File metadata and controls

439 lines (301 loc) · 12.5 KB

stratum.RegionsApi

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

Method HTTP request Description
create_region POST /api/v1/regions Create region
delete_region DELETE /api/v1/regions/{id} Delete region
get_region GET /api/v1/regions/{id} Get region
list_regions GET /api/v1/regions List regions
update_region PATCH /api/v1/regions/{id} Update region

create_region

Region create_region(create_region_input)

Create region

Create a new region for data residency.

Example

  • Api Key Authentication (apiKey):
  • Bearer (JWT) Authentication (bearerAuth):
import stratum
from stratum.models.create_region_input import CreateRegionInput
from stratum.models.region import Region
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.RegionsApi(api_client)
    create_region_input = stratum.CreateRegionInput() # CreateRegionInput | 

    try:
        # Create region
        api_response = api_instance.create_region(create_region_input)
        print("The response of RegionsApi->create_region:\n")
        pprint(api_response)
    except Exception as e:
        print("Exception when calling RegionsApi->create_region: %s\n" % e)

Parameters

Name Type Description Notes
create_region_input CreateRegionInput

Return type

Region

Authorization

apiKey, bearerAuth

HTTP request headers

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

HTTP response details

Status code Description Response headers
201 Created region -
400 Validation error -

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

delete_region

delete_region(id)

Delete region

Delete a region.

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.RegionsApi(api_client)
    id = UUID('38400000-8cf0-11bd-b23e-10b96e4ef00d') # UUID | 

    try:
        # Delete region
        api_instance.delete_region(id)
    except Exception as e:
        print("Exception when calling RegionsApi->delete_region: %s\n" % e)

Parameters

Name Type Description Notes
id UUID

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 Region deleted -
404 Region not found -

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

get_region

Region get_region(id)

Get region

Get a region by ID.

Example

  • Api Key Authentication (apiKey):
  • Bearer (JWT) Authentication (bearerAuth):
import stratum
from stratum.models.region import Region
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.RegionsApi(api_client)
    id = UUID('38400000-8cf0-11bd-b23e-10b96e4ef00d') # UUID | 

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

Parameters

Name Type Description Notes
id UUID

Return type

Region

Authorization

apiKey, bearerAuth

HTTP request headers

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

HTTP response details

Status code Description Response headers
200 Region details -
404 Region not found -

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

list_regions

List[Region] list_regions()

List regions

List all regions.

Example

  • Api Key Authentication (apiKey):
  • Bearer (JWT) Authentication (bearerAuth):
import stratum
from stratum.models.region import Region
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.RegionsApi(api_client)

    try:
        # List regions
        api_response = api_instance.list_regions()
        print("The response of RegionsApi->list_regions:\n")
        pprint(api_response)
    except Exception as e:
        print("Exception when calling RegionsApi->list_regions: %s\n" % e)

Parameters

This endpoint does not need any parameter.

Return type

List[Region]

Authorization

apiKey, bearerAuth

HTTP request headers

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

HTTP response details

Status code Description Response headers
200 List of regions -

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

update_region

Region update_region(id, update_region_input)

Update region

Update a region's properties.

Example

  • Api Key Authentication (apiKey):
  • Bearer (JWT) Authentication (bearerAuth):
import stratum
from stratum.models.region import Region
from stratum.models.update_region_input import UpdateRegionInput
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.RegionsApi(api_client)
    id = UUID('38400000-8cf0-11bd-b23e-10b96e4ef00d') # UUID | 
    update_region_input = stratum.UpdateRegionInput() # UpdateRegionInput | 

    try:
        # Update region
        api_response = api_instance.update_region(id, update_region_input)
        print("The response of RegionsApi->update_region:\n")
        pprint(api_response)
    except Exception as e:
        print("Exception when calling RegionsApi->update_region: %s\n" % e)

Parameters

Name Type Description Notes
id UUID
update_region_input UpdateRegionInput

Return type

Region

Authorization

apiKey, bearerAuth

HTTP request headers

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

HTTP response details

Status code Description Response headers
200 Updated region -
404 Region not found -

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