Administration A P I
Administration A P I documentation for .NET SDK
All URIs are relative to *http://localhost:8080*
| Method | HTTP request | Description |
|---|---|---|
| DrainServer | POST /v1/admin:drain | Request the server to enter drain mode |
| PurgeBackgroundJobs | POST /v1/admin/background-jobs:purge | Purge completed background jobs |
| ReloadLicense | POST /v1/admin/license:reload | Reload the active license from disk |
DrainServer
AdminDrainResponse DrainServer (AdminDrainRequest? adminDrainRequest = null)
Request the server to enter drain mode
Initiates drain mode and optionally waits for the server to quiesce.
Example
using System.Collections.Generic;
using System.Diagnostics;
using System.Net.Http;
using Pairsystems.Goodmem.Client.Api;
using Pairsystems.Goodmem.Client.Client;
using Pairsystems.Goodmem.Client.Model;
namespace Example
{
public class DrainServerExample
{
public static void Main()
{
Configuration config = new Configuration();
config.BasePath = "[http://localhost";](http://localhost";)
// create instances of HttpClient, HttpClientHandler to be reused later with different Api classes
HttpClient httpClient = new HttpClient();
HttpClientHandler httpClientHandler = new HttpClientHandler();
var apiInstance = new AdministrationApi(httpClient, config, httpClientHandler);
var adminDrainRequest = new AdminDrainRequest?(); // AdminDrainRequest? | (optional)
try
{
// Request the server to enter drain mode
AdminDrainResponse result = apiInstance.DrainServer(adminDrainRequest);
Debug.WriteLine(result);
}
catch (ApiException e)
{
Debug.Print("Exception when calling AdministrationApi.DrainServer: " + e.Message);
Debug.Print("Status Code: " + e.ErrorCode);
Debug.Print(e.StackTrace);
}
}
}
}Using the DrainServerWithHttpInfo variant
This returns an ApiResponse object which contains the response data, status code and headers.
try
{
// Request the server to enter drain mode
`ApiResponse<AdminDrainResponse>` response = apiInstance.DrainServerWithHttpInfo(adminDrainRequest);
Debug.Write("Status Code: " + response.StatusCode);
Debug.Write("Response Headers: " + response.Headers);
Debug.Write("Response Body: " + response.Data);
}
catch (ApiException e)
{
Debug.Print("Exception when calling AdministrationApi.DrainServerWithHttpInfo: " + e.Message);
Debug.Print("Status Code: " + e.ErrorCode);
Debug.Print(e.StackTrace);
}Parameters
| Name | Type | Description | Notes |
|---|---|---|---|
| adminDrainRequest | AdminDrainRequest? | [optional] |
Return type
Authorization
No authorization required
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 | - |
PurgeBackgroundJobs
AdminPurgeJobsResponse PurgeBackgroundJobs (AdminPurgeJobsRequest? adminPurgeJobsRequest = null)
Purge completed background jobs
Deletes terminal background jobs older than a retention cutoff.
Example
using System.Collections.Generic;
using System.Diagnostics;
using System.Net.Http;
using Pairsystems.Goodmem.Client.Api;
using Pairsystems.Goodmem.Client.Client;
using Pairsystems.Goodmem.Client.Model;
namespace Example
{
public class PurgeBackgroundJobsExample
{
public static void Main()
{
Configuration config = new Configuration();
config.BasePath = "[http://localhost";](http://localhost";)
// create instances of HttpClient, HttpClientHandler to be reused later with different Api classes
HttpClient httpClient = new HttpClient();
HttpClientHandler httpClientHandler = new HttpClientHandler();
var apiInstance = new AdministrationApi(httpClient, config, httpClientHandler);
var adminPurgeJobsRequest = new AdminPurgeJobsRequest?(); // AdminPurgeJobsRequest? | (optional)
try
{
// Purge completed background jobs
AdminPurgeJobsResponse result = apiInstance.PurgeBackgroundJobs(adminPurgeJobsRequest);
Debug.WriteLine(result);
}
catch (ApiException e)
{
Debug.Print("Exception when calling AdministrationApi.PurgeBackgroundJobs: " + e.Message);
Debug.Print("Status Code: " + e.ErrorCode);
Debug.Print(e.StackTrace);
}
}
}
}Using the PurgeBackgroundJobsWithHttpInfo variant
This returns an ApiResponse object which contains the response data, status code and headers.
try
{
// Purge completed background jobs
`ApiResponse<AdminPurgeJobsResponse>` response = apiInstance.PurgeBackgroundJobsWithHttpInfo(adminPurgeJobsRequest);
Debug.Write("Status Code: " + response.StatusCode);
Debug.Write("Response Headers: " + response.Headers);
Debug.Write("Response Body: " + response.Data);
}
catch (ApiException e)
{
Debug.Print("Exception when calling AdministrationApi.PurgeBackgroundJobsWithHttpInfo: " + e.Message);
Debug.Print("Status Code: " + e.ErrorCode);
Debug.Print(e.StackTrace);
}Parameters
| Name | Type | Description | Notes |
|---|---|---|---|
| adminPurgeJobsRequest | AdminPurgeJobsRequest? | [optional] |
Return type
Authorization
No authorization required
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 | - |
ReloadLicense
AdminReloadLicenseResponse ReloadLicense ()
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
using System.Collections.Generic;
using System.Diagnostics;
using System.Net.Http;
using Pairsystems.Goodmem.Client.Api;
using Pairsystems.Goodmem.Client.Client;
using Pairsystems.Goodmem.Client.Model;
namespace Example
{
public class ReloadLicenseExample
{
public static void Main()
{
Configuration config = new Configuration();
config.BasePath = "[http://localhost";](http://localhost";)
// create instances of HttpClient, HttpClientHandler to be reused later with different Api classes
HttpClient httpClient = new HttpClient();
HttpClientHandler httpClientHandler = new HttpClientHandler();
var apiInstance = new AdministrationApi(httpClient, config, httpClientHandler);
try
{
// Reload the active license from disk
AdminReloadLicenseResponse result = apiInstance.ReloadLicense();
Debug.WriteLine(result);
}
catch (ApiException e)
{
Debug.Print("Exception when calling AdministrationApi.ReloadLicense: " + e.Message);
Debug.Print("Status Code: " + e.ErrorCode);
Debug.Print(e.StackTrace);
}
}
}
}Using the ReloadLicenseWithHttpInfo variant
This returns an ApiResponse object which contains the response data, status code and headers.
try
{
// Reload the active license from disk
`ApiResponse<AdminReloadLicenseResponse>` response = apiInstance.ReloadLicenseWithHttpInfo();
Debug.Write("Status Code: " + response.StatusCode);
Debug.Write("Response Headers: " + response.Headers);
Debug.Write("Response Body: " + response.Data);
}
catch (ApiException e)
{
Debug.Print("Exception when calling AdministrationApi.ReloadLicenseWithHttpInfo: " + e.Message);
Debug.Print("Status Code: " + e.ErrorCode);
Debug.Print(e.StackTrace);
}Parameters
This endpoint does not need any parameter.
Return type
Authorization
No authorization required
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 | - |