requestobjects

package
v1.4.8 Latest Latest
Warning

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

Go to latest
Published: Jul 10, 2024 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ApiError added in v1.4.0

type ApiError struct {
	Code    int    `json:"code"`
	Message string `json:"message"`
}

func (ApiError) Error added in v1.4.0

func (e ApiError) Error() string

type AvailabilityClass added in v1.4.2

type AvailabilityClass string
const (
	A0Invalid    AvailabilityClass = ""
	A1Irrelevant AvailabilityClass = "A1"
	A2Aimed      AvailabilityClass = "A2"
	A3Guaranteed AvailabilityClass = "A3"
	A4Resilient  AvailabilityClass = "A4"
)

func (AvailabilityClass) ValidValues added in v1.4.2

func (AvailabilityClass) ValidValues() []AvailabilityClass

type BackupResponse

type BackupResponse struct {
	ID string `json:"id"`
	CreateRequest

	Status                string                     `json:"status"`
	Sink                  string                     `json:"sink"`
	SinkProject           string                     `json:"sink_project"`
	DataOwner             string                     `json:"data_owner"`
	DataAvailabilityClass provider.AvailabilityClass `json:"data_availability_class"`

	CreatedTimestamp string `json:"created,omitempty"`
	UpdatedTimestamp string `json:"updated,omitempty"`
	DeletedTimestamp string `json:"deleted,omitempty"`

	Jobs      []JobResponse `json:"jobs,omitempty"`
	JobsTotal uint64        `json:"jobs_total,omitempty"`
}

BackupResponse get backup details

type BigQueryOptions

type BigQueryOptions struct {
	Dataset        string   `json:"dataset,omitempty"`
	Table          []string `json:"table,omitempty"`
	ExcludedTables []string `json:"excluded_tables,omitempty"`
}

BigQueryOptions specify backup for a source BigQuery datast or table(s)

type BucketListRequest

type BucketListRequest struct {
	Project string `json:"project"`
}

BucketListRequest request bucket list

type BucketListResponse

type BucketListResponse struct {
	Buckets []string `json:"buckets"`
}

BucketListResponse response for a BucketListRequest request

type CalculateRequest

type CalculateRequest struct {
	CreateRequest
}

CalculateRequest request cost calculation for a backup

type CalculatedResponse

type CalculatedResponse struct {
	Costs []*Cost `json:"costs"`
}

CalculatedResponse response for a CalculateRequest request

type ComplianceCheck added in v1.4.0

type ComplianceCheck struct {
	Field       string `json:"field"`
	Passed      bool   `json:"passed"`
	Description string `json:"description"`
	Details     string `json:"details"`
}

ComplianceCheck response for a ComplianceRequest request

type ComplianceRequest added in v1.4.0

type ComplianceRequest struct {
	CreateRequest
}

ComplianceRequest request compliance check for a backup

type ComplianceResponse added in v1.4.0

type ComplianceResponse struct {
	Checks []ComplianceCheck `json:"checks"`
}

ComplianceResponse response for a ComplianceRequest request

type Cost

type Cost struct {
	Cost        float64 `json:"cost"`
	Currency    string  `json:"currency"`
	Name        string  `json:"name"`
	Period      int64   `json:"period"`
	SizeInBytes int64   `json:"size_in_bytes"`
}

Cost represent backup data price in a given month

type CreateRequest

type CreateRequest struct {
	Type                   string        `json:"type,omitempty"`
	Strategy               string        `json:"strategy,omitempty"`
	Project                string        `json:"project,omitempty"`
	RecoveryPointObjective int           `json:"recovery_point_objective"`
	RecoveryTimeObjective  int           `json:"recovery_time_objective"`
	TargetOptions          TargetOptions `json:"target,omitempty"`

	SnapshotOptions SnapshotOptions `json:"snapshot_options,omitempty"`
	MirrorOptions   MirrorOptions   `json:"mirror_options,omitempty"`
	BigQueryOptions BigQueryOptions `json:"bigquery_options,omitempty"`
	GCSOptions      GCSOptions      `json:"gcs_options,omitempty"`
}

CreateRequest make a new backup

type DatasetListRequest

type DatasetListRequest struct {
	Project string `json:"project"`
}

DatasetListRequest request datasets list

type DatasetListResponse

type DatasetListResponse struct {
	Datasets []string `json:"datasets"`
}

DatasetListResponse response for a BucketListRequest request

type DeleteRequest

type DeleteRequest struct {
	BackupID string
}

DeleteRequest remove bucket an all files within next 60 days

type DeleteResponse

type DeleteResponse struct {
	DeleteRequest

	Status string `json:"status,omitempty"`

	CreatedTimestamp string `json:"created,omitempty"`
	UpdatedTimestamp string `json:"updated,omitempty"`
	DeletedTimestamp string `json:"deleted,omitempty"`
}

DeleteResponse response for a UpdateRequest

type EmptyRequest added in v1.4.0

type EmptyRequest struct {
}

EmptyRequest request without any parameters

type GCSOptions

type GCSOptions struct {
	Bucket      string   `json:"bucket,omitempty"`
	IncludePath []string `json:"include_prefixes,omitempty"`
	ExcludePath []string `json:"exclude_prefixes,omitempty"`
}

GCSOptions specify backup for a source bucket

type GetRequest

type GetRequest struct {
	BackupID string
	Page     Page
}

GetRequest get backup details

type JobResponse

type JobResponse struct {
	ID           string `json:"id"`
	BackupID     string `json:"backup_id"`
	ForeignJobID string `json:"foreign_job_id,omitempty"`

	Status string `json:"status"`
	Source string `json:"source"`

	CreatedTimestamp string `json:"created,omitempty"`
	UpdatedTimestamp string `json:"updated,omitempty"`
	DeletedTimestamp string `json:"deleted,omitempty"`
}

