GoodMem
ReferenceClient SDKsGo SDK

Administration A P I

Administration A P I documentation for Go 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(ctx).AdminDrainRequest(adminDrainRequest).Execute()

Request the server to enter drain mode

Example

package main

import (
	"context"
	"fmt"
	"os"
	goodmem_client "github.com/PAIR-Systems-Inc/goodmem/clients/go"
)

func main() {
	adminDrainRequest := *goodmem_client.NewAdminDrainRequest() // AdminDrainRequest |  (optional)

	configuration := goodmem_client.NewConfiguration()
	apiClient := goodmem_client.NewAPIClient(configuration)
	resp, r, err := apiClient.AdministrationAPI.DrainServer(context.Background()).AdminDrainRequest(adminDrainRequest).Execute()
	if err != nil {
		fmt.Fprintf(os.Stderr, "Error when calling `AdministrationAPI.DrainServer``: %v\n", err)
		fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
	}
	// response from `DrainServer`: AdminDrainResponse
	fmt.Fprintf(os.Stdout, "Response from `AdministrationAPI.DrainServer`: %v\n", resp)
}

Path Parameters

Other Parameters

Other parameters are passed through a pointer to a apiDrainServerRequest struct via the builder pattern

NameTypeDescriptionNotes
adminDrainRequestAdminDrainRequest

Return type

AdminDrainResponse

Authorization

No authorization required

HTTP request headers

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

↑ Back to Go SDK ↑ Back to Go SDK ↑ Back to Go SDK

PurgeBackgroundJobs

AdminPurgeJobsResponse PurgeBackgroundJobs(ctx).AdminPurgeJobsRequest(adminPurgeJobsRequest).Execute()

Purge completed background jobs

Example

package main

import (
	"context"
	"fmt"
	"os"
	goodmem_client "github.com/PAIR-Systems-Inc/goodmem/clients/go"
)

func main() {
	adminPurgeJobsRequest := *goodmem_client.NewAdminPurgeJobsRequest() // AdminPurgeJobsRequest |  (optional)

	configuration := goodmem_client.NewConfiguration()
	apiClient := goodmem_client.NewAPIClient(configuration)
	resp, r, err := apiClient.AdministrationAPI.PurgeBackgroundJobs(context.Background()).AdminPurgeJobsRequest(adminPurgeJobsRequest).Execute()
	if err != nil {
		fmt.Fprintf(os.Stderr, "Error when calling `AdministrationAPI.PurgeBackgroundJobs``: %v\n", err)
		fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
	}
	// response from `PurgeBackgroundJobs`: AdminPurgeJobsResponse
	fmt.Fprintf(os.Stdout, "Response from `AdministrationAPI.PurgeBackgroundJobs`: %v\n", resp)
}

Path Parameters

Other Parameters

Other parameters are passed through a pointer to a apiPurgeBackgroundJobsRequest struct via the builder pattern

NameTypeDescriptionNotes
adminPurgeJobsRequestAdminPurgeJobsRequest

Return type

AdminPurgeJobsResponse

Authorization

No authorization required

HTTP request headers

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

↑ Back to Go SDK ↑ Back to Go SDK ↑ Back to Go SDK

ReloadLicense

AdminReloadLicenseResponse ReloadLicense(ctx).Execute()

Reload the active license from disk

Example

package main

import (
	"context"
	"fmt"
	"os"
	goodmem_client "github.com/PAIR-Systems-Inc/goodmem/clients/go"
)

func main() {

	configuration := goodmem_client.NewConfiguration()
	apiClient := goodmem_client.NewAPIClient(configuration)
	resp, r, err := apiClient.AdministrationAPI.ReloadLicense(context.Background()).Execute()
	if err != nil {
		fmt.Fprintf(os.Stderr, "Error when calling `AdministrationAPI.ReloadLicense``: %v\n", err)
		fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
	}
	// response from `ReloadLicense`: AdminReloadLicenseResponse
	fmt.Fprintf(os.Stdout, "Response from `AdministrationAPI.ReloadLicense`: %v\n", resp)
}

Path Parameters

This endpoint does not need any parameter.

Other Parameters

Other parameters are passed through a pointer to a apiReloadLicenseRequest struct via the builder pattern

Return type

AdminReloadLicenseResponse

Authorization

No authorization required

HTTP request headers

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

↑ Back to Go SDK ↑ Back to Go SDK ↑ Back to Go SDK