ontap

package
v17.10.2+incompatible Latest Latest
Warning

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

Go to latest
Published: Jan 23, 2018 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	MINIMUM_ONTAPI_VERSION   ontapApiFeature = "MINIMUM_ONTAPI_VERSION"
	VSERVER_SHOW_AGGR        ontapApiFeature = "VSERVER_SHOW_AGGR"
	NETAPP_VOLUME_ENCRYPTION ontapApiFeature = "NETAPP_VOLUME_ENCRYPTION"
)

Define new version-specific feature constants here

Variables

This section is empty.

Functions

func GetError

func GetError(zapiResult interface{}, errorIn error) (errorOut error)

GetError accepts both an error and the Response value from an AZGO invocation. If error is non-nil, it is returned as is. Otherwise, the Response value is probed for an error returned by ZAPI; if one is found, a ZapiError error object is returned. If no failures are detected, the method returns nil. The interface passed in may either be a Response object, or the always-embedded Result object where the error info exists.

Types

type Driver

type Driver struct {
	// contains filtered or unexported fields
}

Driver is the object to use for interacting with the Filer

func NewDriver

func NewDriver(config DriverConfig) *Driver

NewDriver is a factory method for creating a new instance

func (Driver) AggrGetIterRequest

func (d Driver) AggrGetIterRequest() (response azgo.AggrGetIterResponse, err error)

AggrGetIterRequest returns the aggregates on the system equivalent to filer::> storage aggregate show

func (Driver) EmsAutosupportLog

func (d Driver) EmsAutosupportLog(
	appVersion string,
	autoSupport bool,
	category string,
	computerName string,
	eventDescription string,
	eventID int,
	eventSource string,
	logLevel int) (response azgo.EmsAutosupportLogResponse, err error)

EmsAutosupportLog generates an auto support message with the supplied parameters

func (Driver) ExportPolicyCreate

func (d Driver) ExportPolicyCreate(policy string) (response azgo.ExportPolicyCreateResponse, err error)

ExportPolicyCreate creates an export policy equivalent to filer::> vserver export-policy create

func (Driver) ExportRuleCreate

func (d Driver) ExportRuleCreate(
	policy, clientMatch string,
	protocols, roSecFlavors, rwSecFlavors, suSecFlavors []string,
) (response azgo.ExportRuleCreateResponse, err error)

ExportRuleCreate creates a rule in an export policy equivalent to filer::> vserver export-policy rule create

func (Driver) ExportRuleGetIterRequest

func (d Driver) ExportRuleGetIterRequest(policy string) (response azgo.ExportRuleGetIterResponse, err error)

ExportRuleGetIterRequest returns the export rules in an export policy equivalent to filer::> vserver export-policy rule show

func (Driver) GetClonedZapiRunner

func (d Driver) GetClonedZapiRunner() *azgo.ZapiRunner

GetClonedZapiRunner returns a clone of the ZapiRunner configured on this driver.

func (Driver) GetNontunneledZapiRunner

func (d Driver) GetNontunneledZapiRunner() *azgo.ZapiRunner

GetNontunneledZapiRunner returns a clone of the ZapiRunner configured on this driver with the SVM field cleared so ZAPI calls made with the resulting runner aren't tunneled. Note that the calls could still go directly to either a cluster or vserver management LIF.

func (Driver) GetVserverAggregateNames

func (d Driver) GetVserverAggregateNames() ([]string, error)

GetVserverAggregateNames returns an array of names of the aggregates assigned to the configured vserver. The vserver-get-iter API works with either cluster or vserver scope, so the ZAPI runner may or may not be configured for tunneling; using the query parameter ensures we address only the configured vserver.

func (Driver) IgroupAdd

func (d Driver) IgroupAdd(initiatorGroupName, initiator string) (response azgo.IgroupAddResponse, err error)

IgroupAdd adds an initiator to an initiator group equivalent to filer::> igroup add -vserver iscsi_vs -igroup docker -initiator iqn.1993-08.org.debian:01:9031309bbebd

func (Driver) IgroupCreate

func (d Driver) IgroupCreate(initiatorGroupName, initiatorGroupType, osType string) (response azgo.IgroupCreateResponse, err error)

IgroupCreate creates the specified initiator group equivalent to filer::> igroup create docker -vserver iscsi_vs -protocol iscsi -ostype linux

func (Driver) IgroupDestroy

func (d Driver) IgroupDestroy(initiatorGroupName string) (response azgo.IgroupDestroyResponse, err error)

IgroupDestroy destroys an initiator group

func (Driver) IgroupList added in v1.3.1

func (d Driver) IgroupList() (response azgo.IgroupGetIterResponse, err error)

