pldpro_sdk.api_client.TenantsApi
All URIs are relative to http://localhost:8086
| Method | HTTP request | Description |
|---|---|---|
| create_tenant | POST /api/v1/tenants | Criar um tenant |
create_tenant
TenantResponse create_tenant(tenant_request)
Criar um tenant
Cria um tenant PLDPRO e sua configuração inicial de esquema isolado.
Example
- Api Key Authentication (1_tenant):
- Api Key Authentication (4_roles):
- Bearer (JWT) Authentication (security_auth):
- Api Key Authentication (2_user):
- Api Key Authentication (ApiKeyAuth):
- Api Key Authentication (3_user_id):
import pldpro_sdk.api_client
from pldpro_sdk.api_client.models.tenant_request import TenantRequest
from pldpro_sdk.api_client.models.tenant_response import TenantResponse
from pldpro_sdk.api_client.rest import ApiException
from pprint import pprint
# Defining the host is optional and defaults to http://localhost:8086
# See configuration.py for a list of all supported configuration parameters.
configuration = pldpro_sdk.api_client.Configuration(
host = "http://localhost:8086"
)
# 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: 1_tenant
configuration.api_key['1_tenant'] = os.environ["API_KEY"]
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['1_tenant'] = 'Bearer'
# Configure API key authorization: 4_roles
configuration.api_key['4_roles'] = os.environ["API_KEY"]
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['4_roles'] = 'Bearer'
# Configure Bearer authorization (JWT): security_auth
configuration = pldpro_sdk.api_client.Configuration(
access_token = os.environ["BEARER_TOKEN"]
)
# Configure API key authorization: 2_user
configuration.api_key['2_user'] = os.environ["API_KEY"]
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['2_user'] = 'Bearer'
# Configure API key authorization: ApiKeyAuth
configuration.api_key['ApiKeyAuth'] = os.environ["API_KEY"]
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['ApiKeyAuth'] = 'Bearer'
# Configure API key authorization: 3_user_id
configuration.api_key['3_user_id'] = os.environ["API_KEY"]
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['3_user_id'] = 'Bearer'
# Enter a context with an instance of the API client
with pldpro_sdk.api_client.ApiClient(configuration) as api_client:
# Create an instance of the API class
api_instance = pldpro_sdk.api_client.TenantsApi(api_client)
tenant_request = pldpro_sdk.api_client.TenantRequest() # TenantRequest |
try:
# Criar um tenant
api_response = api_instance.create_tenant(tenant_request)
print("The response of TenantsApi->create_tenant:\n")
pprint(api_response)
except Exception as e:
print("Exception when calling TenantsApi->create_tenant: %s\n" % e)
Parameters
| Name | Type | Description | Notes |
|---|---|---|---|
| tenant_request | TenantRequest |
Return type
Authorization
1_tenant, 4_roles, security_auth, 2_user, ApiKeyAuth, 3_user_id
HTTP request headers
- Content-Type: application/json
- Accept: /
HTTP response details
| Status code | Description | Response headers |
|---|---|---|
| 200 | Tenant criado com sucesso. | - |
| 400 | Solicitação de tenant inválida. | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]