Documentation
¶
Overview ¶
This package provides a high-level interface to the NetApp GCP Cloud Volumes NFS REST API.
Index ¶
- Constants
- func GCPAPIServiceLevelFromUserServiceLevel(userServiceLevel string) string
- func IsValidUserServiceLevel(userServiceLevel string) bool
- func UserServiceLevelFromAPIServiceLevel(apiServiceLevel string) string
- type BackupPolicy
- type CallResponseError
- type Client
- func (d *Client) CreateSnapshot(request *SnapshotCreateRequest) error
- func (d *Client) CreateVolume(request *VolumeCreateRequest) error
- func (d *Client) DeleteSnapshot(volume *Volume, snapshot *Snapshot) error
- func (d *Client) DeleteVolume(volume *Volume) error
- func (d *Client) GetServiceLevels() (map[string]string, error)
- func (d *Client) GetSnapshotByID(snapshotId string) (*Snapshot, error)
- func (d *Client) GetSnapshotForVolume(volume *Volume, snapshotName string) (*Snapshot, error)
- func (d *Client) GetSnapshotsForVolume(volume *Volume) (*[]Snapshot, error)
- func (d *Client) GetVersion() (*utils.Version, *utils.Version, error)
- func (d *Client) GetVolumeByCreationToken(creationToken string) (*Volume, error)
- func (d *Client) GetVolumeByID(volumeId string) (*Volume, error)
- func (d *Client) GetVolumeByName(name string) (*Volume, error)
- func (d *Client) GetVolumes() (*[]Volume, error)
- func (d *Client) InvokeAPI(requestBody []byte, method string, gcpURL string) (*http.Response, []byte, error)
- func (d *Client) RelabelVolume(volume *Volume, labels []string) (*Volume, error)
- func (d *Client) RenameRelabelVolume(volume *Volume, newName string, labels []string) (*Volume, error)
- func (d *Client) RenameVolume(volume *Volume, newName string) (*Volume, error)
- func (d *Client) ResizeVolume(volume *Volume, newSizeBytes int64) (*Volume, error)
- func (d *Client) RestoreSnapshot(volume *Volume, snapshot *Snapshot) error
- func (d *Client) VolumeExistsByCreationToken(creationToken string) (bool, *Volume, error)
- func (d *Client) WaitForSnapshotState(snapshot *Snapshot, desiredState string, abortStates []string) error
- func (d *Client) WaitForVolumeState(volume *Volume, desiredState string, abortStates []string) error
- type ClientConfig
- type DailySchedule
- type Error
- type ExportPolicy
- type ExportRule
- type HourlySchedule
- type Job
- type MonthlySchedule
- type MountPoint
- type ServiceLevel
- type ServiceLevelsResponse
- type Snapshot
- type SnapshotCreateRequest
- type SnapshotPolicy
- type SnapshotRevertRequest
- type TerminalStateError
- type VersionResponse
- type Volume
- type VolumeCreateRequest
- type VolumeRenameRelabelRequest
- type VolumeRenameRequest
- type VolumeResizeRequest
- type WeeklySchedule
Constants ¶
View Source
const ( StateCreating = "creating" StateAvailable = "available" StateUpdating = "updating" StateDisabled = "disabled" StateDeleting = "deleting" StateDeleted = "deleted" StateError = "error" ProtocolTypeNFSv3 = "NFSv3" ProtocolTypeNFSv4 = "NFSv4" ProtocolTypeCIFS = "CIFS" APIServiceLevel1 = "low" APIServiceLevel2 = "medium" APIServiceLevel3 = "high" UserServiceLevel1 = "standard" UserServiceLevel2 = "premium" UserServiceLevel3 = "extreme" AccessReadOnly = "ReadOnly" AccessReadWrite = "ReadWrite" )
Variables ¶
This section is empty.
Functions ¶
func IsValidUserServiceLevel ¶
Types ¶
type BackupPolicy ¶
type CallResponseError ¶
CallResponseError is used for errors on RESTful calls to return what went wrong
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
func NewDriver ¶
func NewDriver(config ClientConfig) *Client
NewDriver is a factory method for creating a new instance.
func (*Client) CreateSnapshot ¶
func (d *Client) CreateSnapshot(request *SnapshotCreateRequest) error
func (*Client) CreateVolume ¶
func (d *Client) CreateVolume(request *VolumeCreateRequest) error
func (*Client) DeleteSnapshot ¶
func (*Client) DeleteVolume ¶
func (*Client) GetSnapshotByID ¶
func (*Client) GetSnapshotForVolume ¶
func (*Client) GetSnapshotsForVolume ¶
func (*Client) GetVolumeByCreationToken ¶
func (*Client) GetVolumes ¶
func (*Client) InvokeAPI ¶
func (d *Client) InvokeAPI(requestBody []byte, method string, gcpURL string) (*http.Response, []byte, error)
InvokeAPI makes a REST call to the cloud volumes REST service. The body must be a marshaled JSON byte array (or nil). The method is the HTTP verb (i.e. GET, POST, ...).
func (*Client) RelabelVolume ¶
func (*Client) RenameRelabelVolume ¶
func (*Client) RenameVolume ¶
func (*Client) ResizeVolume ¶
func (*Client) RestoreSnapshot ¶
func (*Client) VolumeExistsByCreationToken ¶
func (*Client) WaitForSnapshotState ¶
type ClientConfig ¶
type ClientConfig struct {
// GCP project number
ProjectNumber string
// GCP CVS API authentication parameters
APIKey drivers.GCPPrivateKey
// GCP region
APIRegion string
// URL for accessing the API via an HTTP/HTTPS proxy
ProxyURL string
// Options
DebugTraceFlags map[string]bool
}
ClientConfig holds configuration data for the API driver object.
type DailySchedule ¶
type ExportPolicy ¶
type ExportPolicy struct {
Rules []ExportRule `json:"rules"`
}
type ExportRule ¶
type HourlySchedule ¶
type MonthlySchedule ¶
type MountPoint ¶
type ServiceLevel ¶
type ServiceLevelsResponse ¶
type ServiceLevelsResponse []ServiceLevel
type Snapshot ¶
type Snapshot struct {
Created time.Time `json:"created"`
VolumeID string `json:"volumeId"`
LifeCycleState string `json:"lifeCycleState"`
LifeCycleStateDetails string `json:"lifeCycleStateDetails"`
Name string `json:"name"`
OwnerID string `json:"ownerId"`
Region string `json:"region"`
SnapshotID string `json:"snapshotId"`
UsedBytes int `json:"usedBytes"`
}
type SnapshotCreateRequest ¶
type SnapshotPolicy ¶
type SnapshotPolicy struct {
DailySchedule DailySchedule `json:"dailySchedule"`
Enabled bool `json:"enabled"`
HourlySchedule HourlySchedule `json:"hourlySchedule"`
MonthlySchedule MonthlySchedule `json:"monthlySchedule"`
WeeklySchedule WeeklySchedule `json:"weeklySchedule"`
}
type SnapshotRevertRequest ¶
type TerminalStateError ¶
type TerminalStateError struct {
Err error
}
TerminalStateError signals that the object is in a terminal state. This is used to stop waiting on an object to change state.
func TerminalState ¶
func TerminalState(err error) *TerminalStateError
TerminalState wraps the given err in a *TerminalStateError.
func (*TerminalStateError) Error ¶
func (e *TerminalStateError) Error() string
type VersionResponse ¶
type Volume ¶
type Volume struct {
Created time.Time `json:"created"`
LifeCycleState string `json:"lifeCycleState"`
LifeCycleStateDetails string `json:"lifeCycleStateDetails"`
Name string `json:"name"`
OwnerID string `json:"ownerId"`
Region string `json:"region"`
VolumeID string `json:"volumeId"`
CreationToken string `json:"creationToken"`
ExportPolicy ExportPolicy `json:"exportPolicy"`
Jobs []Job `json:"jobs"`
Labels []string `json:"labels"`
MountPoints []MountPoint `json:"mountPoints"`
ProtocolTypes []string `json:"protocolTypes"`
QuotaInBytes int64 `json:"quotaInBytes"`
SecurityStyle string `json:"securityStyle"`
ServiceLevel string `json:"serviceLevel"`
SnapReserve int64 `json:"snapReserve"`
SnapshotDirectory bool `json:"snapshotDirectory"`
SnapshotPolicy SnapshotPolicy `json:"snapshotPolicy"`
Timezone string `json:"timezone,omitempty"`
UsedBytes int `json:"usedBytes"`
}
type VolumeCreateRequest ¶
type VolumeCreateRequest struct {
Name string `json:"name"`
Region string `json:"region"`
BackupPolicy *BackupPolicy `json:"backupPolicy,omitempty"`
CreationToken string `json:"creationToken"`
ExportPolicy ExportPolicy `json:"exportPolicy,omitempty"`
Jobs []Job `json:"jobs,omitempty"`
Labels []string `json:"labels,omitempty"`
ProtocolTypes []string `json:"protocolTypes"`
QuotaInBytes int64 `json:"quotaInBytes"`
SecurityStyle string `json:"securityStyle"`
ServiceLevel string `json:"serviceLevel"`
SnapReserve *int64 `json:"snapReserve,omitempty"`
SnapshotDirectory bool `json:"snapshotDirectory"`
SnapshotPolicy SnapshotPolicy `json:"snapshotPolicy,omitempty"`
Timezone string `json:"timezone,omitempty"`
VendorID string `json:"vendorID,omitempty"`
BackupID string `json:"backupId,omitempty"`
Network string `json:"network,omitempty"`
SnapshotID string `json:"snapshotId,omitempty"`
}
type VolumeRenameRequest ¶
type VolumeResizeRequest ¶
Click to show internal directories.
Click to hide internal directories.