IgroupList lists initiator groups

func (Driver) IgroupRemove

func (d Driver) IgroupRemove(initiatorGroupName, initiator string, force bool) (response azgo.IgroupRemoveResponse, err error)

IgroupRemove removes an initiator from an initiator group

func (Driver) IscsiServiceGetIterRequest added in v1.3.1

func (d Driver) IscsiServiceGetIterRequest() (response azgo.IscsiServiceGetIterResponse, err error)

IscsiServiceGetIterRequest returns information about an iSCSI target

func (Driver) ListNodeSerialNumbers

func (d Driver) ListNodeSerialNumbers() ([]string, error)

func (Driver) LunCreate

func (d Driver) LunCreate(lunPath string, sizeInBytes int, osType string, spaceReserved bool) (response azgo.LunCreateBySizeResponse, err error)

LunCreate creates a lun with the specified attributes equivalent to filer::> lun create -vserver iscsi_vs -path /vol/v/lun1 -size 1g -ostype linux -space-reserve disabled

func (Driver) LunDestroy

func (d Driver) LunDestroy(lunPath string) (response azgo.LunDestroyResponse, err error)

LunDestroy destroys a lun equivalent to filer::> lun destroy -vserver iscsi_vs -path /vol/v/lun0

func (Driver) LunGetAttribute

func (d Driver) LunGetAttribute(lunPath, name string) (response azgo.LunGetAttributeResponse, err error)

LunGetAttribute gets a named attribute for a given LUN.

func (Driver) LunGetSerialNumber

func (d Driver) LunGetSerialNumber(lunPath string) (response azgo.LunGetSerialNumberResponse, err error)

LunGetSerialNumber returns the serial# for a lun

func (Driver) LunMap

func (d Driver) LunMap(initiatorGroupName, lunPath string, lunID int) (response azgo.LunMapResponse, err error)

LunMap maps a lun to an id in an initiator group equivalent to filer::> lun map -vserver iscsi_vs -path /vol/v/lun1 -igroup docker -lun-id 0

func (Driver) LunMapAutoID

func (d Driver) LunMapAutoID(initiatorGroupName, lunPath string) (response azgo.LunMapResponse, err error)

LunMap maps a LUN in an initiator group, allowing ONTAP to choose an available LUN ID equivalent to filer::> lun map -vserver iscsi_vs -path /vol/v/lun1 -igroup docker

func (Driver) LunMapIfNotMapped

func (d Driver) LunMapIfNotMapped(initiatorGroupName, lunPath string) (int, error)

func (Driver) LunMapListInfo

func (d Driver) LunMapListInfo(lunPath string) (response azgo.LunMapListInfoResponse, err error)

LunMapListInfo returns lun mapping information for the specified lun equivalent to filer::> lun mapped show -vserver iscsi_vs -path /vol/v/lun0

func (Driver) LunOffline

func (d Driver) LunOffline(lunPath string) (response azgo.LunOfflineResponse, err error)

LunOffline offlines a lun equivalent to filer::> lun offline -vserver iscsi_vs -path /vol/v/lun0

func (Driver) LunOnline

func (d Driver) LunOnline(lunPath string) (response azgo.LunOnlineResponse, err error)

LunOnline onlines a lun equivalent to filer::> lun online -vserver iscsi_vs -path /vol/v/lun0

func (Driver) LunSetAttribute

func (d Driver) LunSetAttribute(lunPath, name, value string) (response azgo.LunSetAttributeResponse, err error)

LunSetAttribute sets a named attribute for a given LUN.

func (Driver) NetInterfaceGet

func (d Driver) NetInterfaceGet() (response azgo.NetInterfaceGetIterResponse, err error)

NetInterfaceGet returns the list of network interfaces with associated metadata equivalent to filer::> net interface list

func (Driver) QtreeCount

func (d Driver) QtreeCount(volume string) (int, error)

QtreeCount returns the number of Qtrees in the specified Flexvol, not including the Flexvol itself

func (Driver) QtreeCreate

func (d Driver) QtreeCreate(name, volumeName, unixPermissions, exportPolicy, securityStyle string) (response azgo.QtreeCreateResponse, err error)

QtreeCreate creates a qtree with the specified options equivalent to filer::> qtree create -vserver ndvp_vs -volume v -qtree q -export-policy default -unix-permissions ---rwxr-xr-x -security-style unix

func (Driver) QtreeDestroyAsync

func (d Driver) QtreeDestroyAsync(path string, force bool) (response azgo.QtreeDeleteAsyncResponse, err error)

QtreeDestroy destroys a qtree in the background equivalent to filer::> volume qtree delete -foreground false

