cpmcontainerapi

package
v0.0.0-...-182d01c Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 22, 2016 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Overview

example of calling one of these

request := &cpmcontainerapi.RemovewritefileRequest{"something", "yes"} response, err := cpmcontainerapi.RemoteWritefileClient("http://localhost:10001", request)

Package cpmcontainerapi is the implementation of the CPM container REST API. On each CPM provisioned container, there is a small REST API that runs and is typically invoked by the CPM administrative container, based on user interface driven requests.

Index

Constants

View Source
const PORT = ":10001"

Variables

This section is empty.

Functions

func BadgerGenerate

func BadgerGenerate(w rest.ResponseWriter, r *rest.Request)

BadgerGenerate perform a pgbadger to create the HTML output file

func Basebackup

func Basebackup(w rest.ResponseWriter, r *rest.Request)

Basebackup performs a pg_basebackup

func Controldata

func Controldata(w rest.ResponseWriter, r *rest.Request)

Controldata performs a postgres pg_control

func Failover

func Failover(w rest.ResponseWriter, r *rest.Request)

Failover triggers a postgres failover

func Initdb

func Initdb(w rest.ResponseWriter, r *rest.Request)

Initdb performs a postgresql initdb

func RemoteWritefile

func RemoteWritefile(w rest.ResponseWriter, r *rest.Request)

RemoteWritefile writes a file

func Restore

func Restore(w rest.ResponseWriter, r *rest.Request)

Restore perform a backrest restore

func Seed

func Seed(w rest.ResponseWriter, r *rest.Request)

Seed runs the seed sql script to build the base CPM container objects

func StartPG

func StartPG(w rest.ResponseWriter, r *rest.Request)

StartPG performs a postgres start

func StartPGOnStandby

func StartPGOnStandby(w rest.ResponseWriter, r *rest.Request)

StartPGOnStandby performs a postgres start

func StartPgpool

func StartPgpool(w rest.ResponseWriter, r *rest.Request)

StartPgpool perform a start of pgpool

func Status

func Status(w rest.ResponseWriter, r *rest.Request)

Status a simple ping that lets us know if the container api is running

func StopPG

func StopPG(w rest.ResponseWriter, r *rest.Request)

StopPG performs a postgres stop

func StopPgpool

func StopPgpool(w rest.ResponseWriter, r *rest.Request)

StopPgpool perform a stop of pgpool

Types

type BadgerGenerateRequest

type BadgerGenerateRequest struct {
	ContainerName string
}

type BadgerGenerateResponse

type BadgerGenerateResponse struct {
	Output string
	Status string
}

func BadgerGenerateClient

func BadgerGenerateClient(host string) (BadgerGenerateResponse, error)

BadgerGenerateClient client for invoking pgbadger on a given container

type BasebackupRequest

type BasebackupRequest struct {
	MasterHostName string
	Username       string
	Password       string
}

type BasebackupResponse

type BasebackupResponse struct {
	Output string
	Status string
}

func BasebackupClient

func BasebackupClient(master string, standby string, username string, password string) (BasebackupResponse, error)

BasebackupClient client for performing a base backup on a given container

type ControldataRequest

type ControldataRequest struct {
	Path string
}

type ControldataResponse

type ControldataResponse struct {
	Output string
	Status string
}

func ControldataClient

func ControldataClient(host string) (ControldataResponse, error)

ControldataClient client for invoking pg_control on a given container and returning the results

type FailoverRequest

type FailoverRequest struct {
	ContainerName string
}

type FailoverResponse

type FailoverResponse struct {
	Output string
	Status string
}

func FailoverClient

func FailoverClient(host string) (FailoverResponse, error)

FailoverClient client for triggering a failover on a given container

type InitdbRequest

type InitdbRequest struct {
	ContainerName string
}

type InitdbResponse

type InitdbResponse struct {
	Output string
	Status string
}

func InitdbClient

func InitdbClient(host string) (InitdbResponse, error)

InitdbClient client for invoking initdb on a given container

type RemoteWritefileRequest

type RemoteWritefileRequest struct {
	Path         string
	Filecontents string
}

type RemoteWritefileResponse

type RemoteWritefileResponse struct {
	Status string
}

func RemoteWritefileClient

func RemoteWritefileClient(path string, contents string, ipaddress string) (RemoteWritefileResponse, error)

RemoteWritefileClient client for remotely writing a file to a given container

type RestoreRequest

type RestoreRequest struct {
	ContainerName     string
	RestoreRemotePath string
	RestoreRemoteHost string
	RestoreRemoteUser string
	RestoreDbUser     string
	RestoreDbPass     string
	RestoreSet        string
}

type RestoreResponse

type RestoreResponse struct {
	Output string
	Status string
}

func RestoreClient

func RestoreClient(host string, req *RestoreRequest) (RestoreResponse, error)

RestoreClient client for invoking a backrest restore on a given container

type SeedRequest

type SeedRequest struct {
	ContainerName string
}

type SeedResponse

type SeedResponse struct {
	Output string
	Status string
}

func SeedClient

func SeedClient(host string) (SeedResponse, error)

SeedClient client for performing a database seed on a given container

type StartPGOnStandbyRequest

type StartPGOnStandbyRequest struct {
	ContainerName string
}

type StartPGOnStandbyResponse

type StartPGOnStandbyResponse struct {
	Output string
	Status string
}

func StartPGOnStandbyClient

func StartPGOnStandbyClient(host string) (StartPGOnStandbyResponse, error)

StartPGOnStandbyClient client for starting a database on a given standby container

type StartPGRequest

type StartPGRequest struct {
	ContainerName string
}

type StartPGResponse

type StartPGResponse struct {
	Output string
	Status string
}

func StartPGClient

func StartPGClient(host string) (StartPGResponse, error)

StartPGClient client for starting a database on a given container

type StartPgpoolRequest

type StartPgpoolRequest struct {
	ContainerName string
	Path          string
}

type StartPgpoolResponse

type StartPgpoolResponse struct {
	Output string
	Status string
}

func StartPgpoolClient

func StartPgpoolClient(host string) (StartPgpoolResponse, error)

StartPgpoolClient client for starting a pgpool on a given container

type StatusRequest

type StatusRequest struct {
}

type StatusResponse

type StatusResponse struct {
	Status string
}

func StatusClient

func StatusClient(host string) (StatusResponse, error)

StatusClient client for getting the current database status of a container

type StopPGRequest

type StopPGRequest struct {
	ContainerName string
}

type StopPGResponse

type StopPGResponse struct {
	Output string
	Status string
}

func StopPGClient

func StopPGClient(host string) (StopPGResponse, error)

StopPGClient client for stopping a database on a given container

type StopPgpoolRequest

type StopPgpoolRequest struct {
	ContainerName string
	Path          string
}

type StopPgpoolResponse

type StopPgpoolResponse struct {
	Output string
	Status string
}

func StopPgpoolClient

func StopPgpoolClient(host string) (StopPgpoolResponse, error)

StopPgpoolClient client for stopping pgpool on a given container

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL