Administration API
Administration API documentation for Python SDK
All URIs are relative to http://localhost:8080
| Method | HTTP request | Description |
|---|---|---|
| drain_server | POST /v1/admin:drain | Request the server to enter drain mode |
| purge_background_jobs | POST /v1/admin/background-jobs:purge | Purge completed background jobs |
| reload_license | POST /v1/admin/license:reload | Reload the active license from disk |
drain_server
AdminDrainResponse drain_server(admin_drain_request=admin_drain_request)
Request the server to enter drain mode
Initiates drain mode and optionally waits for the server to quiesce.
Example
- Api Key Authentication (ApiKeyAuth):
import goodmem_client
from goodmem_client.models.admin_drain_request import AdminDrainRequest
from goodmem_client.models.admin_drain_response import AdminDrainResponse
from goodmem_client.rest import ApiException
from pprint import pprint
# Defining the host is optional and defaults to http://localhost:8080/v1/default
# See configuration.py for a list of all supported configuration parameters.
configuration = goodmem_client.Configuration(
host = "http://localhost:8080/v1/default"
)
# 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: 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'
# Enter a context with an instance of the API client
with goodmem_client.ApiClient(configuration) as api_client:
# Create an instance of the API class
api_instance = goodmem_client.AdministrationApi(api_client)
admin_drain_request = goodmem_client.AdminDrainRequest() # AdminDrainRequest | (optional)
try:
# Request the server to enter drain mode
api_response = api_instance.drain_server(admin_drain_request=admin_drain_request)
print("The response of AdministrationApi->drain_server:\n")
pprint(api_response)
except Exception as e:
print("Exception when calling AdministrationApi->drain_server: %s\n" % e)Parameters
| Name | Type | Description | Notes |
|---|---|---|---|
| admin_drain_request | AdminDrainRequest | [optional] |
Return type
Authorization
HTTP request headers
- Content-Type: application/json
- Accept: application/json
HTTP response details
| Status code | Description | Response headers |
|---|---|---|
| 200 | Drain request acknowledged | - |
| 401 | Unauthorized - invalid or missing API key | - |
| 403 | Forbidden - missing permissions | - |
purge_background_jobs
AdminPurgeJobsResponse purge_background_jobs(admin_purge_jobs_request=admin_purge_jobs_request)
Purge completed background jobs
Deletes terminal background jobs older than a retention cutoff.
Example
- Api Key Authentication (ApiKeyAuth):
import goodmem_client
from goodmem_client.models.admin_purge_jobs_request import AdminPurgeJobsRequest
from goodmem_client.models.admin_purge_jobs_response import AdminPurgeJobsResponse
from goodmem_client.rest import ApiException
from pprint import pprint
# Defining the host is optional and defaults to http://localhost:8080/v1/default
# See configuration.py for a list of all supported configuration parameters.
configuration = goodmem_client.Configuration(
host = "http://localhost:8080/v1/default"
)
# 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: 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'
# Enter a context with an instance of the API client
with goodmem_client.ApiClient(configuration) as api_client:
# Create an instance of the API class
api_instance = goodmem_client.AdministrationApi(api_client)
admin_purge_jobs_request = goodmem_client.AdminPurgeJobsRequest() # AdminPurgeJobsRequest | (optional)
try:
# Purge completed background jobs
api_response = api_instance.purge_background_jobs(admin_purge_jobs_request=admin_purge_jobs_request)
print("The response of AdministrationApi->purge_background_jobs:\n")
pprint(api_response)
except Exception as e:
print("Exception when calling AdministrationApi->purge_background_jobs: %s\n" % e)Parameters
| Name | Type | Description | Notes |
|---|---|---|---|
| admin_purge_jobs_request | AdminPurgeJobsRequest | [optional] |
Return type
Authorization
HTTP request headers
- Content-Type: application/json
- Accept: application/json
HTTP response details
| Status code | Description | Response headers |
|---|---|---|
| 200 | Purge completed | - |
| 400 | Invalid request payload | - |
| 401 | Unauthorized - invalid or missing API key | - |
| 403 | Forbidden - missing permissions | - |
reload_license
AdminReloadLicenseResponse reload_license()
Reload the active license from disk
Triggers the server to reload its license file from the configured directory and returns metadata about the currently active license.
Example
- Api Key Authentication (ApiKeyAuth):
import goodmem_client
from goodmem_client.models.admin_reload_license_response import AdminReloadLicenseResponse
from goodmem_client.rest import ApiException
from pprint import pprint
# Defining the host is optional and defaults to http://localhost:8080/v1/default
# See configuration.py for a list of all supported configuration parameters.
configuration = goodmem_client.Configuration(
host = "http://localhost:8080/v1/default"
)
# 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: 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'
# Enter a context with an instance of the API client
with goodmem_client.ApiClient(configuration) as api_client:
# Create an instance of the API class
api_instance = goodmem_client.AdministrationApi(api_client)
try:
# Reload the active license from disk
api_response = api_instance.reload_license()
print("The response of AdministrationApi->reload_license:\n")
pprint(api_response)
except Exception as e:
print("Exception when calling AdministrationApi->reload_license: %s\n" % e)Parameters
This endpoint does not need any parameter.
Return type
Authorization
HTTP request headers
- Content-Type: Not defined
- Accept: application/json
HTTP response details
| Status code | Description | Response headers |
|---|---|---|
| 200 | License reload attempt processed | - |
| 401 | Unauthorized - invalid or missing API key | - |
| 403 | Forbidden - missing permissions | - |