func (Driver) QtreeExists

func (d Driver) QtreeExists(name, volumePrefix string) (bool, string, error)

QtreeExists returns true if the named Qtree exists (and is unique in the matching Flexvols)

func (Driver) QtreeList

func (d Driver) QtreeList(prefix, volumePrefix string) (response azgo.QtreeListIterResponse, err error)

QtreeList returns the names of all Qtrees whose names match the supplied prefix equivalent to filer::> volume qtree show

func (Driver) QtreeRename

func (d Driver) QtreeRename(path, newPath string) (response azgo.QtreeRenameResponse, err error)

QtreeRename renames a qtree equivalent to filer::> volume qtree rename

func (Driver) QuotaEntryList

func (d Driver) QuotaEntryList(volume string) (response azgo.QuotaListEntriesIterResponse, err error)

func (Driver) QuotaOff

func (d Driver) QuotaOff(volume string) (response azgo.QuotaOffResponse, err error)

QuotaOff disables quotas on a Flexvol equivalent to filer::> volume quota off

func (Driver) QuotaOn

func (d Driver) QuotaOn(volume string) (response azgo.QuotaOnResponse, err error)

QuotaOn enables quotas on a Flexvol equivalent to filer::> volume quota on

func (Driver) QuotaResize

func (d Driver) QuotaResize(volume string) (response azgo.QuotaResizeResponse, err error)

QuotaResize resizes quotas on a Flexvol equivalent to filer::> volume quota resize

func (Driver) QuotaSetEntry

func (d Driver) QuotaSetEntry(qtreeName, volumeName, quotaTarget, quotaType, diskLimit string) (response azgo.QuotaSetEntryResponse, err error)

QuotaSetEntry creates a new quota rule with an optional hard disk limit equivalent to filer::> volume quota policy rule create

func (Driver) QuotaStatus

func (d Driver) QuotaStatus(volume string) (response azgo.QuotaStatusResponse, err error)

QuotaStatus returns the quota status for a Flexvol equivalent to filer::> volume quota show

func (Driver) SetVolumeSize

func (d Driver) SetVolumeSize(name, newSize string) (response azgo.VolumeSizeResponse, err error)

SetVolumeSize sets the size of the specified volume

func (Driver) SnapmirrorGetLoadSharingMirrors

func (d Driver) SnapmirrorGetLoadSharingMirrors(volume string) (response azgo.SnapmirrorGetIterResponse, err error)

SnapmirrorGetLoadSharingMirrors gets load-sharing SnapMirror relationships for a volume equivalent to filer::> snapmirror -type LS -source-volume

func (Driver) SnapmirrorUpdateLoadSharingMirrors

func (d Driver) SnapmirrorUpdateLoadSharingMirrors(
	sourceLocation string,
) (response azgo.SnapmirrorUpdateLsSetResponse, err error)

SnapmirrorUpdateLoadSharingMirrors updates the destination volumes of a set of load-sharing mirrors equivalent to filer::> snapmirror update-ls-set -source-path

func (Driver) SnapshotCreate added in v1.3.1

func (d Driver) SnapshotCreate(name, volumeName string) (response azgo.SnapshotCreateResponse, err error)

SnapshotCreate creates a snapshot of a volume

func (Driver) SnapshotGetByVolume added in v1.3.1

func (d Driver) SnapshotGetByVolume(volumeName string) (response azgo.SnapshotGetIterResponse, err error)

SnapshotGetByVolume returns the list of snapshots associated with a volume

func (Driver) SupportsApiFeature

func (d Driver) SupportsApiFeature(feature ontapApiFeature) bool

SupportsApiFeature returns true if the Ontapi version supports the supplied feature

func (Driver) SystemGetOntapiVersion

func (d Driver) SystemGetOntapiVersion() (string, error)

GetOntapiVersion gets the ONTAPI version using the credentials, and caches & returns the result.

func (Driver) SystemGetVersion

func (d Driver) SystemGetVersion() (response azgo.SystemGetVersionResponse, err error)

SystemGetVersion returns the system version equivalent to filer::> version

func (Driver) VolumeCloneCreate added in v1.3.1

func (d Driver) VolumeCloneCreate(name, source, snapshot string) (response azgo.VolumeCloneCreateResponse, err error)

VolumeCloneCreate clones a volume from a snapshot

func (Driver) VolumeCloneSplitStart

func (d Driver) VolumeCloneSplitStart(name string) (response azgo.VolumeCloneSplitStartResponse, err error)

VolumeCloneSplitStart splits a cloned volume from its parent

func (Driver) VolumeCreate

