api

package
v0.2.1 Latest Latest
Warning

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

Go to latest
Published: Jan 8, 2016 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CancelTask

func CancelTask(id uuid.UUID) error

func DeleteArchive

func DeleteArchive(id uuid.UUID) error

func DeleteJob

func DeleteJob(id uuid.UUID) error

func DeleteRetentionPolicy

func DeleteRetentionPolicy(id uuid.UUID) error

func DeleteSchedule

func DeleteSchedule(id uuid.UUID) error

func DeleteStore

func DeleteStore(id uuid.UUID) error

func DeleteTarget

func DeleteTarget(id uuid.UUID) error

func IsPausedJob

func IsPausedJob(id uuid.UUID) (bool, error)

func PauseJob

func PauseJob(id uuid.UUID) error

func RestoreArchive

func RestoreArchive(id uuid.UUID, targetJSON string) error

func RunJob

func RunJob(id uuid.UUID, ownerJSON string) error

func UnpauseJob

func UnpauseJob(id uuid.UUID) error

Types

type Archive

type Archive struct {
	UUID      string    `json:"uuid"`
	StoreKey  string    `json:"key"`
	TakenAt   Timestamp `json:"taken_at"`
	ExpiresAt Timestamp `json:"expires_at"`
	Status    string    `json:"status"`
	Notes     string    `json:"notes"`

	TargetUUID     string `json:"target_uuid"`
	TargetPlugin   string `json:"target_plugin"`
	TargetEndpoint string `json:"target_endpoint"`
	StoreUUID      string `json:"store_uuid"`
	StorePlugin    string `json:"store_plugin"`
	StoreEndpoint  string `json:"store_endpoint"`
}

func GetArchive

func GetArchive(id uuid.UUID) (Archive, error)

func GetArchives

func GetArchives(filter ArchiveFilter) ([]Archive, error)

func UpdateArchive

func UpdateArchive(id uuid.UUID, contentJSON string) (Archive, error)

type ArchiveFilter

type ArchiveFilter struct {
	Target string
	Store  string
	Before string
	After  string
	Status string
}

type Job

type Job struct {
	UUID           string `json:"uuid"`
	Name           string `json:"name"`
	Summary        string `json:"summary"`
	RetentionName  string `json:"retention_name"`
	RetentionUUID  string `json:"retention_uuid"`
	Expiry         int    `json:"expiry"`
	ScheduleName   string `json:"schedule_name"`
	ScheduleUUID   string `json:"schedule_uuid"`
	Schedule       string `json:"schedule"`
	Paused         bool   `json:"paused"`
	StoreUUID      string `json:"store_uuid"`
	StorePlugin    string `json:"store_plugin"`
	StoreEndpoint  string `json:"store_endpoint"`
	TargetUUID     string `json:"target_uuid"`
	TargetPlugin   string `json:"target_plugin"`
	TargetEndpoint string `json:"target_endpoint"`
	Agent          string `json:"agent"`
}

func CreateJob

func CreateJob(contentJSON string) (Job, error)

func GetJob

func GetJob(id uuid.UUID) (Job, error)

func GetJobs

func GetJobs(filter JobFilter) ([]Job, error)

func UpdateJob

func UpdateJob(id uuid.UUID, contentJSON string) (Job, error)

type JobFilter

type JobFilter struct {
	Target    string
	Store     string
	Schedule  string
	Retention string
	Paused    YesNo
}

type RetentionPoliciesFilter

type RetentionPoliciesFilter struct {
	Unused YesNo
}

type RetentionPolicy

type RetentionPolicy struct {
	UUID    string `json:"uuid"`
	Name    string `json:"name"`
	Summary string `json:"summary"`
	Expires uint   `json:"expires"`
}

func CreateRetentionPolicy

func CreateRetentionPolicy(contentJSON string) (RetentionPolicy, error)

func GetRetentionPolicies

func GetRetentionPolicies(filter RetentionPoliciesFilter) ([]RetentionPolicy, error)

func GetRetentionPolicy

func GetRetentionPolicy(id uuid.UUID) (RetentionPolicy, error)

func UpdateRetentionPolicy

