Documentation
¶
Overview ¶
Package api provides a high-level interface to the Azure NetApp Files SDK
Package api provides a high-level interface to the Azure NetApp Files SDK
Index ¶
- Constants
- Variables
- func CreateCapacityPoolFullName(resourceGroup, netappAccount, capacityPool string) string
- func CreateKeyVaultEndpoint(subnet, resourceGroup, keyVaultEndpoint string) string
- func CreateNetappAccountFullName(resourceGroup, netappAccount string) string
- func CreateNetappAccountID(subscriptionID, resourceGroup, netappAccount string) string
- func CreateSnapshotFullName(resourceGroup, netappAccount, capacityPool, volume, snapshot string) string
- func CreateSnapshotID(...) string
- func CreateStringPtrArray(in []string) []*string
- func CreateSubnetFullName(resourceGroup, virtualNetwork, subnet string) string
- func CreateSubnetID(subscriptionID, resourceGroup, vNet, subnet string) string
- func CreateVirtualNetworkFullName(resourceGroup, virtualNetwork string) string
- func CreateVirtualNetworkID(subscriptionID, resourceGroup, virtualNetwork string) string
- func CreateVolumeFullName(resourceGroup, netappAccount, capacityPool, volume string) string
- func CreateVolumeID(subscriptionID, resourceGroup, netappAccount, capacityPool, volume string) string
- func DerefBool(b *bool) bool
- func DerefFloat32(i *float32) float32
- func DerefInt32(i *int32) int32
- func DerefInt64(i *int64) int64
- func DerefNetworkFeatures(f *netapp.NetworkFeatures) string
- func DerefString(s *string) string
- func DerefStringArray(s *[]string) []string
- func DerefStringPtrArray(in []*string) []string
- func GetAzureCredential(config ClientConfig, cloudConfig *cloud.Configuration) (credential azcore.TokenCredential, err error)
- func GetCorrelationID(response *http.Response) (id string)
- func GetCorrelationIDFromError(err error) (id string)
- func GetMessageFromError(ctx context.Context, inputErr error) error
- func IsANFNotFoundError(err error) bool
- func IsANFPoolSizeTooSmallError(ctx context.Context, inputErr error) (bool, error)
- func IsANFTooManyRequestsError(err error) bool
- func IsTerminalStateError(err error) bool
- func ParseCapacityPoolID(capacityPoolID string) (subscriptionID, resourceGroup, provider, netappAccount, capacityPool string, ...)
- func ParseSnapshotID(snapshotID string) (...)
- func ParseSubnetID(subnetID string) (subscriptionID, resourceGroup, provider, virtualNetwork, subnet string, ...)
- func ParseVolumeID(volumeID string) (...)
- func ParseVolumeName(volumeName string) (resourceGroup, netappAccount, capacityPool, volume string, err error)
- func ValidateClientConfig(config ClientConfig) error
- func ValidateCloudConfiguration(cloudConfig *CloudConfiguration) (*cloud.Configuration, error)
- type Azure
- type AzureClient
- type AzureError
- type AzurePollerResponseCache
- type AzureResources
- func (r *AzureResources) GetCapacityPools() *collection.ImmutableMap[string, *CapacityPool]
- func (r *AzureResources) GetNetAppAccountMap() *collection.ImmutableMap[string, *NetAppAccount]
- func (r *AzureResources) GetResourceGroupMap() *collection.ImmutableMap[string, *ResourceGroup]
- func (r *AzureResources) GetResourceGroups() []*ResourceGroup
- func (r *AzureResources) GetStoragePools() *collection.ImmutableMap[string, storage.Pool]
- func (r *AzureResources) GetSubnetMap() *collection.ImmutableMap[string, *Subnet]
- func (r *AzureResources) GetVirtualNetworkMap() *collection.ImmutableMap[string, *VirtualNetwork]
- func (r *AzureResources) LockAndCheckStale(maxAge time.Duration) (stale bool, updater azureResourceUpdater, unlock func())
- func (r *AzureResources) LockForDiscover() (updater azureResourceUpdater, unlock func())
- func (r *AzureResources) SetFeatures(featureMap map[string]bool)
- func (r *AzureResources) SetStoragePools(storagePools map[string]storage.Pool)
- type CapacityPool
- type Client
- func (c Client) AvailabilityZones(ctx context.Context) ([]string, error)
- func (c Client) CapacityPools() *[]*CapacityPool
- func (c Client) CapacityPoolsForStoragePool(ctx context.Context, sPool storage.Pool, serviceLevel, qosType string) []*CapacityPool
- func (c Client) CapacityPoolsForStoragePools(ctx context.Context) []*CapacityPool
- func (c Client) CreateSnapshot(ctx context.Context, filesystem *FileSystem, name string) (*Snapshot, error)
- func (c Client) CreateVolume(ctx context.Context, request *FilesystemCreateRequest) (*FileSystem, error)
- func (c Client) DeleteSnapshot(ctx context.Context, filesystem *FileSystem, snapshot *Snapshot) error
- func (c Client) DeleteVolume(ctx context.Context, filesystem *FileSystem) error
- func (c Client) DiscoverAzureResources(ctx context.Context) error
- func (c Client) EnableAzureFeatures(ctx context.Context, featureNames ...string) (returnError error)
- func (c Client) EnsureVolumeInValidCapacityPool(ctx context.Context, volume *FileSystem) error
- func (c Client) Features() map[string]bool
- func (c Client) FilteredCapacityPoolMap(ctx context.Context, rgFilter, naFilter, cpFilter []string) map[string]*CapacityPool
- func (c Client) FilteredSubnetMap(ctx context.Context, rgFilter []string, vnFilter, snFilter string) map[string]*Subnet
- func (c Client) HasFeature(feature string) bool
- func (c Client) Init(ctx context.Context, pools map[string]storage.Pool) error
- func (c Client) ModifyVolume(ctx context.Context, filesystem *FileSystem, labels map[string]string, ...) error
- func (c Client) RandomSubnetForStoragePool(ctx context.Context, sPool storage.Pool) *Subnet
- func (c Client) RefreshAzureResources(ctx context.Context) error
- func (c Client) ResizeVolume(ctx context.Context, filesystem *FileSystem, newSizeBytes int64) error
- func (c Client) RestoreSnapshot(ctx context.Context, filesystem *FileSystem, snapshot *Snapshot) error
- func (c Client) SnapshotForVolume(ctx context.Context, filesystem *FileSystem, snapshotName string) (*Snapshot, error)
- func (c Client) SnapshotsForVolume(ctx context.Context, filesystem *FileSystem) (*[]*Snapshot, error)
- func (c Client) SubnetsForStoragePool(ctx context.Context, sPool storage.Pool) []*Subnet
- func (c Client) Volume(ctx context.Context, volConfig *storage.VolumeConfig) (*FileSystem, error)
- func (c Client) VolumeByCreationToken(ctx context.Context, creationToken string) (*FileSystem, error)
- func (c Client) VolumeByID(ctx context.Context, id string) (*FileSystem, error)
- func (c Client) VolumeExists(ctx context.Context, volConfig *storage.VolumeConfig) (bool, *FileSystem, error)
- func (c Client) VolumeExistsByCreationToken(ctx context.Context, creationToken string) (bool, *FileSystem, error)
- func (c Client) VolumeExistsByID(ctx context.Context, id string) (bool, *FileSystem, error)
- func (c Client) Volumes(ctx context.Context) (*[]*FileSystem, error)
- func (c Client) WaitForSnapshotState(ctx context.Context, snapshot *Snapshot, filesystem *FileSystem, ...) error
- func (c Client) WaitForVolumeState(ctx context.Context, filesystem *FileSystem, desiredState string, ...) (string, error)
- type ClientConfig
- type CloudConfiguration
- type ExportPolicy
- type ExportRule
- type FileSystem
- type FilesystemCreateRequest
- type MountTarget
- type NetAppAccount
- type Operation
- type PollerKey
- type PollerResponse
- type PollerResponseCache
- type PollerVolumeCreateResponse
- type ResourceGroup
- type Snapshot
- type Subnet
- type TerminalStateError
- type VirtualNetwork
Constants ¶
const ( VolumeCreateTimeout = 2 * time.Second SnapshotTimeout = 240 * time.Second // Snapshotter sidecar has a timeout of 5 minutes. Stay under that! DefaultTimeout = 120 * time.Second MaxLabelLength = 256 DefaultSDKTimeout = 30 * time.Second SDKRetryDelay = 2 * time.Second SDKMaxRetryDelay = 15 * time.Second CorrelationIDHeader = "X-Ms-Correlation-Request-Id" PoolSizeTooSmallError = "PoolSizeTooSmall" )
const ( StateAccepted = "Accepted" StateCreating = "Creating" StateAvailable = "Succeeded" StateDeleting = "Deleting" StateDeleted = "NoSuchState" StateMoving = "Moving" // Currently unused by ANF StateError = "Failed" StateReverting = "Reverting" ProtocolTypeNFSPrefix = "NFSv" ProtocolTypeNFSv3 = ProtocolTypeNFSPrefix + "3" ProtocolTypeNFSv41 = ProtocolTypeNFSPrefix + "4.1" ProtocolTypeCIFS = "CIFS" MountOptionKerberos5 = "sec=krb5" MountOptionKerberos5I = "sec=krb5i" MountOptionKerberos5P = "sec=krb5p" ServiceLevelStandard = "Standard" ServiceLevelPremium = "Premium" ServiceLevelUltra = "Ultra" FeatureUnixPermissions = "ANFUnixPermissions" NetworkFeaturesBasic = "Basic" NetworkFeaturesStandard = "Standard" EncryptionKeyNetApp = "Microsoft.NetApp" EncryptionKeyVault = "Microsoft.KeyVault" QOSAuto = "Auto" QOSManual = "Manual" )
const (
DefaultMaxCacheAge = 10 * time.Minute
)
Variables ¶
var (
VolumePollerCache = AzurePollerResponseCache{/* contains filtered or unexported fields */}
)
Functions ¶
func CreateCapacityPoolFullName ¶
CreateCapacityPoolFullName creates the fully qualified name for a capacity pool.
func CreateKeyVaultEndpoint ¶
CreateKeyVaultEndpoint to create KeyVault Endpoint ID
func CreateNetappAccountFullName ¶
CreateNetappAccountFullName creates the fully qualified name for a netapp account.
func CreateNetappAccountID ¶
CreateNetappAccountID creates the Azure-style ID for a netapp account.
func CreateSnapshotFullName ¶
func CreateSnapshotFullName(resourceGroup, netappAccount, capacityPool, volume, snapshot string) string
CreateSnapshotFullName creates the fully qualified name for a snapshot.
func CreateSnapshotID ¶
func CreateSnapshotID( subscriptionID, resourceGroup, netappAccount, capacityPool, volume, snapshot string, ) string
CreateSnapshotID creates the Azure-style ID for a snapshot.
func CreateStringPtrArray ¶
CreateStringPtrArray accepts an array of strings and returns an array of pointers to those strings.
func CreateSubnetFullName ¶
CreateSubnetFullName creates the fully qualified name for a subnet.
func CreateSubnetID ¶
CreateSubnetID creates the Azure-style ID for a subnet.
func CreateVirtualNetworkFullName ¶
CreateVirtualNetworkFullName creates the fully qualified name for a virtual network.
func CreateVirtualNetworkID ¶
CreateVirtualNetworkID creates the Azure-style ID for a virtual network.
func CreateVolumeFullName ¶
CreateVolumeFullName creates the fully qualified name for a volume.
func CreateVolumeID ¶
func CreateVolumeID(subscriptionID, resourceGroup, netappAccount, capacityPool, volume string) string
CreateVolumeID creates the Azure-style ID for a volume.
func DerefBool ¶
DerefBool accepts a bool pointer and returns the value of the bool, or false if the pointer is nil.
func DerefFloat32 ¶
DerefFloat32 accepts a float32 pointer and returns the value of the float32, or 0 if the pointer is nil.
func DerefInt32 ¶
DerefInt32 accepts an int32 pointer and returns the value of the int32, or 0 if the pointer is nil.
func DerefInt64 ¶
DerefInt64 accepts an int64 pointer and returns the value of the int64, or 0 if the pointer is nil.
func DerefNetworkFeatures ¶
func DerefNetworkFeatures(f *netapp.NetworkFeatures) string
DerefNetworkFeatures accepts a NetworkFeatures pointer and returns its string value, or "" if the pointer is nil.
func DerefString ¶
DerefString accepts a string pointer and returns the value of the string, or "" if the pointer is nil.
func DerefStringArray ¶
DerefStringArray accepts a string array pointer and returns the value of the array, or []string if the pointer is nil.
func DerefStringPtrArray ¶
DerefStringPtrArray accepts an array of string pointers and returns the value of the array.
func GetAzureCredential ¶
func GetAzureCredential( config ClientConfig, cloudConfig *cloud.Configuration, ) (credential azcore.TokenCredential, err error)
GetAzureCredential creates an Azure credential with the specified cloud configuration. The cloudConfig parameter should be a validated cloud configuration from ValidateCloudConfiguration(). If cloudConfig is nil, defaults to AzurePublic cloud.
func GetCorrelationID ¶
GetCorrelationID accepts an HTTP response returned from the ANF SDK and extracts the correlation header, if present.
func GetCorrelationIDFromError ¶
GetCorrelationIDFromError accepts an error returned from the ANF SDK and extracts the correlation header, if present.
func GetMessageFromError ¶
GetMessageFromError accepts an error returned from the ANF SDK and returns an appropriate error message.
func IsANFNotFoundError ¶
IsANFNotFoundError checks whether an error returned from the ANF SDK contains a 404 (Not Found) error.
func IsANFPoolSizeTooSmallError ¶
IsANFPoolSizeTooSmallError checks whether an error returned from the ANF SDK contains a PoolSizeToolSmall code
func IsANFTooManyRequestsError ¶
IsANFTooManyRequestsError checks whether an error returned from the ANF SDK contains a 429 (Too Many Requests) error.
func IsTerminalStateError ¶
func ParseCapacityPoolID ¶
func ParseCapacityPoolID( capacityPoolID string, ) (subscriptionID, resourceGroup, provider, netappAccount, capacityPool string, err error)
ParseCapacityPoolID parses the Azure-style ID for a capacity pool.
func ParseSnapshotID ¶
func ParseSnapshotID( snapshotID string, ) (subscriptionID, resourceGroup, provider, netappAccount, capacityPool, volume, snapshot string, err error)
ParseSnapshotID parses the Azure-style ID for a snapshot.
func ParseSubnetID ¶
func ParseSubnetID( subnetID string, ) (subscriptionID, resourceGroup, provider, virtualNetwork, subnet string, err error)
ParseSubnetID parses the Azure-style ID for a subnet.
func ParseVolumeID ¶
func ParseVolumeID( volumeID string, ) (subscriptionID, resourceGroup, provider, netappAccount, capacityPool, volume string, err error)
ParseVolumeID parses the Azure-style ID for a volume.
func ParseVolumeName ¶
func ParseVolumeName(volumeName string) (resourceGroup, netappAccount, capacityPool, volume string, err error)
ParseVolumeName parses the Azure-style Name for a volume.
func ValidateClientConfig ¶
func ValidateClientConfig(config ClientConfig) error
ValidateClientConfig checks driver configuration without creating SDK clients or credentials.
func ValidateCloudConfiguration ¶
func ValidateCloudConfiguration(cloudConfig *CloudConfiguration) (*cloud.Configuration, error)
ValidateCloudConfiguration validates the cloud configuration and returns a cloud.Configuration.
Types ¶
type Azure ¶
type Azure interface {
Init(context.Context, map[string]storage.Pool) error
RefreshAzureResources(context.Context) error
DiscoverAzureResources(context.Context) error
EnableAzureFeatures(context.Context, ...string) error
Features() map[string]bool
HasFeature(string) bool
CapacityPools() *[]*CapacityPool
CapacityPoolsForStoragePools(context.Context) []*CapacityPool
CapacityPoolsForStoragePool(context.Context, storage.Pool, string, string) []*CapacityPool
EnsureVolumeInValidCapacityPool(context.Context, *FileSystem) error
SubnetsForStoragePool(context.Context, storage.Pool) []*Subnet
RandomSubnetForStoragePool(context.Context, storage.Pool) *Subnet
FilteredCapacityPoolMap(ctx context.Context, rgFilter, naFilter, cpFilter []string) map[string]*CapacityPool
FilteredSubnetMap(ctx context.Context, rgFilter []string, vnFilter, snFilter string) map[string]*Subnet
Volumes(context.Context) (*[]*FileSystem, error)
Volume(context.Context, *storage.VolumeConfig) (*FileSystem, error)
VolumeExists(context.Context, *storage.VolumeConfig) (bool, *FileSystem, error)
VolumeByCreationToken(context.Context, string) (*FileSystem, error)
VolumeExistsByCreationToken(context.Context, string) (bool, *FileSystem, error)
VolumeByID(context.Context, string) (*FileSystem, error)
VolumeExistsByID(context.Context, string) (bool, *FileSystem, error)
WaitForVolumeState(context.Context, *FileSystem, string, []string, time.Duration, Operation) (string, error)
CreateVolume(context.Context, *FilesystemCreateRequest) (*FileSystem, error)
ModifyVolume(context.Context, *FileSystem, map[string]string, *string, *bool, *ExportRule) error
ResizeVolume(context.Context, *FileSystem, int64) error
DeleteVolume(context.Context, *FileSystem) error
SnapshotsForVolume(context.Context, *FileSystem) (*[]*Snapshot, error)
SnapshotForVolume(context.Context, *FileSystem, string) (*Snapshot, error)
WaitForSnapshotState(context.Context, *Snapshot, *FileSystem, string, []string, time.Duration) error
CreateSnapshot(context.Context, *FileSystem, string) (*Snapshot, error)
RestoreSnapshot(context.Context, *FileSystem, *Snapshot) error
DeleteSnapshot(context.Context, *FileSystem, *Snapshot) error
AvailabilityZones(ctx context.Context) ([]string, error)
}
func NewDriver ¶
func NewDriver(config ClientConfig) (Azure, error)
NewDriver is a factory method for creating a new SDK interface.
type AzureClient ¶
type AzureClient struct {
Credential azcore.TokenCredential
FeaturesClient *features.Client
GraphClient *resourcegraph.Client
VolumesClient *netapp.VolumesClient
SnapshotsClient *netapp.SnapshotsClient
ResourceClient *netapp.ResourceClient
// contains filtered or unexported fields
}
AzureClient holds operational Azure SDK objects.
type AzureError ¶
type AzureError struct {
Id string `json:"id"`
Name string `json:"name"`
Status string `json:"status"`
StartTime string `json:"startTime"`
EndTime string `json:"endTime"`
AzError struct {
Code string `json:"code"`
Message string `json:"message"`
Details []struct {
Code string `json:"code"`
Message string `json:"message"`
} `json:"details"`
} `json:"error"`
}
func (*AzureError) Error ¶
func (e *AzureError) Error() string
type AzurePollerResponseCache ¶
type AzurePollerResponseCache struct {
// contains filtered or unexported fields
}
func (*AzurePollerResponseCache) Delete ¶
func (azPollerCache *AzurePollerResponseCache) Delete(key PollerKey)
func (*AzurePollerResponseCache) Get ¶
func (azPollerCache *AzurePollerResponseCache) Get(key PollerKey) (PollerResponse, bool)
func (*AzurePollerResponseCache) Put ¶
func (azPollerCache *AzurePollerResponseCache) Put(key *PollerKey, value PollerResponse) error
type AzureResources ¶
type AzureResources struct {
// contains filtered or unexported fields
}
AzureResources is the toplevel cache for the set of things we discover about our Azure environment.
func (*AzureResources) GetCapacityPools ¶
func (r *AzureResources) GetCapacityPools() *collection.ImmutableMap[string, *CapacityPool]
func (*AzureResources) GetNetAppAccountMap ¶
func (r *AzureResources) GetNetAppAccountMap() *collection.ImmutableMap[string, *NetAppAccount]
func (*AzureResources) GetResourceGroupMap ¶
func (r *AzureResources) GetResourceGroupMap() *collection.ImmutableMap[string, *ResourceGroup]
func (*AzureResources) GetResourceGroups ¶
func (r *AzureResources) GetResourceGroups() []*ResourceGroup
func (*AzureResources) GetStoragePools ¶
func (r *AzureResources) GetStoragePools() *collection.ImmutableMap[string, storage.Pool]
GetStoragePools returns the pools defined in the backend config.
func (*AzureResources) GetSubnetMap ¶
func (r *AzureResources) GetSubnetMap() *collection.ImmutableMap[string, *Subnet]
func (*AzureResources) GetVirtualNetworkMap ¶
func (r *AzureResources) GetVirtualNetworkMap() *collection.ImmutableMap[string, *VirtualNetwork]
func (*AzureResources) LockAndCheckStale ¶
func (r *AzureResources) LockAndCheckStale(maxAge time.Duration) (stale bool, updater azureResourceUpdater, unlock func())
LockAndCheckStale locks the resources and returns true if the cache is stale based on maxAge. The caller must call the returned unlock function when done. When stale is false, updater is nil.
func (*AzureResources) LockForDiscover ¶
func (r *AzureResources) LockForDiscover() (updater azureResourceUpdater, unlock func())
LockForDiscover locks and returns an updater for a full discovery refresh (ignores cache age).
func (*AzureResources) SetFeatures ¶
func (r *AzureResources) SetFeatures(featureMap map[string]bool)
SetFeatures replaces the feature flags map; caller should hold no locks — this method locks internally.
func (*AzureResources) SetStoragePools ¶
func (r *AzureResources) SetStoragePools(storagePools map[string]storage.Pool)
SetStoragePools sets pools from the backend config; not thread-safe and should only be called during initialization.
type CapacityPool ¶
type CapacityPool struct {
ID string
ResourceGroup string
NetAppAccount string
Name string
FullName string
Location string
Type string
PoolID string
ServiceLevel string
ProvisioningState string
QosType string
}
CapacityPool records details of a discovered Azure Subnet.
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client encapsulates connection details.
func (Client) AvailabilityZones ¶
func (Client) CapacityPools ¶
func (c Client) CapacityPools() *[]*CapacityPool
CapacityPools returns a list of all discovered ANF capacity pools.
func (Client) CapacityPoolsForStoragePool ¶
func (c Client) CapacityPoolsForStoragePool( ctx context.Context, sPool storage.Pool, serviceLevel, qosType string, ) []*CapacityPool
CapacityPoolsForStoragePool returns all discovered capacity pools matching the specified storage pool and service level. The pools are shuffled to enable easier random selection.
func (Client) CapacityPoolsForStoragePools ¶
func (c Client) CapacityPoolsForStoragePools(ctx context.Context) []*CapacityPool
CapacityPoolsForStoragePools returns all discovered capacity pools matching all known storage pools, regardless of service levels or QOS types.
func (Client) CreateSnapshot ¶
func (c Client) CreateSnapshot(ctx context.Context, filesystem *FileSystem, name string) (*Snapshot, error)
CreateSnapshot creates a new snapshot.
func (Client) CreateVolume ¶
func (c Client) CreateVolume(ctx context.Context, request *FilesystemCreateRequest) (*FileSystem, error)
CreateVolume creates a new volume.
func (Client) DeleteSnapshot ¶
func (c Client) DeleteSnapshot(ctx context.Context, filesystem *FileSystem, snapshot *Snapshot) error
DeleteSnapshot deletes a snapshot.
func (Client) DeleteVolume ¶
func (c Client) DeleteVolume(ctx context.Context, filesystem *FileSystem) error
DeleteVolume deletes a volume.
func (Client) DiscoverAzureResources ¶
DiscoverAzureResources rediscovers the Azure resources we care about and updates the cache.
func (Client) EnableAzureFeatures ¶
func (c Client) EnableAzureFeatures(ctx context.Context, featureNames ...string) (returnError error)
EnableAzureFeatures registers any ANF preview features we care about and updates the cache.
func (Client) EnsureVolumeInValidCapacityPool ¶
func (c Client) EnsureVolumeInValidCapacityPool(ctx context.Context, volume *FileSystem) error
EnsureVolumeInValidCapacityPool checks whether the specified volume exists in any capacity pool that is referenced by the backend config. It returns nil if so, or if no capacity pools are named in the config.
func (Client) Features ¶
Features returns the map of preview features believed to be available in the current subscription.
func (Client) FilteredCapacityPoolMap ¶
func (Client) FilteredSubnetMap ¶
func (Client) HasFeature ¶
HasFeature returns true if the named preview feature is believed to be available in the current subscription.
func (Client) ModifyVolume ¶
func (c Client) ModifyVolume( ctx context.Context, filesystem *FileSystem, labels map[string]string, unixPermissions *string, snapshotDirAccess *bool, exportRule *ExportRule, ) error
ModifyVolume updates attributes of a volume.
func (Client) RandomSubnetForStoragePool ¶
RandomSubnetForStoragePool finds all discovered subnets matching the specified storage pool, and then returns one at random.
func (Client) RefreshAzureResources ¶
RefreshAzureResources refreshes the cache of discovered Azure resources and validates them against our known storage pools.
func (Client) ResizeVolume ¶
ResizeVolume sends a VolumePatch to update a volume's quota.
func (Client) RestoreSnapshot ¶
func (c Client) RestoreSnapshot(ctx context.Context, filesystem *FileSystem, snapshot *Snapshot) error
RestoreSnapshot restores a volume to a snapshot.
func (Client) SnapshotForVolume ¶
func (c Client) SnapshotForVolume( ctx context.Context, filesystem *FileSystem, snapshotName string, ) (*Snapshot, error)
SnapshotForVolume fetches a specific snapshot on a volume by its name.
func (Client) SnapshotsForVolume ¶
func (c Client) SnapshotsForVolume(ctx context.Context, filesystem *FileSystem) (*[]*Snapshot, error)
SnapshotsForVolume returns a list of snapshots on a volume.
func (Client) SubnetsForStoragePool ¶
SubnetsForStoragePool returns all discovered subnets matching the specified storage pool.
func (Client) Volume ¶
func (c Client) Volume(ctx context.Context, volConfig *storage.VolumeConfig) (*FileSystem, error)
Volume uses a volume config record to fetch a volume by the most efficient means.
func (Client) VolumeByCreationToken ¶
func (c Client) VolumeByCreationToken(ctx context.Context, creationToken string) (*FileSystem, error)
VolumeByCreationToken fetches a Filesystem by its immutable creation token. We can't query the SDK for volumes by creation token, so our only choice here is to get all volumes and return the one of interest. That is obviously very inefficient, so this method should be used only when absolutely necessary.
func (Client) VolumeByID ¶
VolumeByID returns a Filesystem based on its Azure-style ID.
func (Client) VolumeExists ¶
func (c Client) VolumeExists(ctx context.Context, volConfig *storage.VolumeConfig) (bool, *FileSystem, error)
VolumeExists uses a volume config record to look for a Filesystem by the most efficient means.
func (Client) VolumeExistsByCreationToken ¶
func (c Client) VolumeExistsByCreationToken(ctx context.Context, creationToken string) (bool, *FileSystem, error)
VolumeExistsByCreationToken checks whether a volume exists using its creation token as a key.
func (Client) VolumeExistsByID ¶
VolumeExistsByID checks whether a volume exists using its creation token as a key.
func (Client) Volumes ¶
func (c Client) Volumes(ctx context.Context) (*[]*FileSystem, error)
Volumes returns a list of all volumes.
func (Client) WaitForSnapshotState ¶
func (c Client) WaitForSnapshotState( ctx context.Context, snapshot *Snapshot, filesystem *FileSystem, desiredState string, abortStates []string, maxElapsedTime time.Duration, ) error
WaitForSnapshotState waits for a desired snapshot state and returns once that state is achieved.
func (Client) WaitForVolumeState ¶
func (c Client) WaitForVolumeState( ctx context.Context, filesystem *FileSystem, desiredState string, abortStates []string, maxElapsedTime time.Duration, operation Operation, ) (string, error)
WaitForVolumeState watches for a desired volume state and returns when that state is achieved.
type ClientConfig ¶
type ClientConfig struct {
// Azure API authentication parameters
azclient.AzureAuthConfig
SubscriptionID string `json:"subscriptionId"`
Location string `json:"location"`
StorageDriverName string
TenantID string `json:"tenantId"`
// Cloud configuration
CloudConfig *CloudConfiguration `json:"cloudConfiguration,omitempty"`
// Options
DebugTraceFlags map[string]bool
SDKTimeout time.Duration // Timeout applied to all calls to the Azure SDK
MaxCacheAge time.Duration // The oldest data we should expect in the cached resources
}
ClientConfig holds configuration data for the API driver object.
type CloudConfiguration ¶
type CloudConfiguration struct {
// Option 1: Predefined cloud name (AzurePublic, AzureChina, AzureGovernment)
CloudName string `json:"cloudName,omitempty"`
// Option 2: Custom cloud configuration (all three must be specified together)
ADAuthorityHost string `json:"adAuthorityHost,omitempty"` // e.g., https://login.chinacloudapi.cn/
Audience string `json:"audience,omitempty"` // e.g., https://management.core.chinacloudapi.cn
Endpoint string `json:"endpoint,omitempty"` // e.g., https://management.chinacloudapi.cn
}
CloudConfiguration allows users to specify Azure cloud environment. Either CloudName (predefined) or custom configuration (ADAuthorityHost, Audience, Endpoint) must be specified.
type ExportPolicy ¶
type ExportPolicy struct {
Rules []ExportRule
}
ExportPolicy records details of a discovered Azure volume export policy.
type ExportRule ¶
type ExportRule struct {
AllowedClients string
Cifs bool
Nfsv3 bool
Nfsv41 bool
RuleIndex int32
UnixReadOnly bool
UnixReadWrite bool
Kerberos5ReadOnly bool
Kerberos5ReadWrite bool
Kerberos5IReadOnly bool
Kerberos5IReadWrite bool
Kerberos5PReadOnly bool
Kerberos5PReadWrite bool
}
ExportRule records details of a discovered Azure volume export policy rule.
type FileSystem ¶
type FileSystem struct {
ID string
ResourceGroup string
NetAppAccount string
CapacityPool string
Name string
FullName string
Location string
Type string
ExportPolicy ExportPolicy
Labels map[string]string
FileSystemID string
ProvisioningState string
CreationToken string
ProtocolTypes []string
QuotaInBytes int64
ServiceLevel string
SnapshotDirectory bool
UsedBytes int
SubnetID string
UnixPermissions string
MountTargets []MountTarget
NetworkFeatures string
KerberosEnabled bool
KeyVaultEndpointID string
Zones []string
MaxThroughput float32
}
FileSystem records details of a discovered Azure Subnet.
type FilesystemCreateRequest ¶
type FilesystemCreateRequest struct {
ResourceGroup string
NetAppAccount string
CapacityPool string
Name string
SubnetID string
CreationToken string
ExportPolicy ExportPolicy
Labels map[string]string
ProtocolTypes []string
QuotaInBytes int64
SnapshotDirectory bool
SnapshotID string
UnixPermissions string
NetworkFeatures string
KerberosEnabled bool
KeyVaultEndpointID string
Zone string
MaxThroughput *float32
}
FilesystemCreateRequest embodies all the details of a volume to be created.
type MountTarget ¶
type MountTarget struct {
MountTargetID string
FileSystemID string
IPAddress string
ServerFqdn string
}
MountTarget records details of a discovered Azure volume mount target.
type NetAppAccount ¶
type NetAppAccount struct {
ID string
ResourceGroup string
Name string
FullName string
Location string
Type string
CapacityPools []*CapacityPool
}
NetAppAccount records details of a discovered ANF NetAppAccount.
type PollerResponse ¶
type PollerResponseCache ¶
type PollerResponseCache interface {
Put(key *PollerKey, value PollerResponse) error
Get(key PollerKey) (PollerResponse, bool)
Delete(key PollerKey)
}
type PollerVolumeCreateResponse ¶
type PollerVolumeCreateResponse struct {
*runtime.Poller[netapp.VolumesClientCreateOrUpdateResponse]
}
type ResourceGroup ¶
type ResourceGroup struct {
Name string
NetAppAccounts []*NetAppAccount
VirtualNetworks []*VirtualNetwork
}
ResourceGroup records details of a discovered Azure ResourceGroup.
type Snapshot ¶
type Snapshot struct {
ID string
ResourceGroup string
NetAppAccount string
CapacityPool string
Volume string
Name string
FullName string
Location string
Type string
Created time.Time
SnapshotID string
ProvisioningState string
}
Snapshot records details of a discovered Azure snapshot.
type Subnet ¶
type Subnet struct {
ID string
ResourceGroup string
VirtualNetwork string
Name string
FullName string
Location string
Type string
}
Subnet records details of a discovered Azure Subnet.
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