api

package
v18.10.0-beta.1+incomp... Latest Latest
Warning

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

Go to latest
Published: Sep 5, 2018 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (
	MinimumONTAPIVersion   feature = "MINIMUM_ONTAPI_VERSION"
	VServerShowAggr        feature = "VSERVER_SHOW_AGGR"
	FlexGroupsFilter       feature = "FLEX_GROUPS_FILTER"
	NetAppVolumeEncryption feature = "NETAPP_VOLUME_ENCRYPTION"
	NetAppFlexGroups       feature = "NETAPP_FLEX_GROUPS"
)

Define new version-specific feature constants here

View Source
const (
	NumericalValueNotSet = -1
)

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.

func NewZapiResultValue

func NewZapiResultValue(zapiResult interface{}) reflect.Value

NewZapiResultValue obtains the Result from an AZGO Response object and returns the Result

Types

type Client

type Client struct {
	SVMUUID string
	// contains filtered or unexported fields
}

Client is the object to use for interacting with ONTAP controllers

func NewClient

func NewClient(config ClientConfig) *Client

NewClient is a factory method for creating a new instance

func (Client) AggrGetIterRequest

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

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

func (Client) EmsAutosupportLog

func (d Client) 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 (Client) ExportPolicyCreate

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

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

func (Client) ExportRuleCreate

func (d Client) 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 (Client) ExportRuleGetIterRequest

func (d Client) 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 (Client) FlexGroupCreate

func (d Client) FlexGroupCreate(name string, size int, aggrList []azgo.AggrNameType, spaceReserve, snapshotPolicy, unixPermissions,
	exportPolicy, securityStyle string, encrypt *bool, snapshotReserve int) (response azgo.VolumeCreateAsyncResponse, err error)

FlexGroupCreate creates a FlexGroup with the specified options equivalent to filer::> volume create -vserver svm_name -volume fg_vol_name –auto-provision-as flexgroup -size fg_size -state online -type RW -policy default -unix-permissions ---rwxr-xr-x -space-guarantee none -snapshot-policy none -security-style unix -encrypt false

func (Client) FlexGroupDestroy

func (d Client) FlexGroupDestroy(name string, force bool) (response azgo.VolumeDestroyAsyncResponse, err error)

FlexGroupDestroy destroys a FlexGroup

func (Client) FlexGroupExists

func (d Client) FlexGroupExists(name string) (bool, error)

FlexGroupExists tests for the existence of a FlexGroup

func (Client) FlexGroupGet

func (d Client) FlexGroupGet(name string) (azgo.VolumeAttributesType, error)

FlexGroupGet returns all relevant details for a single FlexGroup

func (Client) FlexGroupGetAll

func (d Client) FlexGroupGetAll(prefix string) (response azgo.VolumeGetIterResponse, err error)

FlexGroupGetAll returns all relevant details for all FlexGroups whose names match the supplied prefix

func (Client) FlexGroupSetSize

func (d Client) FlexGroupSetSize(name, newSize string) (response azgo.VolumeSizeAsyncResponse, err error)

FlexGroupSetSize sets the size of the specified FlexGroup

func (Client) FlexGroupSize

func (d Client) FlexGroupSize(name string) (int, error)

FlexGroupVolumeSize retrieves the size of the specified volume

func (Client) FlexGroupVolumeDisableSnapshotDirectoryAccess

func (d Client) FlexGroupVolumeDisableSnapshotDirectoryAccess(name string) (response azgo.VolumeModifyIterAsyncResponse, err error)

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

func (Client) GetClonedZapiRunner

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

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

func (Client) GetNontunneledZapiRunner

func (d Client) 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 (Client) IgroupAdd

func (d Client) 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 (Client) IgroupCreate

func (d Client) 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 (Client) IgroupDestroy

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

IgroupDestroy destroys an initiator group

func (Client) IgroupList

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

IgroupList lists initiator groups

func (Client) IgroupRemove

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

IgroupRemove removes an initiator from an initiator group

func (Client) IscsiInterfaceGetIterRequest

func (d Client) IscsiInterfaceGetIterRequest() (response azgo.IscsiInterfaceGetIterResponse, err error)

IscsiInterfaceGetIterRequest returns information about the vserver's iSCSI interfaces

func (Client) IscsiNodeGetNameRequest

func (d Client) IscsiNodeGetNameRequest() (response azgo.IscsiNodeGetNameResponse, err error)

IscsiNodeGetNameRequest gets the IQN of the vserver

func (Client) IscsiServiceGetIterRequest

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

IscsiServiceGetIterRequest returns information about an iSCSI target

func (Client) JobGetIterStatus

func (d Client) JobGetIterStatus(jobId int) (response azgo.JobGetIterResponse, err error)

JobGetIterStatus returns the current job status for Async requests.

func (Client) LunCreate

func (d Client) 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 (Client) LunDestroy

func (d Client) 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 (Client) LunGet

func (d Client) LunGet(path string) (azgo.LunInfoType, error)

LunGet returns all relevant details for a single LUN equivalent to filer::> lun show

func (Client) LunGetAll

func (d Client) LunGetAll(pathPattern string) (response azgo.LunGetIterResponse, err error)

LunGetAll returns all relevant details for all LUNs whose paths match the supplied pattern equivalent to filer::> lun show

func (Client) LunGetAttribute

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

LunGetAttribute gets a named attribute for a given LUN.

func (Client) LunGetSerialNumber

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

LunGetSerialNumber returns the serial# for a lun

func (Client) LunMap

func (d Client) 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 (Client) LunMapAutoID

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

LunMapAutoID 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 (Client) LunMapIfNotMapped

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

func (Client) LunMapListInfo

func (d Client) 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 (Client) LunOffline