func UpdateRetentionPolicy(id uuid.UUID, contentJSON string) (RetentionPolicy, error)

type Schedule

type Schedule struct {
	UUID    string `json:"uuid"`
	Name    string `json:"name"`
	Summary string `json:"summary"`
	When    string `json:"when"`
}

func CreateSchedule

func CreateSchedule(contentJSON string) (Schedule, error)

func GetSchedule

func GetSchedule(id uuid.UUID) (Schedule, error)

func GetSchedules

func GetSchedules(filter ScheduleFilter) ([]Schedule, error)

func UpdateSchedule

func UpdateSchedule(id uuid.UUID, contentJSON string) (Schedule, error)

type ScheduleFilter

type ScheduleFilter struct {
	Unused YesNo
}

type Store

type Store struct {
	UUID     string `json:"uuid"`
	Name     string `json:"name"`
	Summary  string `json:"summary"`
	Plugin   string `json:"plugin"`
	Endpoint string `json:"endpoint"`
}

func CreateStore

func CreateStore(contentJSON string) (Store, error)

func GetStore

func GetStore(id uuid.UUID) (Store, error)

func GetStores

func GetStores(filter StoreFilter) ([]Store, error)

func UpdateStore

func UpdateStore(id uuid.UUID, contentJSON string) (Store, error)

type StoreFilter

type StoreFilter struct {
	Plugin string
	Unused YesNo
}

type Target

type Target struct {
	UUID     string `json:"uuid"`
	Name     string `json:"name"`
	Summary  string `json:"summary"`
	Plugin   string `json:"plugin"`
	Endpoint string `json:"endpoint"`
	Agent    string `json:"agent"`
}

func CreateTarget

func CreateTarget(contentJSON string) (Target, error)

func GetTarget

func GetTarget(id uuid.UUID) (Target, error)

func GetTargets

func GetTargets(filter TargetFilter) ([]Target, error)

func UpdateTarget

func UpdateTarget(id uuid.UUID, contentJSON string) (Target, error)

type TargetFilter

type TargetFilter struct {
	Plugin string
	Unused YesNo
}

type Task

type Task struct {
	UUID        string    `json:"uuid"`
	Owner       string    `json:"owner"`
	Op          string    `json:"type"`
	JobUUID     string    `json:"job_uuid"`
	ArchiveUUID string    `json:"archive_uuid"`
	Status      string    `json:"status"`
	StartedAt   Timestamp `json:"started_at"`
	StoppedAt   Timestamp `json:"stopped_at"`
	TimeoutAt   Timestamp `json:"timeout_at"`
	Log         string    `json:"log"`
}

func GetTask

func GetTask(id uuid.UUID) (Task, error)

func GetTasks

func GetTasks(filter TaskFilter) ([]Task, error)

type TaskFilter

type TaskFilter struct {
	Status string
	Debug  YesNo
}

type URL

type URL struct {
	// contains filtered or unexported fields
}

func ParseURL

func ParseURL(s string) (*URL, error)

func ShieldURI

func ShieldURI(p string, args ...interface{}) *URL

func (*URL) AddParameter

func (u *URL) AddParameter(key string, value interface{}) error

func (*URL) Delete

func (u *URL) Delete(out interface{}) error

func (*URL) Get

func (u *URL) Get(out interface{}) error

func (*URL) MaybeAddParameter

func (u *URL) MaybeAddParameter(key string, value interface{}) error

func (*URL) Post

func (u *URL) Post(out interface{}, data string) error

func (*URL) Put

func (u *URL) Put(out interface{}, data string) error

func (*URL) Request

func (u *URL) Request(out interface{}, req *http.Request) error

func (*URL) String

func (u *URL) String() string

type YesNo

type YesNo struct {
	On  bool
	Yes bool
}

func Maybe

func Maybe(tf bool) YesNo

func MaybeBools

func MaybeBools(yes bool, no bool) YesNo

func MaybeString

func MaybeString(tf string) YesNo

func No

func No() YesNo

func Yes

func Yes() YesNo

func (*YesNo) Given

func (yn *YesNo) Given() bool

Jump to

Keyboard shortcuts

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