### func (*Client) Get Source: https://pkg.go.dev/github.com/dell/gounity/mocks/api Get provides a mock function with given fields: ctx, path, headers, resp. ```go func (_m *Client) Get(ctx context.Context, path string, headers map[string]string, resp interface{}) error ``` -------------------------------- ### GetCapacity Source: https://pkg.go.dev/github.com/dell/gounity Gets system-level capacity metrics. ```go func (c *UnityClientImpl) GetCapacity(ctx context.Context) (*types.SystemCapacityMetricsQueryResult, error) ``` -------------------------------- ### LicenseInfoContent struct for features on array Source: https://pkg.go.dev/github.com/dell/gounity/apitypes Captures license installation and validity flags. ```go type LicenseInfoContent struct { IsInstalled bool `json:"isInstalled"` IsValid bool `json:"isValid"` } ``` -------------------------------- ### GetCapacity Source: https://pkg.go.dev/github.com/dell/gounity Get system capacity metrics. ```APIDOC ## GetCapacity ### Description Get Unity capacity metrics at the system level. ### Method FUNCTION ### Endpoint func (c *UnityClientImpl) GetCapacity(ctx context.Context) (*types.SystemCapacityMetricsQueryResult, error) ### Parameters - **ctx** (context.Context) - Required - Context for the request ### Response - **SystemCapacityMetricsQueryResult** (*types.SystemCapacityMetricsQueryResult) - Capacity metrics result - **error** (error) - Error if the operation fails ``` -------------------------------- ### GetAllNFSServers Source: https://pkg.go.dev/github.com/dell/gounity Get all NFS servers. ```APIDOC ## GetAllNFSServers ### Description Get all NFS servers. ### Method FUNCTION ### Endpoint func (c *UnityClientImpl) GetAllNFSServers(ctx context.Context) (*types.NFSServersResponse, error) ### Parameters - **ctx** (context.Context) - Required - Context for the request ### Response - **NFSServersResponse** (*types.NFSServersResponse) - Response containing NFS servers - **error** (error) - Error if the operation fails ``` -------------------------------- ### GET Get Source: https://pkg.go.dev/github.com/dell/gounity/api Sends an HTTP GET request to the specified path with the provided headers and populates the response object. ```APIDOC ## GET Get ### Description Sends an HTTP request using the GET method to the API. ### Method GET ### Endpoint path ### Parameters #### Path Parameters - **path** (string) - Required - The API path to send the request to. #### Headers - **headers** (map[string]string) - Required - HTTP headers to include in the request. #### Request Body - **resp** (interface{}) - Required - The response object to populate with the API response. ### Request Example ```go client.Get(ctx, "/api/v1/instances", headers, &resp) ``` ### Response #### Success Response (200) - **resp** (interface{}) - The response data. #### Response Example ```json {} ``` ``` -------------------------------- ### GetAllRealTimeMetricPaths Source: https://pkg.go.dev/github.com/dell/gounity Get all real-time metric paths. ```APIDOC ## GetAllRealTimeMetricPaths ### Description Get all Unity Metric paths. Consider using for debugging or enumerating metrics. This will take a bit of time to complete. ### Method FUNCTION ### Endpoint func (c *UnityClientImpl) GetAllRealTimeMetricPaths(ctx context.Context) error ### Parameters - **ctx** (context.Context) - Required - Context for the request ### Response - **error** (error) - Error if the operation fails ``` -------------------------------- ### Client.Get Source: https://pkg.go.dev/github.com/dell/gounity/mocks/api Mock method for performing an HTTP GET request. It takes a context, path, headers, and a response object. ```APIDOC ## Client.Get ### Description Mock method for performing an HTTP GET request. It takes a context, path, headers, and a response object. ### Signature ```go func (_m *Client) Get(ctx context.Context, path string, headers map[string]string, resp interface{}) error ``` ### Parameters - **ctx** (context.Context) - Required - The request context. - **path** (string) - Required - The request path. - **headers** (map[string]string) - Required - The request headers. - **resp** (interface{}) - Required - The response object to populate. ### Returns - **error** - An error if the request fails. ``` -------------------------------- ### GetAllRealTimeMetricPaths Source: https://pkg.go.dev/github.com/dell/gounity Gets all Unity metric paths. This operation may take time and is useful for debugging or enumeration. ```go func (c *UnityClientImpl) GetAllRealTimeMetricPaths(ctx context.Context) error ``` -------------------------------- ### BasicSystemInfo method Source: https://pkg.go.dev/github.com/dell/gounity/mocks Mock method for BasicSystemInfo, taking a context and a *gounity.ConfigConnect. ```go func (_m *UnityClient) BasicSystemInfo(ctx context.Context, configConnect *gounity.ConfigConnect) error ``` -------------------------------- ### CreateFilesystem mock method Source: https://pkg.go.dev/github.com/dell/gounity/mocks Mock function for creating a filesystem. Takes context, name, storage pool, description, NAS server, size, tiering policy, host I/O size, supported protocol, thin provisioning, and data reduction flags. Returns a Filesystem pointer and error. ```go func (_m *UnityClient) CreateFilesystem(ctx context.Context, name string, storagepool string, description string, nasServer string, size uint64, tieringPolicy int, hostIOSize int, supportedProtocol int, isThinEnabled bool, isDataReductionEnabled bool) (*types.Filesystem, error) ``` -------------------------------- ### CreateHost method Source: https://pkg.go.dev/github.com/dell/gounity Creates a new Host. ```go func (c *UnityClientImpl) CreateHost(ctx context.Context, hostName string, tenantID string) (*types.Host, error) ``` -------------------------------- ### CreateFilesystem method Source: https://pkg.go.dev/github.com/dell/gounity Creates a new filesystem on the array. ```go func (c *UnityClientImpl) CreateFilesystem(ctx context.Context, name, storagepool, description, nasServer string, size uint64, tieringPolicy, hostIOSize, supportedProtocol int, isThinEnabled, isDataReductionEnabled bool) (*types.Filesystem, error) ``` -------------------------------- ### CreateHost mock method Source: https://pkg.go.dev/github.com/dell/gounity/mocks Mock function for creating a host. Takes context, host name, and tenant ID. Returns a Host pointer and error. ```go func (_m *UnityClient) CreateHost(ctx context.Context, hostName string, tenantID string) (*types.Host, error) ``` -------------------------------- ### HostInitiatorContent Struct Source: https://pkg.go.dev/github.com/dell/gounity/apitypes Captures host initiator parameters. ```go type HostInitiatorContent struct { ID string `json:"id"` Health HealthContent `json:"health"` Type int `json:"type"` InitiatorID string `json:"InitiatorId"` IsIgnored bool `json:"isIgnored"` ParentHost HostContent `json:"parentHost"` Paths []Path `json:"paths"` } ``` -------------------------------- ### CreateHostInitiator mock method Source: https://pkg.go.dev/github.com/dell/gounity/mocks Mock function for creating a host initiator. Takes context, host ID, WWN or IQN, and initiator type. Returns a HostInitiator pointer and error. ```go func (_m *UnityClient) CreateHostInitiator(ctx context.Context, hostID string, wwnOrIqn string, initiatorType types.InitiatorType) (*types.HostInitiator, error) ``` -------------------------------- ### GetFilesystemIDFromResID Source: https://pkg.go.dev/github.com/dell/gounity Get the filesystem ID from a resource ID. ```APIDOC ## GetFilesystemIDFromResID ### Description Returns the filesystem ID for the filesystem. ### Method FUNCTION ### Endpoint func (c *UnityClientImpl) GetFilesystemIDFromResID(ctx context.Context, filesystemResID string) (string, error) ### Parameters - **ctx** (context.Context) - Required - Context for the request - **filesystemResID** (string) - Required - Resource ID of the filesystem ### Response - **string** (string) - The filesystem ID - **error** (error) - Error if the operation fails ``` -------------------------------- ### UnityClient GetAllNFSServers Source: https://pkg.go.dev/github.com/dell/gounity/mocks Provides a mock function with given fields: ctx. ```go func (_m *UnityClient) GetAllNFSServers(ctx context.Context) (*types.NFSServersResponse, error) ``` -------------------------------- ### GetMetricsCollection Source: https://pkg.go.dev/github.com/dell/gounity Get metrics collection for a given query ID. ```APIDOC ## GetMetricsCollection ### Description Get Unity MetricsCollection of the provided 'queryID'. The MetricCollection should exist already or you can create one using CreateXXXMetricsQuery. ### Method FUNCTION ### Endpoint func (c *UnityClientImpl) GetMetricsCollection(ctx context.Context, queryID int) (*types.MetricQueryResult, error) ### Parameters - **ctx** (context.Context) - Required - Context for the request - **queryID** (int) - Required - ID of the metric query ### Response - **MetricQueryResult** (*types.MetricQueryResult) - Metric query result - **error** (error) - Error if the operation fails ``` -------------------------------- ### GetMaxVolumeSize Source: https://pkg.go.dev/github.com/dell/gounity Get the maximum volume size supported by the array. ```APIDOC ## GetMaxVolumeSize ### Description Returns the max size of a volume supported by the array. ### Method FUNCTION ### Endpoint func (c *UnityClientImpl) GetMaxVolumeSize(ctx context.Context, systemLimitID string) (*types.MaxVolumSizeInfo, error) ### Parameters - **ctx** (context.Context) - Required - Context for the request - **systemLimitID** (string) - Required - ID of the system limit ### Response - **MaxVolumSizeInfo** (*types.MaxVolumSizeInfo) - Maximum volume size information - **error** (error) - Error if the operation fails ``` -------------------------------- ### ListHostInitiators Source: https://pkg.go.dev/github.com/dell/gounity Lists all host initiators. ```go func (c *UnityClientImpl) ListHostInitiators(ctx context.Context) ([]types.HostInitiator, error) ``` -------------------------------- ### CreateHostInitiator method Source: https://pkg.go.dev/github.com/dell/gounity Creates a Host Initiator. ```go func (c *UnityClientImpl) CreateHostInitiator(ctx context.Context, hostID, wwnOrIqn string, initiatorType types.InitiatorType) (*types.HostInitiator, error) ``` -------------------------------- ### GetMetricsCollection Source: https://pkg.go.dev/github.com/dell/gounity Gets the metrics collection for a specific query ID. The collection must exist or be created beforehand. ```go func (c *UnityClientImpl) GetMetricsCollection(ctx context.Context, queryID int) (*types.MetricQueryResult, error) ``` -------------------------------- ### CreteLunThinClone method Source: https://pkg.go.dev/github.com/dell/gounity Creates a LUN thin clone. ```go func (c *UnityClientImpl) CreteLunThinClone(ctx context.Context, name, snapID, volID string) (*types.Volume, error) ``` -------------------------------- ### CreateHostIPPort method Source: https://pkg.go.dev/github.com/dell/gounity Creates a Host IP Port. ```go func (c *UnityClientImpl) CreateHostIPPort(ctx context.Context, hostID, ip string) (*types.HostIPPort, error) ``` -------------------------------- ### CreateRealTimeMetricsQuery Source: https://pkg.go.dev/github.com/dell/gounity CreateRealTimeMetricsQuery create an MetricRealTime Collection of the given metric paths and collection interval. The GetMetricsCollection interface can be called to retrieve results. Example: POST api/types/metricRealTimeQuery/instances BODY: { "paths": ["sp.*.cpu.summary.busyTicks" ,"sp.*.cpu.summary.idleTicks"], "interval": 5 } ```APIDOC ## CreateRealTimeMetricsQuery ### Description CreateRealTimeMetricsQuery create an MetricRealTime Collection of the given metric paths and collection interval. The GetMetricsCollection interface can be called to retrieve results. Example: POST api/types/metricRealTimeQuery/instances BODY: { "paths": ["sp.*.cpu.summary.busyTicks" ,"sp.*.cpu.summary.idleTicks"], "interval": 5 } ### Method POST ### Endpoint /api/types/metricRealTimeQuery/instances ### Parameters #### Request Body - **metricPaths** (array of string) - Required - Array of metric paths - **interval** (int) - Required - Collection interval in seconds ### Response #### Success Response (200) - **metricQueryCreateResponse** (types.MetricQueryCreateResponse) - The created metric query #### Response Example { "metricQueryCreateResponse": {} } ``` -------------------------------- ### CreateHostIPPort mock method Source: https://pkg.go.dev/github.com/dell/gounity/mocks Mock function for creating a host IP port. Takes context, host ID, and IP address. Returns a HostIPPort pointer and error. ```go func (_m *UnityClient) CreateHostIPPort(ctx context.Context, hostID string, ip string) (*types.HostIPPort, error) ``` -------------------------------- ### UnityClient ListHostInitiators Source: https://pkg.go.dev/github.com/dell/gounity/mocks Provides a mock function with given fields: ctx. ```go func (_m *UnityClient) ListHostInitiators(ctx context.Context) ([]types.HostInitiator, error) ``` -------------------------------- ### UnityClient ListIscsiIPInterfaces Source: https://pkg.go.dev/github.com/dell/gounity/mocks Provides a mock function with given fields: ctx. ```go func (_m *UnityClient) ListIscsiIPInterfaces(ctx context.Context) ([]types.IPInterfaceEntries, error) ``` -------------------------------- ### FsCreateParam struct Source: https://pkg.go.dev/github.com/dell/gounity/apitypes Captures the filesystem create parameters. ```go type FsCreateParam struct { Name string `json:"name"` Description string `json:"description,omitempty"` FsParameters *FsParameters `json:"fsParameters"` } ``` -------------------------------- ### CreateLun mock method Source: https://pkg.go.dev/github.com/dell/gounity/mocks Mock function for creating a LUN. Takes context, name, pool ID, description, size, fast VP tiering policy, host I/O limit ID, thin provisioning, and data reduction flags. Returns a Volume pointer and error. ```go func (_m *UnityClient) CreateLun(ctx context.Context, name string, poolID string, description string, size uint64, fastVPTieringPolicy int, hostIOLimitID string, isThinEnabled bool, isDataReductionEnabled bool) (*types.Volume, error) ``` -------------------------------- ### CreateCloneFromVolume method Source: https://pkg.go.dev/github.com/dell/gounity/mocks Mock method for CreateCloneFromVolume, taking a context, name, and volume ID. ```go func (_m *UnityClient) CreateCloneFromVolume(ctx context.Context, name string, volID string) (*types.Volume, error) ``` -------------------------------- ### NewClient function Source: https://pkg.go.dev/github.com/dell/gounity Initializes a new REST client with default options. Returns a UnityClient interface and an error. ```go func NewClient(ctx context.Context) (UnityClient, error) ``` -------------------------------- ### HostInitiatorPathContent Struct Source: https://pkg.go.dev/github.com/dell/gounity/apitypes Captures host initiator path parameters. ```go type HostInitiatorPathContent struct { FcPortID FcPortID `json:"fcPort"` } ``` -------------------------------- ### New Source: https://pkg.go.dev/github.com/dell/gounity/api Creates a new API client with the specified host, options, and debug flag. ```APIDOC ## New ### Description Returns a new API client. ### Method N/A ### Endpoint N/A ### Parameters #### Request Body - **host** (string) - Required - The host URL for the API. - **opts** (ClientOptions) - Required - Options for the client. - **debug** (bool) - Required - Whether to enable debug logging. ### Request Example ```go client, err := New(ctx, "https://api.example.com", ClientOptions{Insecure: false, Timeout: 30 * time.Second, ShowHTTP: false}, false) ``` ### Response #### Success Response (200) - **client** (Client) - The new API client. - **err** (error) - An error if the client could not be created. #### Response Example ```json {} ``` ``` -------------------------------- ### CreateFilesystem Source: https://pkg.go.dev/github.com/dell/gounity CreateFilesystem - Create a new filesystem on the array ```APIDOC ## CreateFilesystem ### Description CreateFilesystem - Create a new filesystem on the array ### Method POST ### Endpoint /api/types/filesystem/instances ### Parameters #### Request Body - **name** (string) - Required - Name of the filesystem - **storagepool** (string) - Required - Storage pool for the filesystem - **description** (string) - Required - Description of the filesystem - **nasServer** (string) - Required - NAS server for the filesystem - **size** (uint64) - Required - Size of the filesystem in bytes - **tieringPolicy** (int) - Required - Tiering policy - **hostIOSize** (int) - Required - Host I/O size - **supportedProtocol** (int) - Required - Supported protocol - **isThinEnabled** (bool) - Required - Whether thin provisioning is enabled - **isDataReductionEnabled** (bool) - Required - Whether data reduction is enabled ### Response #### Success Response (200) - **filesystem** (types.Filesystem) - The created filesystem #### Response Example { "filesystem": {} } ``` -------------------------------- ### HostCreateParam Struct Source: https://pkg.go.dev/github.com/dell/gounity/apitypes Captures the Host creation request. ```go type HostCreateParam struct { Type string `json:"type"` Name string `json:"name"` Description string `json:"description"` OsType string `json:"osType"` Tenant *Tenants `json:"tenant,omitempty"` } ``` -------------------------------- ### General Constants Source: https://pkg.go.dev/github.com/dell/gounity Constants for LUN and filesystem configuration limits and license types. ```go const ( LunNameMaxLength = 63 SnapForClone = "csi-snapforclone-" ThinProvisioning LicenseType = "THIN_PROVISIONING" DataReduction LicenseType = "DATA_REDUCTION" ) ``` -------------------------------- ### HostInitiatorCreateParam Struct Source: https://pkg.go.dev/github.com/dell/gounity/apitypes Captures Host Initiator creation parameters. ```go type HostInitiatorCreateParam struct { HostIDContent *HostIDContent `json:"host"` InitiatorType InitiatorType `json:"initiatorType"` InitiatorWwn string `json:"initiatorWWNorIqn"` } ``` -------------------------------- ### UnityClient ListHosts Source: https://pkg.go.dev/github.com/dell/gounity/mocks Provides a mock function with given fields: ctx. ```go func (_m *UnityClient) ListHosts(ctx context.Context) ([]types.Host, error) ``` -------------------------------- ### ExpandFilesystem Mock Source: https://pkg.go.dev/github.com/dell/gounity/mocks Provides a mock function for expanding a filesystem to a new size. ```go func (_m *UnityClient) ExpandFilesystem(ctx context.Context, filesystemID string, newSize uint64) error ``` -------------------------------- ### CreateHost Source: https://pkg.go.dev/github.com/dell/gounity CreateHost Create a new Host ```APIDOC ## CreateHost ### Description CreateHost Create a new Host ### Method POST ### Endpoint /api/types/host/instances ### Parameters #### Request Body - **hostName** (string) - Required - Name of the host - **tenantID** (string) - Required - Tenant ID for the host ### Response #### Success Response (200) - **host** (types.Host) - The created host #### Response Example { "host": {} } ``` -------------------------------- ### ListHosts Source: https://pkg.go.dev/github.com/dell/gounity Lists all hosts. ```go func (c *UnityClientImpl) ListHosts(ctx context.Context) ([]types.Host, error) ``` -------------------------------- ### CreateNFSShare method Source: https://pkg.go.dev/github.com/dell/gounity Creates an NFS Share for a filesystem. ```go func (c *UnityClientImpl) CreateNFSShare(ctx context.Context, name, path, filesystemID string, nfsShareDefaultAccess NFSShareDefaultAccess) (*types.Filesystem, error) ``` -------------------------------- ### CreteLunThinClone mock method Source: https://pkg.go.dev/github.com/dell/gounity/mocks Mock function for creating a thin clone of a LUN. Takes context, name, snapshot ID, and volume ID. Returns a Volume pointer and error. ```go func (_m *UnityClient) CreteLunThinClone(ctx context.Context, name string, snapID string, volID string) (*types.Volume, error) ``` -------------------------------- ### FsExpandParameters struct Source: https://pkg.go.dev/github.com/dell/gounity/apitypes Captures parameters for expanding a filesystem. ```go type FsExpandParameters struct { Size uint64 `json:"size"` } ``` -------------------------------- ### CreateCloneFromVolume method Source: https://pkg.go.dev/github.com/dell/gounity CreateCloneFromVolume performs volume cloning. Added in v1.21.0. ```go func (c *UnityClientImpl) CreateCloneFromVolume(ctx context.Context, name, volID string) (*types.Volume, error) ``` -------------------------------- ### UnityClient GetAllRealTimeMetricPaths Source: https://pkg.go.dev/github.com/dell/gounity/mocks Provides a mock function with given fields: ctx. ```go func (_m *UnityClient) GetAllRealTimeMetricPaths(ctx context.Context) error ``` -------------------------------- ### UnityClient ListVolumes Source: https://pkg.go.dev/github.com/dell/gounity/mocks Provides a mock function with given fields: ctx, startToken, maxEntries. ```go func (_m *UnityClient) ListVolumes(ctx context.Context, startToken int, maxEntries int) ([]types.Volume, int, error) ``` -------------------------------- ### HostInitiator Struct Source: https://pkg.go.dev/github.com/dell/gounity/apitypes Captures the host initiator object. ```go type HostInitiator struct { HostInitiatorContent HostInitiatorContent `json:"content"` } ``` -------------------------------- ### NewClientWithArgs function Source: https://pkg.go.dev/github.com/dell/gounity Initializes a new REST client with the given endpoint and insecure flag. Returns a UnityClient interface and an error. ```go func NewClientWithArgs(ctx context.Context, endpoint string, insecure bool) (UnityClient, error) ``` -------------------------------- ### HostInitiatorPath Struct Source: https://pkg.go.dev/github.com/dell/gounity/apitypes Captures the host initiator path object. ```go type HostInitiatorPath struct { HostInitiatorPathContent HostInitiatorPathContent `json:"content"` } ``` -------------------------------- ### func (*Client) Post Source: https://pkg.go.dev/github.com/dell/gounity/mocks/api Post provides a mock function with given fields: ctx, path, headers, body, resp. ```go func (_m *Client) Post(ctx context.Context, path string, headers map[string]string, body interface{}, resp interface{}) error ``` -------------------------------- ### LunCreateParam struct for LUN create parameters Source: https://pkg.go.dev/github.com/dell/gounity/apitypes Captures LUN creation parameters including name, description, and lunParameters. ```go type LunCreateParam struct { Name string `json:"name"` Description string `json:"description,omitempty"` LunParameters *LunParameters `json:"lunParameters"` } ``` -------------------------------- ### CreateSnapshot method Source: https://pkg.go.dev/github.com/dell/gounity Creates a snapshot of a volume. Returns an error if the creation fails. ```go func (c *UnityClientImpl) CreateSnapshot(ctx context.Context, storageResourceID, snapshotName, description, retentionDuration string) (*types.Snapshot, error) ``` -------------------------------- ### CreateNFSShare mock method Source: https://pkg.go.dev/github.com/dell/gounity/mocks Mock function for creating an NFS share. Takes context, name, path, filesystem ID, and default access. Returns a Filesystem pointer and error. ```go func (_m *UnityClient) CreateNFSShare(ctx context.Context, name string, path string, filesystemID string, nfsShareDefaultAccess gounity.NFSShareDefaultAccess) (*types.Filesystem, error) ``` -------------------------------- ### UnityClient Interface Source: https://pkg.go.dev/github.com/dell/gounity This section documents the UnityClient interface and its methods for interacting with Dell Unity storage systems. ```APIDOC ## NewClient ### Description NewClient initialize the new REST Client with default options. ### Method FUNCTION ### Endpoint NewClient(ctx context.Context) (UnityClient, error) ### Parameters #### Parameters - **ctx** (context.Context) - Required - Context for the operation ### Response #### Success Response - **UnityClient** (UnityClient) - The client instance - **error** (error) - Error if any ### Response Example ```go client, err := NewClient(ctx) ``` ## NewClientWithArgs ### Description NewClientWithArgs initialize the new REST Client with the given arguments. ### Method FUNCTION ### Endpoint NewClientWithArgs(ctx context.Context, endpoint string, insecure bool) (UnityClient, error) ### Parameters #### Parameters - **ctx** (context.Context) - Required - Context for the operation - **endpoint** (string) - Required - The endpoint URL - **insecure** (bool) - Required - Whether to skip TLS verification ### Response #### Success Response - **UnityClient** (UnityClient) - The client instance - **error** (error) - Error if any ### Response Example ```go client, err := NewClientWithArgs(ctx, "https://example.com", false) ``` ## Authenticate ### Description Authenticate make a REST API call [/loginSessionInfo] to Unity to get authenticate the given credentials. The response contains the EMC-CSRF-TOKEN and the client caches it for further communication. ### Method FUNCTION ### Endpoint Authenticate(ctx context.Context, configConnect *ConfigConnect) error ### Parameters #### Parameters - **ctx** (context.Context) - Required - Context for the operation - **configConnect** (*ConfigConnect) - Required - Connection configuration containing credentials ### Response #### Success Response - **error** (error) - Error if any ### Response Example ```go err := client.Authenticate(ctx, configConnect) ``` ## BasicSystemInfo ### Description BasicSystemInfo make a REST API call [/basicSystemInfo/instances] to Unity to check if array is responding. ### Method FUNCTION ### Endpoint BasicSystemInfo(ctx context.Context, configConnect *ConfigConnect) error ### Parameters #### Parameters - **ctx** (context.Context) - Required - Context for the operation - **configConnect** (*ConfigConnect) - Required - Connection configuration ### Response #### Success Response - **error** (error) - Error if any ### Response Example ```go err := client.BasicSystemInfo(ctx, configConnect) ``` ## CopySnapshot ### Description CopySnapshot - Creates a copy of the source snapshot which can be used for NFS export, and returns the ID of the copy snapshot. ### Method FUNCTION ### Endpoint CopySnapshot(ctx context.Context, sourceSnapshotID, name string) (*types.Snapshot, error) ### Parameters #### Parameters - **ctx** (context.Context) - Required - Context for the operation - **sourceSnapshotID** (string) - Required - ID of the source snapshot - **name** (string) - Required - Name for the copy snapshot ### Response #### Success Response - **types.Snapshot** (*types.Snapshot) - The created snapshot - **error** (error) - Error if any ### Response Example ```go snapshot, err := client.CopySnapshot(ctx, "snap123", "copy1") ``` ## CreateCloneFromVolume ### Description CreateCloneFromVolume - Volume cloning. ### Method FUNCTION ### Endpoint CreateCloneFromVolume(ctx context.Context, name, volID string) (*types.Volume, error) ### Parameters #### Parameters - **ctx** (context.Context) - Required - Context for the operation - **name** (string) - Required - Name for the clone - **volID** (string) - Required - ID of the source volume ### Response #### Success Response - **types.Volume** (*types.Volume) - The created clone volume - **error** (error) - Error if any ### Response Example ```go volume, err := client.CreateCloneFromVolume(ctx, "clone1", "vol123") ``` ``` -------------------------------- ### Authenticate method Source: https://pkg.go.dev/github.com/dell/gounity/mocks Mock method for Authenticate, taking a context and a *gounity.ConfigConnect. ```go func (_m *UnityClient) Authenticate(ctx context.Context, configConnect *gounity.ConfigConnect) error ``` -------------------------------- ### FindHostInitiatorByName Mock Source: https://pkg.go.dev/github.com/dell/gounity/mocks Provides a mock function for finding a host initiator by its name (WWN or IQN). ```go func (_m *UnityClient) FindHostInitiatorByName(ctx context.Context, wwnOrIqn string) (*types.HostInitiator, error) ``` -------------------------------- ### FindHostInitiatorByID Source: https://pkg.go.dev/github.com/dell/gounity Finds a host initiator by its WWN or IQN. ```go func (c *UnityClientImpl) FindHostInitiatorByID(ctx context.Context, wwnOrIqn string) (*types.HostInitiator, error) ``` -------------------------------- ### NewUnityClient constructor Source: https://pkg.go.dev/github.com/dell/gounity/mocks Creates a new UnityClient mock instance. It registers a testing interface and a cleanup function to assert expectations. The first argument is typically a *testing.T value. ```go func NewUnityClient(t interface { mock.TestingT Cleanup(func()) }, ) *UnityClient ``` -------------------------------- ### UnityClient GetToken Source: https://pkg.go.dev/github.com/dell/gounity/mocks Provides a mock function with no fields. ```go func (_m *UnityClient) GetToken() string ``` -------------------------------- ### CreateNFSShareFromSnapshot method Source: https://pkg.go.dev/github.com/dell/gounity Creates an NFS Share for a filesystem snapshot. ```go func (c *UnityClientImpl) CreateNFSShareFromSnapshot(ctx context.Context, name, path, snapshotID string, nfsShareDefaultAccess NFSShareDefaultAccess) (*types.NFSShare, error) ``` -------------------------------- ### CreateSnapshotWithFsAccesType method Source: https://pkg.go.dev/github.com/dell/gounity Creates a snapshot with a specified FilesystemAccessType. ```go func (c *UnityClientImpl) CreateSnapshotWithFsAccesType(ctx context.Context, storageResourceID, snapshotName, _, retentionDuration string, filesystemAccessType FilesystemAccessType) (*types.Snapshot, error) ``` -------------------------------- ### ListHostInitiators Source: https://pkg.go.dev/github.com/dell/gounity List all host initiators. ```APIDOC ## ListHostInitiators ### Description List all host initiators. ### Method FUNCTION ### Endpoint func (c *UnityClientImpl) ListHostInitiators(ctx context.Context) ([]types.HostInitiator, error) ### Parameters - **ctx** (context.Context) - Required - Context for the request ### Response - **[]types.HostInitiator** ([]types.HostInitiator) - List of host initiators - **error** (error) - Error if the operation fails ``` -------------------------------- ### FileEventSettings struct Source: https://pkg.go.dev/github.com/dell/gounity/apitypes Captures file event settings. ```go type FileEventSettings struct { IsCIFSEnabled bool `json:"isCIFSEnabled"` IsNFSEnabled bool `json:"isNFSEnabled"` } ``` -------------------------------- ### CreateSnapshot mock method Source: https://pkg.go.dev/github.com/dell/gounity/mocks Mock function for creating a snapshot. Takes context, storage resource ID, snapshot name, description, and retention duration. Returns a Snapshot pointer and error. ```go func (_m *UnityClient) CreateSnapshot(ctx context.Context, storageResourceID string, snapshotName string, description string, retentionDuration string) (*types.Snapshot, error) ``` -------------------------------- ### ListVolumes method Source: https://pkg.go.dev/github.com/dell/gounity Lists volumes. ```go func (c *UnityClientImpl) ListVolumes(ctx context.Context, startToken int, maxEntries int) ([]types.Volume, int, error) ``` -------------------------------- ### UnityClient ListSnapshots Source: https://pkg.go.dev/github.com/dell/gounity/mocks Provides a mock function with given fields: ctx, startToken, maxEntries, sourceVolumeID, snapshotID. ```go func (_m *UnityClient) ListSnapshots(ctx context.Context, startToken int, maxEntries int, sourceVolumeID string, snapshotID string) ([]types.Snapshot, int, error) ``` -------------------------------- ### MarkFilesystemForDeletion Variable Source: https://pkg.go.dev/github.com/dell/gounity Stores the marker string for filesystem deletion. ```go var MarkFilesystemForDeletion = "csi-marked-filesystem-for-deletion(do not remove this from description)" ``` -------------------------------- ### UnityClient GetCapacity Source: https://pkg.go.dev/github.com/dell/gounity/mocks Provides a mock function with given fields: ctx. ```go func (_m *UnityClient) GetCapacity(ctx context.Context) (*types.SystemCapacityMetricsQueryResult, error) ``` -------------------------------- ### BasicSystemInfo method Source: https://pkg.go.dev/github.com/dell/gounity BasicSystemInfo makes a REST API call to /basicSystemInfo/instances to check if the array is responding. Added in v1.21.0. ```go func (c *UnityClientImpl) BasicSystemInfo(ctx context.Context, configConnect *ConfigConnect) error ``` -------------------------------- ### CreateHostInitiator Source: https://pkg.go.dev/github.com/dell/gounity CreateHostInitiator - Create Host Initiator ```APIDOC ## CreateHostInitiator ### Description CreateHostInitiator - Create Host Initiator ### Method POST ### Endpoint /api/types/hostInitiator/instances ### Parameters #### Request Body - **hostID** (string) - Required - ID of the host - **wwnOrIqn** (string) - Required - WWN or IQN of the initiator - **initiatorType** (types.InitiatorType) - Required - Type of the initiator ### Response #### Success Response (200) - **hostInitiator** (types.HostInitiator) - The created host initiator #### Response Example { "hostInitiator": {} } ``` -------------------------------- ### CreateSnapshotWithFsAccesType mock method Source: https://pkg.go.dev/github.com/dell/gounity/mocks Mock function for creating a snapshot with filesystem access type. Takes context, storage resource ID, snapshot name, a string parameter, retention duration, and filesystem access type. Returns a Snapshot pointer and error. ```go func (_m *UnityClient) CreateSnapshotWithFsAccesType(ctx context.Context, storageResourceID string, snapshotName string, _a3 string, retentionDuration string, filesystemAccessType gounity.FilesystemAccessType) (*types.Snapshot, error) ``` -------------------------------- ### FileContent struct Source: https://pkg.go.dev/github.com/dell/gounity/apitypes Captures filesystem parameters. ```go type FileContent struct { ID string `json:"id"` Name string `json:"name,omitempty"` SizeTotal uint64 `json:"sizeTotal,omitempty"` Description string `json:"description,omitempty"` Type int `json:"type,omitempty"` Format int `json:"format,omitempty"` HostIOSize int64 `json:"hostIOSize,omitempty"` TieringPolicy uint64 `json:"tieringPolicy,omitempty"` IsThinEnabled bool `json:"isThinEnabled"` IsDataReductionEnabled bool `json:"isDataReductionEnabled"` Pool Pool `json:"pool,omitempty"` NASServer Pool `json:"nasServer,omitempty"` StorageResource Pool `json:"storageResource,omitempty"` NFSShare []Share `json:"nfsShare,omitempty"` CIFSShare []Pool `json:"cifsShare,omitempty"` Health HealthContent `json:"health,omitempty"` } ``` -------------------------------- ### HostContent Struct Source: https://pkg.go.dev/github.com/dell/gounity/apitypes Captures host parameters. ```go type HostContent struct { ID string `json:"id"` Name string `json:"name,omitempty"` Description string `json:"description,omitempty"` FcInitiators []Initiators `json:"fcHostInitiators,omitempty"` IscsiInitiators []Initiators `json:"iscsiHostInitiators,omitempty"` IPPorts []IPPorts `json:"hostIPPorts,omitempty"` Address string `json:"address,omitempty"` } ``` -------------------------------- ### FastVPParameters struct Source: https://pkg.go.dev/github.com/dell/gounity/apitypes Captures the tiering policy for creating a volume. ```go type FastVPParameters struct { TieringPolicy int `json:"tieringPolicy"` } ``` -------------------------------- ### UnityClient GetMaxVolumeSize Source: https://pkg.go.dev/github.com/dell/gounity/mocks Provides a mock function with given fields: ctx, systemLimitID. ```go func (_m *UnityClient) GetMaxVolumeSize(ctx context.Context, systemLimitID string) (*types.MaxVolumSizeInfo, error) ``` -------------------------------- ### UnityClient FindVolumeByName Source: https://pkg.go.dev/github.com/dell/gounity/mocks Provides a mock function with given fields: ctx, volName. ```go func (_m *UnityClient) FindVolumeByName(ctx context.Context, volName string) (*types.Volume, error) ``` -------------------------------- ### CreateRealTimeMetricsQuery mock method Source: https://pkg.go.dev/github.com/dell/gounity/mocks Mock function for creating a real-time metrics query. Takes context, metric paths, and interval. Returns a MetricQueryCreateResponse pointer and error. ```go func (_m *UnityClient) CreateRealTimeMetricsQuery(ctx context.Context, metricPaths []string, interval int) (*types.MetricQueryCreateResponse, error) ``` -------------------------------- ### FindHostInitiatorByID Mock Source: https://pkg.go.dev/github.com/dell/gounity/mocks Provides a mock function for finding a host initiator by its WWN or IQN. ```go func (_m *UnityClient) FindHostInitiatorByID(ctx context.Context, wwnOrIqn string) (*types.HostInitiator, error) ``` -------------------------------- ### Filesystem struct Source: https://pkg.go.dev/github.com/dell/gounity/apitypes Captures the filesystem object. ```go type Filesystem struct { FileContent FileContent `json:"content"` } ``` -------------------------------- ### CreateNFSShareFromSnapshot mock method Source: https://pkg.go.dev/github.com/dell/gounity/mocks Mock function for creating an NFS share from a snapshot. Takes context, name, path, snapshot ID, and default access. Returns an NFSShare pointer and error. ```go func (_m *UnityClient) CreateNFSShareFromSnapshot(ctx context.Context, name string, path string, snapshotID string, nfsShareDefaultAccess gounity.NFSShareDefaultAccess) (*types.NFSShare, error) ``` -------------------------------- ### SetToken method Source: https://pkg.go.dev/github.com/dell/gounity Sets the token. ```go func (c *UnityClientImpl) SetToken(token string) ``` -------------------------------- ### HostAccess Struct Source: https://pkg.go.dev/github.com/dell/gounity/apitypes Captures Host access parameters. ```go type HostAccess struct { HostIDContent *HostIDContent `json:"host"` AccessMask string `json:"accessMask,omitempty"` } ``` -------------------------------- ### FindFilesystemByName Mock Source: https://pkg.go.dev/github.com/dell/gounity/mocks Provides a mock function for finding a filesystem by its name. ```go func (_m *UnityClient) FindFilesystemByName(ctx context.Context, filesystemName string) (*types.Filesystem, error) ``` -------------------------------- ### CreateLun method Source: https://pkg.go.dev/github.com/dell/gounity Creates a LUN with the given arguments. The LUN name must be less than 63 characters, and the size must be in bytes. ```go func (c *UnityClientImpl) CreateLun(ctx context.Context, name, poolID, description string, size uint64, fastVPTieringPolicy int, hostIOLimitID string, isThinEnabled, isDataReductionEnabled bool, ) (*types.Volume, error) ``` -------------------------------- ### GetAllNFSServers Source: https://pkg.go.dev/github.com/dell/gounity Retrieves all NFS servers. ```go func (c *UnityClientImpl) GetAllNFSServers(ctx context.Context) (*types.NFSServersResponse, error) ``` -------------------------------- ### UnityClientImpl struct Source: https://pkg.go.dev/github.com/dell/gounity UnityClientImpl struct holds the configuration and REST client. Added in v1.21.0. ```go type UnityClientImpl struct { // contains filtered or unexported fields } ``` -------------------------------- ### ExpandFilesystem Source: https://pkg.go.dev/github.com/dell/gounity Expands a filesystem to the provided capacity. ```go func (c *UnityClientImpl) ExpandFilesystem(ctx context.Context, filesystemID string, newSize uint64) error ``` -------------------------------- ### ExportVolume Mock Source: https://pkg.go.dev/github.com/dell/gounity/mocks Provides a mock function for exporting a volume to a specific host. ```go func (_m *UnityClient) ExportVolume(ctx context.Context, volID string, hostID string) error ``` -------------------------------- ### TenantInfo struct for tenant info Source: https://pkg.go.dev/github.com/dell/gounity/apitypes Defines the TenantInfo struct with an Entries slice for capturing tenant info. ```go type TenantInfo struct { Entries []TenantEntry `json:"entries"` } ``` -------------------------------- ### ExpandVolume Mock Source: https://pkg.go.dev/github.com/dell/gounity/mocks Provides a mock function for expanding a volume to a new size. ```go func (_m *UnityClient) ExpandVolume(ctx context.Context, volumeID string, newSize uint64) error ``` -------------------------------- ### FindFilesystemByID Mock Source: https://pkg.go.dev/github.com/dell/gounity/mocks Provides a mock function for finding a filesystem by its ID. ```go func (_m *UnityClient) FindFilesystemByID(ctx context.Context, filesystemID string) (*types.Filesystem, error) ``` -------------------------------- ### UnityClient FindVolumeByID Source: https://pkg.go.dev/github.com/dell/gounity/mocks Provides a mock function with given fields: ctx, volID. ```go func (_m *UnityClient) FindVolumeByID(ctx context.Context, volID string) (*types.Volume, error) ``` -------------------------------- ### NasServerID Struct Source: https://pkg.go.dev/github.com/dell/gounity/apitypes Captures the NAS server ID for volume creation. ```go type NasServerID struct { NasServerID string `json:"id"` } ``` -------------------------------- ### FindHostInitiatorByName Source: https://pkg.go.dev/github.com/dell/gounity Finds a host initiator by its name. ```go func (c *UnityClientImpl) FindHostInitiatorByName(ctx context.Context, wwnOrIqn string) (*types.HostInitiator, error) ``` -------------------------------- ### ListHostInitiator struct for host initiators Source: https://pkg.go.dev/github.com/dell/gounity/apitypes Captures a list of host initiators in an entries field. ```go type ListHostInitiator struct { HostInitiator []HostInitiator `json:"entries"` } ``` -------------------------------- ### FindHostInitiatorPathByID Mock Source: https://pkg.go.dev/github.com/dell/gounity/mocks Provides a mock function for finding a host initiator path by its ID. ```go func (_m *UnityClient) FindHostInitiatorPathByID(ctx context.Context, initiatorPathID string) (*types.HostInitiatorPath, error) ``` -------------------------------- ### DeleteFilesystem mock method Source: https://pkg.go.dev/github.com/dell/gounity/mocks Mock function for deleting a filesystem. Takes context and filesystem ID. Returns an error. ```go func (_m *UnityClient) DeleteFilesystem(ctx context.Context, filesystemID string) error ``` -------------------------------- ### HostInitiatorModifyParam Struct Source: https://pkg.go.dev/github.com/dell/gounity/apitypes Captures Host Initiator modification parameters. ```go type HostInitiatorModifyParam struct { HostIDContent *HostIDContent `json:"host"` } ``` -------------------------------- ### HostIoLimitParameters Struct Source: https://pkg.go.dev/github.com/dell/gounity/apitypes Captures HostIO Limit parameters. ```go type HostIoLimitParameters struct { IoLimitPolicyParam *IoLimitPolicyParam `json:"ioLimitPolicy"` } ``` -------------------------------- ### ListIscsiIPInterfaces Source: https://pkg.go.dev/github.com/dell/gounity Lists the iSCSI IP interfaces configured on the array. ```go func (c *UnityClientImpl) ListIscsiIPInterfaces(ctx context.Context) ([]types.IPInterfaceEntries, error) ``` -------------------------------- ### func NewClient Source: https://pkg.go.dev/github.com/dell/gounity/mocks/api Creates a new instance of Client. Registers a testing interface on the mock and a cleanup function to assert the mocks expectations. The first argument is typically a *testing.T value. ```go func NewClient(t interface { mock.TestingT Cleanup(func()) }, ) *Client ``` -------------------------------- ### HostIPPortCreateParam Struct Source: https://pkg.go.dev/github.com/dell/gounity/apitypes Captures the Host IP Port creation request. ```go type HostIPPortCreateParam struct { HostIDContent *HostIDContent `json:"host"` Address string `json:"address"` } ``` -------------------------------- ### func (*Client) Put Source: https://pkg.go.dev/github.com/dell/gounity/mocks/api Put provides a mock function with given fields: ctx, path, headers, body, resp. ```go func (_m *Client) Put(ctx context.Context, path string, headers map[string]string, body interface{}, resp interface{}) error ``` -------------------------------- ### Host Struct Source: https://pkg.go.dev/github.com/dell/gounity/apitypes Captures the host object. ```go type Host struct { HostContent HostContent `json:"content"` } ``` -------------------------------- ### UnityClient FindTenants Source: https://pkg.go.dev/github.com/dell/gounity/mocks Provides a mock function with given fields: ctx. ```go func (_m *UnityClient) FindTenants(ctx context.Context) (*types.TenantInfo, error) ``` -------------------------------- ### HostAccessResponse Struct Source: https://pkg.go.dev/github.com/dell/gounity/apitypes Captures Host Access in a volume response. ```go type HostAccessResponse struct { HostContent HostContent `json:"host"` HLU int `json:"hlu"` } ``` -------------------------------- ### UnityClient FindStoragePoolByName Source: https://pkg.go.dev/github.com/dell/gounity/mocks Provides a mock function with given fields: ctx, poolName. ```go func (_m *UnityClient) FindStoragePoolByName(ctx context.Context, poolName string) (*types.StoragePool, error) ``` -------------------------------- ### CreateRealTimeMetricsQuery method Source: https://pkg.go.dev/github.com/dell/gounity Creates a MetricRealTime collection for the given metric paths and collection interval. Results can be retrieved using the GetMetricsCollection interface. ```go func (c *UnityClientImpl) CreateRealTimeMetricsQuery(ctx context.Context, metricPaths []string, interval int) (*types.MetricQueryCreateResponse, error) ```