GoodMem
ReferenceClient SDKs.NET SDK

Administration A P I

Administration A P I documentation for .NET SDK

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

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

NameTypeDescriptionNotes
adminDrainRequestAdminDrainRequest?[optional]

Return type

AdminDrainResponse

Authorization

No authorization required

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 .NET SDK

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

NameTypeDescriptionNotes
adminPurgeJobsRequestAdminPurgeJobsRequest?[optional]

Return type

AdminPurgeJobsResponse

Authorization

No authorization required

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 .NET SDK

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

AdminReloadLicenseResponse

Authorization

No authorization required

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 .NET SDK