func (d Driver) VolumeCreate(name, aggregateName, size, spaceReserve, snapshotPolicy, unixPermissions,
	exportPolicy, securityStyle string, encrypt *bool) (response azgo.VolumeCreateResponse, err error)

VolumeCreate creates a volume with the specified options equivalent to filer::> volume create -vserver iscsi_vs -volume v -aggregate aggr1 -size 1g -state online -type RW -policy default -unix-permissions ---rwxr-xr-x -space-guarantee none -snapshot-policy none -security-style unix -encrypt false

func (Driver) VolumeDestroy

func (d Driver) VolumeDestroy(name string, force bool) (response azgo.VolumeDestroyResponse, err error)

VolumeDestroy destroys a volume

func (Driver) VolumeDisableSnapshotDirectoryAccess

func (d Driver) VolumeDisableSnapshotDirectoryAccess(name string) (response azgo.VolumeModifyIterResponse, err error)

VolumeDisableSnapshotDirectoryAccess disables access to the ".snapshot" directory Disable '.snapshot' to allow official mysql container's chmod-in-init to work

func (Driver) VolumeExists

func (d Driver) VolumeExists(name string) (bool, error)

VolumeExists tests for the existence of a Flexvol

func (Driver) VolumeGet

func (d Driver) VolumeGet(name string) (azgo.VolumeAttributesType, error)

func (Driver) VolumeGetRootName

func (d Driver) VolumeGetRootName() (response azgo.VolumeGetRootNameResponse, err error)

VolumeGetRootName gets the name of the root volume of a vserver

func (Driver) VolumeList added in v1.3.3

func (d Driver) VolumeList(prefix string) (response azgo.VolumeGetIterResponse, err error)

VolumeList returns the names of all Flexvols whose names match the supplied prefix

func (Driver) VolumeListByAttrs

func (d Driver) VolumeListByAttrs(
	prefix, aggregate, spaceReserve, snapshotPolicy string, snapshotDir bool, encrypt *bool,
) (response azgo.VolumeGetIterResponse, err error)

VolumeList returns the names of all Flexvols matching the specified attributes

func (Driver) VolumeMount

func (d Driver) VolumeMount(name, junctionPath string) (response azgo.VolumeMountResponse, err error)

VolumeMount mounts a volume at the specified junction

func (Driver) VolumeOffline

func (d Driver) VolumeOffline(name string) (response azgo.VolumeOfflineResponse, err error)

VolumeOffline offlines a volume

func (Driver) VolumeSize

func (d Driver) VolumeSize(name string) (response azgo.VolumeSizeResponse, err error)

VolumeSize retrieves the size of the specified volume

func (Driver) VolumeUnmount

func (d Driver) VolumeUnmount(name string, force bool) (response azgo.VolumeUnmountResponse, err error)

VolumeUnmount unmounts a volume from the specified junction

func (Driver) VserverGetIterRequest

func (d Driver) VserverGetIterRequest() (response azgo.VserverGetIterResponse, err error)

VserverGetIterRequest returns the vservers on the system equivalent to filer::> vserver show

func (Driver) VserverShowAggrGetIterRequest

func (d Driver) VserverShowAggrGetIterRequest() (response azgo.VserverShowAggrGetIterResponse, err error)

VserverShowAggrGetIterRequest returns the aggregates on the vserver. Requires ONTAP 9 or later. equivalent to filer::> vserver show-aggregates

type DriverConfig

type DriverConfig struct {
	ManagementLIF   string
	SVM             string
	Username        string
	Password        string
	DebugTraceFlags map[string]bool
}

DriverConfig holds the configuration data for Driver objects

type ZapiError

type ZapiError struct {
	// contains filtered or unexported fields
}

ZapiError encapsulates the status, reason, and errno values from a ZAPI invocation, and it provides helper methods for detecting common error conditions.

func NewZapiError

func NewZapiError(zapiResult interface{}) (err ZapiError)

NewZapiError accepts the Response value from any AZGO call, extracts the status, reason, and errno values, and returns a ZapiError. The interface passed in may either be a Response object, or the always-embedded Result object where the error info exists. TODO: Replace reflection with relevant enhancements in AZGO generator.

func (ZapiError) Code

func (e ZapiError) Code() string

func (ZapiError) Error

func (e ZapiError) Error() string

func (ZapiError) IsPassed

func (e ZapiError) IsPassed() bool

func (ZapiError) IsPrivilegeError

func (e ZapiError) IsPrivilegeError() bool

func (ZapiError) IsScopeError

func (e ZapiError) IsScopeError() bool

func (ZapiError) Reason

func (e ZapiError) Reason() string

Jump to

Keyboard shortcuts

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