Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func IsFinalState ¶
IsFinalState checks whether backup job has successfully run.
Types ¶
type BackupStats ¶
type BackupStats struct { // SizeInMB represents backup size in megabytes. SizeInMB float64 `json:"sizeInMb"` // Items is the number of items saved during the backup. Items int64 `json:"items"` // Mutations is the number of mutations saved during the backup. Mutations int64 `json:"mutations"` // Tombstones is the number of tombstones saved during the backup. Tombstones int64 `json:"tombstones"` // GSI is the number of global secondary indexes saved during the backup. GSI int64 `json:"gsi"` // FTS is the number of full text search entities saved during the backup. FTS int64 `json:"fts"` // CBAS is the number of analytics entities saved during the backup. CBAS int64 `json:"cbas"` // Event represents the number of event entities saved during the backup. Event int64 `json:"event"` }
BackupStats represents various backup level data that couchbase provides.
type CreateBackupRequest ¶
type CreateBackupRequest struct{}
CreateBackupRequest is the request payload sent to the Capella V4 Public API in order to create a new backup.
Couchbase supports a robust scheduled backup and retention time policy as part of an overall disaster recovery plan for production data. Couchbase Capella supports scheduled and on-demand backups of bucket data. A backup can be restored to the same database where it was created or another database in the same organization. An on-demand backup of a bucket is always a Full backup. Capella schedules on-demand backup to start immediately. On setting up a backup schedule, the bucket automatically backs up the bucket based on the chosen schedule.
To learn more about backup and restore, see https://docs.couchbase.com/cloud/clusters/backup-restore.html
In order to access this endpoint, the provided API key must have at least one of the following roles: Organization Owner Project Owner To learn more, see https://docs.couchbase.com/cloud/organizations/organization-projects-overview.html
type CreateRestoreRequest ¶
type CreateRestoreRequest struct { Services *[]Service `json:"services"` FilterKeys string `json:"filterKeys"` BackupId string `json:"backupID"` SourceClusterId string `json:"sourceClusterID"` TargetClusterId string `json:"targetClusterID"` FilterValues string `json:"filterValues"` IncludeData string `json:"includeData"` ExcludeData string `json:"excludeData"` MapData string `json:"mapData"` ReplaceTTL string `json:"replaceTTL"` ReplaceTTLWith string `json:"replaceTTLWith"` ForceUpdates bool `json:"forceUpdates"` AutoRemoveCollections bool `json:"autoRemoveCollections"` }
type GetBackupResponse ¶
type GetBackupResponse struct { // BackupStats represents various backup level data that couchbase provides. BackupStats *BackupStats `json:"stats"` // ScheduleInfo represents the schedule information of the backup. ScheduleInfo *ScheduleInfo `json:"scheduleInfo"` // Method represents the mechanism of the backup. // Enum: "incremental" "full" // Incremental backups include the data that has changed since the last scheduled backup. // Full backup includes all bucket data from the time the backup was created. Method string `json:"method"` // BucketName represents the name of the bucket to which the backup belongs to. BucketName string `json:"bucketName"` // CycleId is the cycleId to the which the backup belongs to. CycleId string `json:"cycleID"` // Date represents the time at which backup was created. Date string `json:"date"` // RestoreBefore represents the time at which backup will expire. RestoreBefore string `json:"restoreBefore"` // Status represents the status of the backup. // Enum: "pending" "ready" "failed" Status State `json:"status"` // Id is a GUID4 identifier of the backup. Id string `json:"id"` // ClusterId is the clusterId of the capella tenant. ClusterId string `json:"clusterID"` // BucketId is the ID of the bucket to which the backup belongs to. BucketId string `json:"bucketID"` // Source represents the way a backup job was initiated. // Enum: "manual" "scheduled" // Manual represents a manually triggered backup job or on-demand. // Scheduled represents a backup job created from a schedule. Source string `json:"source"` // CloudProvider is the cloud provider where the cluster is hosted. CloudProvider string `json:"provider"` // ProjectId is the projectId of the capella tenant. ProjectId string `json:"projectID"` // OrganizationId is the organizationId of the capella tenant. OrganizationId string `json:"organizationID"` // ElapsedTimeInSeconds represents the amount of seconds that have elapsed between the creation and completion of the backup. ElapsedTimeInSeconds int64 `json:"elapsedTimeInSeconds"` }
GetBackupResponse is the response received from the Capella V4 Public API when asked to fetch details of an existing backup.
To learn more about backup and restore, see https://docs.couchbase.com/cloud/clusters/backup-restore.html
In order to access this endpoint, the provided API key must have at least one of the following roles:
Organization Owner Project Owner To learn more, see https://docs.couchbase.com/cloud/organizations/organization-projects-overview.html
type GetBackupsResponse ¶
type GetBackupsResponse struct {
Data []GetBackupResponse `json:"data"`
}
GetBackupsResponse is the response received from the Capella V4 Public API when asked to list all backups.
In order to access this endpoint, the provided API key must have at least one of the following roles:
Organization Owner Project Owner To learn more, see https://docs.couchbase.com/cloud/organizations/organization-projects-overview.html
type GetCycleResponse ¶
type GetCycleResponse struct { // CycleId is the cycleId to the which the backup belongs to. CycleId string `json:"cycleID"` }
GetCycleResponse is the response received from the Capella V4 Public API when asked to fetch details of an existing cycle.
To learn more about backup and restore, see https://docs.couchbase.com/cloud/clusters/backup-restore.html
In order to access this endpoint, the provided API key must have at least one of the following roles:
Organization Owner Project Owner To learn more, see https://docs.couchbase.com/cloud/organizations/organization-projects-overview.html
type GetCyclesResponse ¶
type GetCyclesResponse struct {
Data []GetCycleResponse `json:"data"`
}
GetCyclesResponse is the response received from the Capella V4 Public API when asked to list all cycles for a bucket in a cluster.
To learn more about backup and restore, see https://docs.couchbase.com/cloud/clusters/backup-restore.html
In order to access this endpoint, the provided API key must have at least one of the following roles:
Organization Owner Project Owner To learn more, see https://docs.couchbase.com/cloud/organizations/organization-projects-overview.html
type ScheduleInfo ¶
type ScheduleInfo struct { // BackupType represents whether the backup is a Weekly or Daily backup. BackupType string `json:"backupType"` // BackupTime is the timestamp indicating the backup created time. BackupTime string `json:"backupTime"` // Retention represents retention time in days. Retention string `json:"retention"` // Increment represents interval in hours for incremental backup. Increment int64 `json:"increment"` }
ScheduleInfo represents the schedule information of the backup.
type State ¶
type State string
State is the state that a backup can have based on the fact if backup job has run successfully or not.
const ( // Pending communicates that a backup record has been created but the // backup job has not yet run. This happens when dp-backup first // communicates the intent to start a backup to the internal api, which // results in a backup record created in pending status. Pending State = "pending" // Ready represents a backup record that has had its backup job run successfully. Ready State = "ready" // Failed represents a backup record that has had its backup job fail. Failed State = "failed" )