func (d Client) 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 (Client) LunOnline

func (d Client) 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 (Client) LunSetAttribute

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

LunSetAttribute sets a named attribute for a given LUN.

func (Client) NetInterfaceGet

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

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

func (Client) NetInterfaceGetDataLIFs

func (d Client) NetInterfaceGetDataLIFs(protocol string) ([]string, error)

func (Client) NodeListSerialNumbers

func (d Client) NodeListSerialNumbers() ([]string, error)

func (Client) QtreeCount

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

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

func (Client) QtreeCreate

func (d Client) 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 (Client) QtreeDestroyAsync

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

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

func (Client) QtreeExists

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

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

func (Client) QtreeGet

func (d Client) QtreeGet(name, volumePrefix string) (azgo.QtreeInfoType, error)

QtreeGet returns all relevant details for a single qtree equivalent to filer::> volume qtree show

func (Client) QtreeGetAll

func (d Client) QtreeGetAll(volumePrefix string) (response azgo.QtreeListIterResponse, err error)

QtreeGetAll returns all relevant details for all qtrees whose Flexvol names match the supplied prefix equivalent to filer::> volume qtree show

func (Client) QtreeList

func (d Client) 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 (Client) QtreeRename

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

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

func (Client) QuotaEntryList

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

QuotaEntryList returns the disk limit quotas for a Flexvol equivalent to filer::> volume quota policy rule show

func (Client) QuotaGetEntry

func (d Client) QuotaGetEntry(target string) (azgo.QuotaEntryType, error)

QuotaEntryGet returns the disk limit for a single qtree equivalent to filer::> volume quota policy rule show

func (Client) QuotaOff

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

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

func (Client) QuotaOn

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

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

func (Client) QuotaResize

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

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

func (Client) QuotaSetEntry

func (d Client) 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 (Client) QuotaStatus

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

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

func (Client) SnapmirrorGetLoadSharingMirrors

func (d Client) 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 (Client) SnapmirrorUpdateLoadSharingMirrors

func (d Client) 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 (Client) SnapshotCreate

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

SnapshotCreate creates a snapshot of a volume

func (Client) SnapshotGetByVolume

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

SnapshotGetByVolume returns the list of snapshots associated with a volume

func (Client) SupportsFeature

func (d Client) SupportsFeature(feature feature) bool

SupportsFeature returns true if the Ontapi version supports the supplied feature

func (Client) SystemGetOntapiVersion

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

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

func (Client) SystemGetVersion

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

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

func (Client) VolumeCloneCreate

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

VolumeCloneCreate clones a volume from a snapshot

func (Client) VolumeCloneSplitStart

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

VolumeCloneSplitStart splits a cloned volume from its parent

func (Client) VolumeCreate

func (d Client) VolumeCreate(name, aggregateName, size, spaceReserve, snapshotPolicy, unixPermissions,
	exportPolicy, securityStyle string, encrypt *bool, snapshotReserve int,
) (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 (Client) VolumeDestroy

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

VolumeDestroy destroys a volume

func (Client) VolumeDisableSnapshotDirectoryAccess

func (d Client) 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 (Client) VolumeExists

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

VolumeExists tests for the existence of a Flexvol

func (Client) VolumeGet

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

VolumeGet returns all relevant details for a single Flexvol equivalent to filer::> volume show

func (Client) VolumeGetAll

func (d Client) VolumeGetAll(prefix string) (response azgo.VolumeGetIterResponse, err error)

VolumeGetAll returns all relevant details for all FlexVols whose names match the supplied prefix equivalent to filer::> volume show

func (Client) VolumeGetRootName

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

VolumeGetRootName gets the name of the root volume of a vserver

func (Client) VolumeList

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

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

func (Client) VolumeListByAttrs

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

VolumeListByAttrs returns the names of all Flexvols matching the specified attributes

func (Client) VolumeMount

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

VolumeMount mounts a volume at the specified junction

func (Client) VolumeOffline

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

VolumeOffline offlines a volume

func (Client) VolumeSetSize

func (d Client) VolumeSetSize(name, newSize string) (response azgo.VolumeSizeResponse, err error)

VolumeSetSize sets the size of the specified volume

func (Client) VolumeSize

func (d Client) VolumeSize(name string) (int, error)

VolumeSize retrieves the size of the specified volume

func (Client) VolumeUnmount

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

VolumeUnmount unmounts a volume from the specified junction

func (Client) VserverGetAggregateNames

func (d Client) VserverGetAggregateNames() ([]string, error)

VserverGetAggregateNames 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 (Client) VserverGetIterAdminRequest

func (d Client) VserverGetIterAdminRequest() (response azgo.VserverGetIterResponse, err error)

VserverGetIterAdminRequest returns vservers of type "admin" on the system. equivalent to filer::> vserver show -type admin

func (Client) VserverGetIterRequest

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

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

func (Client) VserverGetRequest

func (d Client) VserverGetRequest() (response azgo.VserverGetResponse, err error)

VserverGetRequest returns vserver to which it is sent equivalent to filer::> vserver show

func (Client) VserverShowAggrGetIterRequest

func (d Client) 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 ClientConfig

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

ClientConfig holds the configuration data for Client objects

type ZapiAsyncResult

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

ZapiAsyncResult encap

func NewZapiAsyncResult

func NewZapiAsyncResult(zapiResult interface{}) (result ZapiAsyncResult, err error)

NewZapiAsyncResult accepts the Response value from any AZGO Async Request, extracts the status, jobId, and errorCode values and returns a ZapiAsyncResult. TODO: Replace reflection with relevant enhancements in AZGO generator.

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) IsFailedToLoadJobError

func (e ZapiError) IsFailedToLoadJobError() bool

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

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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