Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[NEW] GaussDB for NoSQL #453

Draft
wants to merge 31 commits into
base: devel
Choose a base branch
from
Draft
Changes from 1 commit
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
ShowBackupPolicy
Aloento committed Sep 28, 2022
commit 27d414c5476f521d151693f25820ae39a4a3779d
26 changes: 26 additions & 0 deletions openstack/gaussdbnosql/v3/backup/ShowBackupPolicy.go
Original file line number Diff line number Diff line change
@@ -1 +1,27 @@
package backup

import (
golangsdk "github.com/opentelekomcloud/gophertelekomcloud"
"github.com/opentelekomcloud/gophertelekomcloud/internal/extract"
)

func ShowBackupPolicy(client *golangsdk.ServiceClient, instanceId string) (*ShowBackupPolicyResult, error) {
// GET https://{Endpoint}/v3/{project_id}/instances/{instance_id}/backups/policy
raw, err := client.Get(client.ServiceURL("instances", instanceId, "backups", "policy"), nil, nil)
if err != nil {
return nil, err
}

var res ShowBackupPolicyResult
err = extract.IntoStructPtr(raw.Body, &res, "backup_policy")
return &res, err
}

type ShowBackupPolicyResult struct {
// Backup retention days
KeepDays int32 `json:"keep_days"`
// Backup time window. Automated backups will be triggered during the backup time window.
StartTime string `json:"start_time"`
// Backup cycle configuration. Data will be automatically backed up on the selected days every week.
Period string `json:"period"`
}