Skip to content

selectel/cloudbackup-go

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Getting started

Installation

You can install needed cloudbackup-go packages via go get command:

go get github.com/selectel/cloudbackup-go

Authentication

To work with the Selectel Cloud Backup API you first need to:

Endpoints

You can find available endpoints here.

Usage example

package main

import (
	"context"
	"fmt"
	"log"

	cloudbackup "github.com/selectel/cloudbackup-go/pkg/v2"
)

func main() {
	// Token to work with Selectel Cloud project.
	token := "gAAAAABeVNzu-..."

	// Cloud backup endpoint to work with.
	endpoint := "https://ru-3.cloud.api.selcloud.ru/data-protect/v2/"

	// Create the client.
	client := cloudbackup.NewClientV2(token,endpoint)

	// Get the plans with the name "plan-name".
	plans, _,err := client.Plans(context.Background(), &cloudbackup.PlansQuery{Name: "plan-name"} )
	if err != nil {
		log.Fatal(err)
	}

	// Print the plans.
	for idx, plan := range plans {
		fmt.Printf("Plan %d: %+v", idx, plan)
	}
}

About

No description, website, or topics provided.

Resources

License

Contributing

Stars

Watchers

Forks

Packages

No packages published

Languages