GoodMem
ReferenceClient SDKsPython SDK

Administration API

Administration API documentation for Python SDK

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

MethodHTTP requestDescription
drain_serverPOST /v1/admin:drainRequest the server to enter drain mode
purge_background_jobsPOST /v1/admin/background-jobs:purgePurge completed background jobs
reload_licensePOST /v1/admin/license:reloadReload 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

NameTypeDescriptionNotes
admin_drain_requestAdminDrainRequest[optional]

Return type

AdminDrainResponse

Authorization

ApiKeyAuth

HTTP request headers

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

HTTP response details

Status codeDescriptionResponse headers
200Drain request acknowledged-
401Unauthorized - invalid or missing API key-
403Forbidden - missing permissions-

↑ Back to Python SDK

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

NameTypeDescriptionNotes
admin_purge_jobs_requestAdminPurgeJobsRequest[optional]

Return type

AdminPurgeJobsResponse

Authorization

ApiKeyAuth

HTTP request headers

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

HTTP response details

Status codeDescriptionResponse headers
200Purge completed-
400Invalid request payload-
401Unauthorized - invalid or missing API key-
403Forbidden - missing permissions-

↑ Back to Python SDK

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

AdminReloadLicenseResponse

Authorization

ApiKeyAuth

HTTP request headers

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

HTTP response details

Status codeDescriptionResponse headers
200License reload attempt processed-
401Unauthorized - invalid or missing API key-
403Forbidden - missing permissions-

↑ Back to Python SDK