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
- func BadgerGenerate(w rest.ResponseWriter, r *rest.Request)
- func Basebackup(w rest.ResponseWriter, r *rest.Request)
- func Controldata(w rest.ResponseWriter, r *rest.Request)
- func Failover(w rest.ResponseWriter, r *rest.Request)
- func Initdb(w rest.ResponseWriter, r *rest.Request)
- func RemoteWritefile(w rest.ResponseWriter, r *rest.Request)
- func Restore(w rest.ResponseWriter, r *rest.Request)
- func Seed(w rest.ResponseWriter, r *rest.Request)
- func StartPG(w rest.ResponseWriter, r *rest.Request)
- func StartPGOnStandby(w rest.ResponseWriter, r *rest.Request)
- func StartPgpool(w rest.ResponseWriter, r *rest.Request)
- func Status(w rest.ResponseWriter, r *rest.Request)
- func StopPG(w rest.ResponseWriter, r *rest.Request)
- func StopPgpool(w rest.ResponseWriter, r *rest.Request)
- type BadgerGenerateRequest
- type BadgerGenerateResponse
- type BasebackupRequest
- type BasebackupResponse
- type ControldataRequest
- type ControldataResponse
- type FailoverRequest
- type FailoverResponse
- type InitdbRequest
- type InitdbResponse
- type RemoteWritefileRequest
- type RemoteWritefileResponse
- type RestoreRequest
- type RestoreResponse
- type SeedRequest
- type SeedResponse
- type StartPGOnStandbyRequest
- type StartPGOnStandbyResponse
- type StartPGRequest
- type StartPGResponse
- type StartPgpoolRequest
- type StartPgpoolResponse
- type StatusRequest
- type StatusResponse
- type StopPGRequest
- type StopPGResponse
- type StopPgpoolRequest
- type StopPgpoolResponse
Constants ¶
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 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 ¶
func BadgerGenerateClient ¶
func BadgerGenerateClient(host string) (BadgerGenerateResponse, error)
BadgerGenerateClient client for invoking pgbadger on a given container
type BasebackupRequest ¶
type BasebackupResponse ¶
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 ¶
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 ¶
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 ¶
func InitdbClient ¶
func InitdbClient(host string) (InitdbResponse, error)
InitdbClient client for invoking initdb on a given container
type RemoteWritefileRequest ¶
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 RestoreResponse ¶
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 ¶
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 ¶
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 ¶
func StartPGClient ¶
func StartPGClient(host string) (StartPGResponse, error)
StartPGClient client for starting a database on a given container
type StartPgpoolRequest ¶
type StartPgpoolResponse ¶
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 ¶
func StopPGClient ¶
func StopPGClient(host string) (StopPGResponse, error)
StopPGClient client for stopping a database on a given container
type StopPgpoolRequest ¶
type StopPgpoolResponse ¶
func StopPgpoolClient ¶
func StopPgpoolClient(host string) (StopPgpoolResponse, error)
StopPgpoolClient client for stopping pgpool on a given container