pldpro_sdk.api_client.ReservationUsageApi
All URIs are relative to http://localhost:8086
| Method | HTTP request | Description |
|---|---|---|
| create_reservation_usage | POST /api/v1/reservation-usages | Cria um registro de consumo de reserva |
| delete_reservation_usage | DELETE /api/v1/reservation-usages/{id} | Remove um consumo de reserva pelo id |
| get_all_reservation_usages | GET /api/v1/reservation-usages | Lista os consumos de reserva |
| get_reservation_usage_by_id | GET /api/v1/reservation-usages/{id} | Busca um consumo de reserva pelo id |
| update_reservation_usage | PUT /api/v1/reservation-usages/{id} | Atualiza um consumo de reserva pelo id |
create_reservation_usage
ReservationUsageResponse create_reservation_usage(reservation_usage_request)
Cria um registro de consumo de reserva
Cadastra um novo registro em reservation_usage referenciando uma reserva existente no catálogo.
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.reservation_usage_request import ReservationUsageRequest
from pldpro_sdk.api_client.models.reservation_usage_response import ReservationUsageResponse
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.ReservationUsageApi(api_client)
reservation_usage_request = {reservationId=reserva-dc-01, execucaoUuid=123e4567-e89b-12d3-a456-426614174000, casoUuid=550e8400-e29b-41d4-a716-446655440000, status=ALLOCATED, requestedReservationId=reserva-pedida-01, resolvedTarget=DATACENTER, reason=RESERVATION_ALLOCATED, active=true, reservationCurrentUsage=3, reservationMaxUsage=4, releasedAt=2026-04-24T15:45:00Z} # ReservationUsageRequest |
try:
# Cria um registro de consumo de reserva
api_response = api_instance.create_reservation_usage(reservation_usage_request)
print("The response of ReservationUsageApi->create_reservation_usage:\n")
pprint(api_response)
except Exception as e:
print("Exception when calling ReservationUsageApi->create_reservation_usage: %s\n" % e)
Parameters
| Name | Type | Description | Notes |
|---|---|---|---|
| reservation_usage_request | ReservationUsageRequest |
Return type
Authorization
1_tenant, 4_roles, security_auth, 2_user, ApiKeyAuth, 3_user_id
HTTP request headers
- Content-Type: application/json
- Accept: application/json
HTTP response details
| Status code | Description | Response headers |
|---|---|---|
| 200 | Registro de consumo de reserva criado com sucesso. | - |
| 400 | Erro ao criar consumo de reserva | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
delete_reservation_usage
delete_reservation_usage(id)
Remove um consumo de reserva pelo id
Exclui um registro de reservation_usage identificado pelo id interno.
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.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.ReservationUsageApi(api_client)
id = 56 # int | Identificador interno do consumo de reserva
try:
# Remove um consumo de reserva pelo id
api_instance.delete_reservation_usage(id)
except Exception as e:
print("Exception when calling ReservationUsageApi->delete_reservation_usage: %s\n" % e)
Parameters
| Name | Type | Description | Notes |
|---|---|---|---|
| id | int | Identificador interno do consumo de reserva |
Return type
void (empty response body)
Authorization
1_tenant, 4_roles, security_auth, 2_user, ApiKeyAuth, 3_user_id
HTTP request headers
- Content-Type: Not defined
- Accept: application/json
HTTP response details
| Status code | Description | Response headers |
|---|---|---|
| 204 | Consumo de reserva removido com sucesso. Nenhum conteúdo retornado. | - |
| 400 | Erro ao remover consumo de reserva | - |
| 404 | Consumo de reserva não encontrado | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
get_all_reservation_usages
List[ReservationUsageResponse] get_all_reservation_usages()
Lista os consumos de reserva
Retorna todos os registros cadastrados em reservation_usage, ordenados da criação mais recente para a mais antiga.
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.reservation_usage_response import ReservationUsageResponse
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.ReservationUsageApi(api_client)
try:
# Lista os consumos de reserva
api_response = api_instance.get_all_reservation_usages()
print("The response of ReservationUsageApi->get_all_reservation_usages:\n")
pprint(api_response)
except Exception as e:
print("Exception when calling ReservationUsageApi->get_all_reservation_usages: %s\n" % e)
Parameters
This endpoint does not need any parameter.
Return type
List[ReservationUsageResponse]
Authorization
1_tenant, 4_roles, security_auth, 2_user, ApiKeyAuth, 3_user_id
HTTP request headers
- Content-Type: Not defined
- Accept: application/json
HTTP response details
| Status code | Description | Response headers |
|---|---|---|
| 200 | Lista de consumos de reserva retornada com sucesso. | - |
| 400 | Erro ao listar consumos de reserva | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
get_reservation_usage_by_id
ReservationUsageResponse get_reservation_usage_by_id(id)
Busca um consumo de reserva pelo id
Retorna os detalhes de um registro específico de reservation_usage, identificado pelo id interno.
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.reservation_usage_response import ReservationUsageResponse
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.ReservationUsageApi(api_client)
id = 56 # int | Identificador interno do consumo de reserva
try:
# Busca um consumo de reserva pelo id
api_response = api_instance.get_reservation_usage_by_id(id)
print("The response of ReservationUsageApi->get_reservation_usage_by_id:\n")
pprint(api_response)
except Exception as e:
print("Exception when calling ReservationUsageApi->get_reservation_usage_by_id: %s\n" % e)
Parameters
| Name | Type | Description | Notes |
|---|---|---|---|
| id | int | Identificador interno do consumo de reserva |
Return type
Authorization
1_tenant, 4_roles, security_auth, 2_user, ApiKeyAuth, 3_user_id
HTTP request headers
- Content-Type: Not defined
- Accept: application/json, /
HTTP response details
| Status code | Description | Response headers |
|---|---|---|
| 200 | Consumo de reserva encontrado com sucesso. | - |
| 400 | Erro ao buscar consumo de reserva | - |
| 404 | Consumo de reserva não encontrado | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
update_reservation_usage
ReservationUsageResponse update_reservation_usage(id, reservation_usage_request)
Atualiza um consumo de reserva pelo id
Atualiza os dados de um registro específico de reservation_usage, identificado pelo id interno.
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.reservation_usage_request import ReservationUsageRequest
from pldpro_sdk.api_client.models.reservation_usage_response import ReservationUsageResponse
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.ReservationUsageApi(api_client)
id = 56 # int | Identificador interno do consumo de reserva
reservation_usage_request = {"reservationId":"reserva-dc-01","execucaoUuid":"123e4567-e89b-12d3-a456-426614174000","casoUuid":"550e8400-e29b-41d4-a716-446655440000","status":"ALLOCATED","requestedReservationId":"reserva-pedida-01","resolvedTarget":"DATACENTER","reason":"RESERVATION_ALLOCATED","active":true,"reservationCurrentUsage":3,"reservationMaxUsage":4,"releasedAt":"2026-04-24T15:45:00Z"} # ReservationUsageRequest |
try:
# Atualiza um consumo de reserva pelo id
api_response = api_instance.update_reservation_usage(id, reservation_usage_request)
print("The response of ReservationUsageApi->update_reservation_usage:\n")
pprint(api_response)
except Exception as e:
print("Exception when calling ReservationUsageApi->update_reservation_usage: %s\n" % e)
Parameters
| Name | Type | Description | Notes |
|---|---|---|---|
| id | int | Identificador interno do consumo de reserva | |
| reservation_usage_request | ReservationUsageRequest |
Return type
Authorization
1_tenant, 4_roles, security_auth, 2_user, ApiKeyAuth, 3_user_id
HTTP request headers
- Content-Type: application/json
- Accept: application/json, /
HTTP response details
| Status code | Description | Response headers |
|---|---|---|
| 200 | Consumo de reserva atualizado com sucesso. | - |
| 400 | Erro ao atualizar consumo de reserva | - |
| 404 | Consumo de reserva não encontrado | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]