snapshot

package
v1.1.3 Latest Latest
Warning

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

Go to latest
Published: Sep 25, 2021 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Service

type Service interface {
	List(ctx context.Context, filter *string) (*Snapshots, error)
	Close() error
}

Service implements the snapshot service

func New

func New(ctx context.Context, project string, options []*option.ClientOption) (Service, error)

New creates a new snapshot service

type Snapshot

type Snapshot struct {
	*computepb.Snapshot
}

Snapshot holds the snapshot struct

func (*Snapshot) GetSnapshotCost added in v1.1.0

func (s *Snapshot) GetSnapshotCost(skus *billingsku.BillingSKUs) float64

GetSnapshotCost returns the monthly cost for the snapshot

func (*Snapshot) GetSnapshotCreated added in v1.1.0

func (s *Snapshot) GetSnapshotCreated() string

GetSnapshotCreated returns created timestamp in pretty format

func (*Snapshot) GetSnapshotSource added in v1.1.0

func (s *Snapshot) GetSnapshotSource() string

GetSnapshotSource returns source disk name

type Snapshots

type Snapshots []*Snapshot

Snapshots holds the snapshots struct

func (Snapshots) GetCount

func (s Snapshots) GetCount() int

GetCount returns the amount of snapshots

func (Snapshots) GetSnapshotsCost added in v1.1.0

func (s Snapshots) GetSnapshotsCost(skus *billingsku.BillingSKUs) float64

GetSnapshotsCost returns the sum cost of all the snapshots

func (*Snapshots) GetStale added in v1.1.3

func (s *Snapshots) GetStale(created int) (*Snapshots, error)

GetStale returns a slice of stale Snapshots

Jump to

Keyboard shortcuts

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