JobResponse get backup job details

type ListRequest

type ListRequest struct {
	Project string
}

ListRequest list backups

type ListingResponse

type ListingResponse struct {
	Backups []BackupResponse `json:"backups"`
}

ListingResponse response for a ListRequest

type MirrorOptions

type MirrorOptions struct {
	LifetimeInDays uint `json:"lifetime_in_days,omitempty"`
}

MirrorOptions specify backup mirror options

type Page

type Page struct {
	Size   int
	Number int
}

Page is used for a subset selection

type ProjectSinkComplianceCheck added in v1.4.1

type ProjectSinkComplianceCheck struct {
	Project   string    `json:"project"`
	Compliant bool      `json:"compliant"`
	Reasons   []string  `json:"reasons"`
	LastCheck time.Time `json:"last_check"`
}

type ProjectSinkComplianceRequest added in v1.4.1

type ProjectSinkComplianceRequest struct {
}

type ProjectSinkComplianceResponse added in v1.4.1

type ProjectSinkComplianceResponse struct {
	Checks []ProjectSinkComplianceCheck `json:"checks"`
}

type RegionsListResponse added in v1.4.0

type RegionsListResponse struct {
	Regions []string `json:"regions"`
}

RegionsListResponse response for a region list request

type RequestType

type RequestType string

RequestType type of a request

const (
	// Creating - create a new backup
	Creating RequestType = "Creating"
	// Getting - get backup information
	Getting RequestType = "Getting"
	// Listing - list backup
	Listing RequestType = "Listing"
	// Updating - change backup
	Updating RequestType = "Updating"
	// Restoring - preapre restore command for a backup
	Restoring RequestType = "Restoring"
	// Calculating - calculate prize for a backup
	Calculating RequestType = "Calculating"
	// Compliance - calculate compliance checks for a backup
	Compliance RequestType = "Compliance"
	// DatasetListing - list datasets avaiable for a User
	DatasetListing RequestType = "DatasetListing"
	// BucketListing - list buckets avaiable for a User
	BucketListing RequestType = "BuckeListing"
	// SourceProjectGet - get Source Project for given project ID
	SourceProjectGet RequestType = "SourceProjectGet"
)

func (RequestType) EqualTo

func (s RequestType) EqualTo(requestType string) bool

EqualTo check if a given string match type

func (RequestType) String

func (s RequestType) String() string

type RestoreAction

type RestoreAction struct {
	Type   string `json:"type"`
	Action string `json:"action"`
}

RestoreAction request instruction for a backup restoration currently only BigQuery is supported

type RestoreRequest

type RestoreRequest struct {
	BackupID          string
	JobIDForTimestamp string
}

RestoreRequest get instruction for a backup restoration only BigQuery is supported

type RestoreResponse

type RestoreResponse struct {
	BackupID       string          `json:"backup_id"`
	RestoreActions []RestoreAction `json:"actions"`
}

RestoreResponse response for a RestoreAction request

type SnapshotOptions

type SnapshotOptions struct {
	LifetimeInDays   uint   `json:"lifetime_in_days,omitempty"`
	FrequencyInHours uint   `json:"frequency_in_hours,omitempty"`
	LastScheduled    string `json:"last_scheduled,omitempty"`
}

SnapshotOptions specify backup snapshot options

type SourceProjectGetRequest added in v1.4.2

type SourceProjectGetRequest struct {
	Project string `json:"project"`
}

SourceProjectGetRequest request source project get

type SourceProjectGetResponse added in v1.4.2

type SourceProjectGetResponse struct {
	SourceProject provider.SourceGCPProject `json:"source_project"`
}

SourceProjectGetResponse response for a SourceProjectGetRequest request

type StorageClassListResponse added in v1.4.0

type StorageClassListResponse struct {
	StorageClasses []string `json:"storage_classes"`
}

StorageClassListResponse response for a storage class list request

type TargetOptions

type TargetOptions struct {
	Region         string `json:"region,omitempty"`
	DualRegion     string `json:"dual_region,omitempty"`
	StorageClass   string `json:"storage_class,omitempty"`
	LifecycleCount uint   `json:"lifecycle_count,omitempty"`
	ArchiveTTM     uint   `json:"archive_ttm"`
}

TargetOptions specify backup sink options

type UpdateRequest

type UpdateRequest struct {
	BackupID               string `json:"backup_id"`
	Status                 string `json:"status,omitempty"`
	MirrorTTL              uint   `json:"mirror_ttl,omitempty"`
	SnapshotTTL            uint   `json:"snapshot_ttl,omitempty"`
	ArchiveTTM             uint   `json:"archive_ttm"`
	RecoveryPointObjective int    `json:"recovery_point_objective,omitempty"`
	RecoveryTimeObjective  int    `json:"recovery_time_objective,omitempty"`
	// only for GCS backups
	IncludePath []string `json:"include_path,omitempty"`
	ExcludePath []string `json:"exclude_path,omitempty"`
	// only for BigQuery backups
	Table          []string `json:"table,omitempty"`
	ExcludedTables []string `json:"excluded_tables,omitempty"`
}

UpdateRequest change backup

type UpdateResponse

type UpdateResponse struct {
	UpdateRequest

	CreatedTimestamp string `json:"created,omitempty"`
	UpdatedTimestamp string `json:"updated,omitempty"`
	DeletedTimestamp string `json:"deleted,omitempty"`
}

UpdateResponse response for a UpdateRequest

Jump to

Keyboard shortcuts

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