Documentation ¶
Overview ¶
Package snapshot is a generated GoMock package.
Index ¶
- Constants
- type GCPSnapClient
- func (gsc *GCPSnapClient) CreateSnapshot(diskName, zone string) (string, error)
- func (gsc *GCPSnapClient) DeleteSnapshot(snapName string) (string, error)
- func (gsc *GCPSnapClient) GetDisksFromDescription(desc *models.Description) ([]compute.Disk, error)
- func (gsc *GCPSnapClient) GetDisksFromLabel(label *models.Label) ([]compute.Disk, error)
- func (gsc *GCPSnapClient) GetGlobalOperationStatus(operation string) (string, error)
- func (gsc *GCPSnapClient) GetZonalOperationStatus(operation, zone string) (string, error)
- func (gsc *GCPSnapClient) ListClientCreatedSnapshots(diskSelfLink string) ([]compute.Snapshot, error)
- func (gsc *GCPSnapClient) ListSnapshots(diskSelfLink string) ([]compute.Snapshot, error)
- type GCPSnapClientInterface
- type MockGCPSnapClientInterface
- func (m *MockGCPSnapClientInterface) CreateSnapshot(diskName, zone string) (string, error)
- func (m *MockGCPSnapClientInterface) DeleteSnapshot(snapName string) (string, error)
- func (m *MockGCPSnapClientInterface) EXPECT() *MockGCPSnapClientInterfaceMockRecorder
- func (m *MockGCPSnapClientInterface) GetDisksFromDescription(label *models.Description) ([]v1.Disk, error)
- func (m *MockGCPSnapClientInterface) GetDisksFromLabel(label *models.Label) ([]v1.Disk, error)
- func (m *MockGCPSnapClientInterface) GetGlobalOperationStatus(operation string) (string, error)
- func (m *MockGCPSnapClientInterface) GetZonalOperationStatus(operation, zone string) (string, error)
- func (m *MockGCPSnapClientInterface) ListClientCreatedSnapshots(diskSelfLink string) ([]v1.Snapshot, error)
- func (m *MockGCPSnapClientInterface) ListSnapshots(diskSelfLink string) ([]v1.Snapshot, error)
- type MockGCPSnapClientInterfaceMockRecorder
- func (mr *MockGCPSnapClientInterfaceMockRecorder) CreateSnapshot(diskName, zone interface{}) *gomock.Call
- func (mr *MockGCPSnapClientInterfaceMockRecorder) DeleteSnapshot(snapName interface{}) *gomock.Call
- func (mr *MockGCPSnapClientInterfaceMockRecorder) GetDisksFromDescription(label interface{}) *gomock.Call
- func (mr *MockGCPSnapClientInterfaceMockRecorder) GetDisksFromLabel(label interface{}) *gomock.Call
- func (mr *MockGCPSnapClientInterfaceMockRecorder) GetGlobalOperationStatus(operation interface{}) *gomock.Call
- func (mr *MockGCPSnapClientInterfaceMockRecorder) GetZonalOperationStatus(operation, zone interface{}) *gomock.Call
- func (mr *MockGCPSnapClientInterfaceMockRecorder) ListClientCreatedSnapshots(diskSelfLink interface{}) *gomock.Call
- func (mr *MockGCPSnapClientInterfaceMockRecorder) ListSnapshots(diskSelfLink interface{}) *gomock.Call
Constants ¶
const ( SnapshotterLabel string = "gcp_disk_snapshotter" SnapshotterLabelValue string = "true" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type GCPSnapClient ¶
type GCPSnapClient struct { Project string Zones []string SnapPrefix string ComputeService compute.Service }
func CreateGCPSnapClient ¶
func CreateGCPSnapClient(project, snapPrefix string, zones []string) *GCPSnapClient
Basic Init function for the snapshotter
func (*GCPSnapClient) CreateSnapshot ¶
func (gsc *GCPSnapClient) CreateSnapshot(diskName, zone string) (string, error)
CreateSnapshot: Gets a disk name and a zone, issues a create snapshot command to api and returns a link to the create snapshot operation
func (*GCPSnapClient) DeleteSnapshot ¶
func (gsc *GCPSnapClient) DeleteSnapshot(snapName string) (string, error)
DeleteSnapshot: Gets a snapshot name and issues a delete. Returns a link to the delete operation
func (*GCPSnapClient) GetDisksFromDescription ¶
func (gsc *GCPSnapClient) GetDisksFromDescription(desc *models.Description) ([]compute.Disk, error)
func (*GCPSnapClient) GetDisksFromLabel ¶
GetDiskList: Returns a list of disks that contain one of the given labels
func (*GCPSnapClient) GetGlobalOperationStatus ¶
func (gsc *GCPSnapClient) GetGlobalOperationStatus(operation string) (string, error)
func (*GCPSnapClient) GetZonalOperationStatus ¶
func (gsc *GCPSnapClient) GetZonalOperationStatus(operation, zone string) (string, error)
func (*GCPSnapClient) ListClientCreatedSnapshots ¶
func (gsc *GCPSnapClient) ListClientCreatedSnapshots(diskSelfLink string) ([]compute.Snapshot, error)
ListClientCreatedSnapshots: Lists snapshots for a given disk that were create by the client, meaning that they have the SnapshotterLabel
func (*GCPSnapClient) ListSnapshots ¶
func (gsc *GCPSnapClient) ListSnapshots(diskSelfLink string) ([]compute.Snapshot, error)
ListSnapshots: Lists Snapshots for a given disk
type GCPSnapClientInterface ¶
type GCPSnapClientInterface interface { GetDisksFromLabel(label *models.Label) ([]compute.Disk, error) GetDisksFromDescription(label *models.Description) ([]compute.Disk, error) ListSnapshots(diskSelfLink string) ([]compute.Snapshot, error) ListClientCreatedSnapshots(diskSelfLink string) ([]compute.Snapshot, error) CreateSnapshot(diskName, zone string) (string, error) DeleteSnapshot(snapName string) (string, error) GetZonalOperationStatus(operation, zone string) (string, error) GetGlobalOperationStatus(operation string) (string, error) }
type MockGCPSnapClientInterface ¶
type MockGCPSnapClientInterface struct {
// contains filtered or unexported fields
}
MockGCPSnapClientInterface is a mock of GCPSnapClientInterface interface
func NewMockGCPSnapClientInterface ¶
func NewMockGCPSnapClientInterface(ctrl *gomock.Controller) *MockGCPSnapClientInterface
NewMockGCPSnapClientInterface creates a new mock instance
func (*MockGCPSnapClientInterface) CreateSnapshot ¶
func (m *MockGCPSnapClientInterface) CreateSnapshot(diskName, zone string) (string, error)
CreateSnapshot mocks base method
func (*MockGCPSnapClientInterface) DeleteSnapshot ¶
func (m *MockGCPSnapClientInterface) DeleteSnapshot(snapName string) (string, error)
DeleteSnapshot mocks base method
func (*MockGCPSnapClientInterface) EXPECT ¶
func (m *MockGCPSnapClientInterface) EXPECT() *MockGCPSnapClientInterfaceMockRecorder
EXPECT returns an object that allows the caller to indicate expected use
func (*MockGCPSnapClientInterface) GetDisksFromDescription ¶
func (m *MockGCPSnapClientInterface) GetDisksFromDescription(label *models.Description) ([]v1.Disk, error)
GetDisksFromDescription mocks base method
func (*MockGCPSnapClientInterface) GetDisksFromLabel ¶
GetDisksFromLabel mocks base method
func (*MockGCPSnapClientInterface) GetGlobalOperationStatus ¶
func (m *MockGCPSnapClientInterface) GetGlobalOperationStatus(operation string) (string, error)
GetGlobalOperationStatus mocks base method
func (*MockGCPSnapClientInterface) GetZonalOperationStatus ¶
func (m *MockGCPSnapClientInterface) GetZonalOperationStatus(operation, zone string) (string, error)
GetZonalOperationStatus mocks base method
func (*MockGCPSnapClientInterface) ListClientCreatedSnapshots ¶
func (m *MockGCPSnapClientInterface) ListClientCreatedSnapshots(diskSelfLink string) ([]v1.Snapshot, error)
ListClientCreatedSnapshots mocks base method
func (*MockGCPSnapClientInterface) ListSnapshots ¶
func (m *MockGCPSnapClientInterface) ListSnapshots(diskSelfLink string) ([]v1.Snapshot, error)
ListSnapshots mocks base method
type MockGCPSnapClientInterfaceMockRecorder ¶
type MockGCPSnapClientInterfaceMockRecorder struct {
// contains filtered or unexported fields
}
MockGCPSnapClientInterfaceMockRecorder is the mock recorder for MockGCPSnapClientInterface
func (*MockGCPSnapClientInterfaceMockRecorder) CreateSnapshot ¶
func (mr *MockGCPSnapClientInterfaceMockRecorder) CreateSnapshot(diskName, zone interface{}) *gomock.Call
CreateSnapshot indicates an expected call of CreateSnapshot
func (*MockGCPSnapClientInterfaceMockRecorder) DeleteSnapshot ¶
func (mr *MockGCPSnapClientInterfaceMockRecorder) DeleteSnapshot(snapName interface{}) *gomock.Call
DeleteSnapshot indicates an expected call of DeleteSnapshot
func (*MockGCPSnapClientInterfaceMockRecorder) GetDisksFromDescription ¶
func (mr *MockGCPSnapClientInterfaceMockRecorder) GetDisksFromDescription(label interface{}) *gomock.Call
GetDisksFromDescription indicates an expected call of GetDisksFromDescription
func (*MockGCPSnapClientInterfaceMockRecorder) GetDisksFromLabel ¶
func (mr *MockGCPSnapClientInterfaceMockRecorder) GetDisksFromLabel(label interface{}) *gomock.Call
GetDisksFromLabel indicates an expected call of GetDisksFromLabel
func (*MockGCPSnapClientInterfaceMockRecorder) GetGlobalOperationStatus ¶
func (mr *MockGCPSnapClientInterfaceMockRecorder) GetGlobalOperationStatus(operation interface{}) *gomock.Call
GetGlobalOperationStatus indicates an expected call of GetGlobalOperationStatus
func (*MockGCPSnapClientInterfaceMockRecorder) GetZonalOperationStatus ¶
func (mr *MockGCPSnapClientInterfaceMockRecorder) GetZonalOperationStatus(operation, zone interface{}) *gomock.Call
GetZonalOperationStatus indicates an expected call of GetZonalOperationStatus
func (*MockGCPSnapClientInterfaceMockRecorder) ListClientCreatedSnapshots ¶
func (mr *MockGCPSnapClientInterfaceMockRecorder) ListClientCreatedSnapshots(diskSelfLink interface{}) *gomock.Call
ListClientCreatedSnapshots indicates an expected call of ListClientCreatedSnapshots
func (*MockGCPSnapClientInterfaceMockRecorder) ListSnapshots ¶
func (mr *MockGCPSnapClientInterfaceMockRecorder) ListSnapshots(diskSelfLink interface{}) *gomock.Call
ListSnapshots indicates an expected call of ListSnapshots