Skip to content

stratum-hq/stratum-python

Repository files navigation

stratum-python

Universal Tenant Context Engine - Control Plane

This Python package is automatically generated by the OpenAPI Generator project:

  • API version: 0.1.0
  • Package version: 0.1.0
  • Generator version: 7.21.0-SNAPSHOT
  • Build package: org.openapitools.codegen.languages.PythonClientCodegen For more information, please visit https://github.com/stratum-hq

Requirements.

Python 3.9+

Installation & Usage

pip install

If the python package is hosted on a repository, you can install directly using:

pip install git+https://github.com/GIT_USER_ID/GIT_REPO_ID.git

(you may need to run pip with root permission: sudo pip install git+https://github.com/GIT_USER_ID/GIT_REPO_ID.git)

Then import the package:

import stratum

Setuptools

Install via Setuptools.

python setup.py install --user

(or sudo python setup.py install to install the package for all users)

Then import the package:

import stratum

Tests

Execute pytest to run the tests.

Getting Started

Please follow the installation procedure and then run the following:

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.APIKeysApi(api_client)
    create_api_key_input = stratum.CreateApiKeyInput() # CreateApiKeyInput | 

    try:
        # Create API key
        api_response = api_instance.create_api_key(create_api_key_input)
        print("The response of APIKeysApi->create_api_key:\n")
        pprint(api_response)
    except ApiException as e:
        print("Exception when calling APIKeysApi->create_api_key: %s\n" % e)

Documentation for API Endpoints

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

Class Method HTTP request Description
APIKeysApi create_api_key POST /api/v1/api-keys Create API key
APIKeysApi list_api_keys GET /api/v1/api-keys List API keys
APIKeysApi list_dormant_api_keys GET /api/v1/api-keys/dormant List dormant API keys
APIKeysApi revoke_api_key DELETE /api/v1/api-keys/{id} Revoke API key
APIKeysApi rotate_api_key POST /api/v1/api-keys/{id}/rotate Rotate API key
AuditLogsApi get_audit_log_entry GET /api/v1/audit-logs/{id} Get audit log entry
AuditLogsApi query_audit_logs GET /api/v1/audit-logs Query audit logs
ConfigApi batch_set_config PUT /api/v1/tenants/{id}/config/batch Batch set config
ConfigApi delete_config DELETE /api/v1/tenants/{id}/config/{key} Delete config override
ConfigApi get_config_inheritance GET /api/v1/tenants/{id}/config/inheritance Get config inheritance
ConfigApi resolve_config GET /api/v1/tenants/{id}/config Get resolved config
ConfigApi set_config PUT /api/v1/tenants/{id}/config/{key} Set config value
ConsentApi grant_consent POST /api/v1/tenants/{tenantId}/consent Grant consent
ConsentApi list_consent GET /api/v1/tenants/{tenantId}/consent List consent records
ConsentApi revoke_consent DELETE /api/v1/tenants/{tenantId}/consent/{purpose} Revoke consent
GDPRApi export_tenant_data GET /api/v1/tenants/{id}/export Export tenant data
GDPRApi purge_tenant POST /api/v1/tenants/{id}/purge Purge tenant data
HealthApi get_health GET /api/v1/health Health check
MaintenanceApi purge_expired_data POST /api/v1/maintenance/purge-expired Purge expired data
MaintenanceApi rotate_encryption_key POST /api/v1/maintenance/rotate-encryption-key Rotate encryption key
PermissionsApi create_permission POST /api/v1/tenants/{id}/permissions Create permission policy
PermissionsApi delete_permission DELETE /api/v1/tenants/{id}/permissions/{policyId} Delete permission policy
PermissionsApi resolve_permissions GET /api/v1/tenants/{id}/permissions Get resolved permissions
PermissionsApi update_permission PATCH /api/v1/tenants/{id}/permissions/{policyId} Update permission policy
RegionsApi create_region POST /api/v1/regions Create region
RegionsApi delete_region DELETE /api/v1/regions/{id} Delete region
RegionsApi get_region GET /api/v1/regions/{id} Get region
RegionsApi list_regions GET /api/v1/regions List regions
RegionsApi update_region PATCH /api/v1/regions/{id} Update region
RolesApi assign_role_to_key POST /api/v1/roles/assign/{keyId} Assign role to API key
RolesApi create_role POST /api/v1/roles Create role
RolesApi delete_role DELETE /api/v1/roles/{id} Delete role
RolesApi get_role GET /api/v1/roles/{id} Get role
RolesApi list_roles GET /api/v1/roles List roles
RolesApi remove_role_from_key DELETE /api/v1/roles/assign/{keyId} Remove role from API key
RolesApi update_role PATCH /api/v1/roles/{id} Update role
TenantsApi batch_create_tenants POST /api/v1/tenants/batch Batch create tenants
TenantsApi create_tenant POST /api/v1/tenants Create tenant
TenantsApi delete_tenant DELETE /api/v1/tenants/{id} Delete tenant
TenantsApi export_tenant_data GET /api/v1/tenants/{id}/export Export tenant data
TenantsApi get_tenant GET /api/v1/tenants/{id} Get tenant
TenantsApi get_tenant_ancestors GET /api/v1/tenants/{id}/ancestors Get tenant ancestors
TenantsApi get_tenant_children GET /api/v1/tenants/{id}/children Get tenant children
TenantsApi get_tenant_descendants GET /api/v1/tenants/{id}/descendants Get tenant descendants
TenantsApi list_tenants GET /api/v1/tenants List tenants
TenantsApi migrate_tenant_region POST /api/v1/tenants/{id}/migrate-region Migrate tenant region
TenantsApi move_tenant POST /api/v1/tenants/{id}/move Move tenant
TenantsApi purge_tenant POST /api/v1/tenants/{id}/purge Purge tenant data
TenantsApi resolve_tenant_context GET /api/v1/tenants/{id}/context Resolve tenant context
TenantsApi update_tenant PATCH /api/v1/tenants/{id} Update tenant
WebhooksApi create_webhook POST /api/v1/webhooks Create webhook
WebhooksApi delete_webhook DELETE /api/v1/webhooks/{id} Delete webhook
WebhooksApi get_delivery_stats GET /api/v1/webhooks/deliveries/stats Get delivery statistics
WebhooksApi get_webhook GET /api/v1/webhooks/{id} Get webhook
WebhooksApi list_failed_deliveries GET /api/v1/webhooks/deliveries/failed List failed deliveries
WebhooksApi list_webhook_deliveries GET /api/v1/webhooks/{id}/deliveries List webhook deliveries
WebhooksApi list_webhooks GET /api/v1/webhooks List webhooks
WebhooksApi retry_all_failed_deliveries POST /api/v1/webhooks/deliveries/retry-all Retry all failed deliveries
WebhooksApi retry_delivery POST /api/v1/webhooks/deliveries/{deliveryId}/retry Retry single delivery
WebhooksApi test_webhook POST /api/v1/webhooks/{id}/test Test webhook
WebhooksApi update_webhook PATCH /api/v1/webhooks/{id} Update webhook

Documentation For Models

Documentation For Authorization

Authentication schemes defined for the API:

apiKey

  • Type: API key
  • API key parameter name: X-API-Key
  • Location: HTTP header

bearerAuth

  • Type: Bearer authentication (JWT)

Author

About

Stratum Python SDK

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors