Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feature: CSI 1.6 - maximum volume size #45

Merged
merged 6 commits into from
Oct 27, 2023
Merged
Show file tree
Hide file tree
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions api/api_logging.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,10 @@
}

func logRequest(
ctx context.Context,

Check warning on line 25 in api/api_logging.go

View workflow job for this annotation

GitHub Actions / golangci-lint

unused-parameter: parameter 'ctx' seems to be unused, consider removing or renaming it as _ (revive)
req *http.Request,
lf func(func(args ...interface{}), string)) {

lf func(func(args ...interface{}), string),

Check warning on line 27 in api/api_logging.go

View workflow job for this annotation

GitHub Actions / golangci-lint

unused-parameter: parameter 'lf' seems to be unused, consider removing or renaming it as _ (revive)
) {
w := &bytes.Buffer{}

fmt.Fprintln(w)
Expand All @@ -45,15 +45,15 @@
}
fmt.Fprintln(w)

//Will not be logging request to avoid logging of headers as it is
//lf(log.Debug, w.String())
// Will not be logging request to avoid logging of headers as it is
// lf(log.Debug, w.String())
}

func logResponse(
ctx context.Context,

Check warning on line 53 in api/api_logging.go

View workflow job for this annotation

GitHub Actions / golangci-lint

unused-parameter: parameter 'ctx' seems to be unused, consider removing or renaming it as _ (revive)
res *http.Response,
lf func(func(args ...interface{}), string)) {

lf func(func(args ...interface{}), string),

Check warning on line 55 in api/api_logging.go

View workflow job for this annotation

GitHub Actions / golangci-lint

unused-parameter: parameter 'lf' seems to be unused, consider removing or renaming it as _ (revive)
) {
w := &bytes.Buffer{}

fmt.Fprintln(w)
Expand Down
41 changes: 22 additions & 19 deletions api/apiconstants.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,58 +40,61 @@ const (

UnityAPIInstancesURI = unityRootAPI + "/instances"

//UnityAPIGetResourceURI GETS RESOURCE BY RESOURCE ID {1}=type of resource, {2}=resource id
// UnityAPIGetResourceURI GETS RESOURCE BY RESOURCE ID {1}=type of resource, {2}=resource id
UnityAPIGetResourceURI = UnityAPIInstancesURI + "/%s/%s"

//UnityAPIGetResourceByNameURI GETS RESOURCE BY RESOURCE NAME {1}=type of resource, {2}=name of the resource
// UnityAPIGetResourceByNameURI GETS RESOURCE BY RESOURCE NAME {1}=type of resource, {2}=name of the resource
UnityAPIGetResourceByNameURI = UnityAPIInstancesURI + "/%s/name:%s"

//UnityAPIGetResourceWithFieldsURI GETS RESOURCE BY RESOURCE ID {1}=type of resource, {2}=resource id, {3}=fields
// UnityAPIGetResourceWithFieldsURI GETS RESOURCE BY RESOURCE ID {1}=type of resource, {2}=resource id, {3}=fields
UnityAPIGetResourceWithFieldsURI = UnityAPIGetResourceURI + "?fields=%s"

//UnityAPIGetResourceByNameWithFieldsURI GETS RESOURCE BY RESOURCE NAME {1}=type of resource, {2}=name of the resource, {3}=fields
// UnityAPIGetResourceByNameWithFieldsURI GETS RESOURCE BY RESOURCE NAME {1}=type of resource, {2}=name of the resource, {3}=fields
UnityAPIGetResourceByNameWithFieldsURI = UnityAPIGetResourceByNameURI + "?fields=%s"

//UnityAPILoginSessionInfoURI LOGINS resource URIs
// UnityAPILoginSessionInfoURI LOGINS resource URIs
UnityAPILoginSessionInfoURI = unityAPITypes + "/loginSessionInfo"

//UnityAPIBasicSysInfoURI gets BasicSystemInfo URI
// UnityAPIBasicSysInfoURI gets BasicSystemInfo URI
UnityAPIBasicSysInfoURI = unityAPITypes + "/basicSystemInfo/instances"

//UnityAPIStorageResourceInstanceActionURI gets StorageResource instance Action URI
// UnityAPIStorageResourceInstanceActionURI gets StorageResource instance Action URI
UnityAPIStorageResourceInstanceActionURI = UnityAPIInstancesURI + "/storageResource/%s/action"

//UnityAPIModifyLunURI Modify Volume URIs
// UnityAPIModifyLunURI Modify Volume URIs
UnityAPIModifyLunURI = UnityAPIStorageResourceInstanceActionURI + "/modifyLun"

//UnityAPICreateLunThinCloneURI Create LUN Thin Clone
// UnityAPICreateLunThinCloneURI Create LUN Thin Clone
UnityAPICreateLunThinCloneURI = UnityAPIStorageResourceInstanceActionURI + "/createLunThinClone"

//UnityAPIModifyStorageResourceURI gets StorageResource resource URIs
// UnityAPIModifyStorageResourceURI gets StorageResource resource URIs
UnityAPIModifyStorageResourceURI = UnityAPIInstancesURI + "/storageResource/%s"
//UnityAPIStorageResourceActionURI gets StorageResource Action resource URI
// UnityAPIStorageResourceActionURI gets StorageResource Action resource URI
UnityAPIStorageResourceActionURI = unityAPITypes + "/storageResource/action/%s"

//UnityModifyLunURI Modify Lun URIs
// UnityModifyLunURI Modify Lun URIs
UnityModifyLunURI = UnityAPIModifyStorageResourceURI + "/action/modifyLun"

//UnityModifyFilesystemURI Modify Filesystem URIs
// UnityModifyFilesystemURI Modify Filesystem URIs
UnityModifyFilesystemURI = UnityAPIModifyStorageResourceURI + "/action/modifyFilesystem"

//UnityModifyNFSShareURI Modify NFS Share URIs
// UnityModifyNFSShareURI Modify NFS Share URIs
UnityModifyNFSShareURI = UnityAPIGetResourceURI + "/action/modify"

//UnityModifySnapshotURI Snapshot Action resource URIs
// UnityModifySnapshotURI Snapshot Action resource URIs
UnityModifySnapshotURI = UnityAPIGetResourceURI + "/action/modify"

//UnityCopySnapshotURI does Snapshot Copy Action
// UnityCopySnapshotURI does Snapshot Copy Action
UnityCopySnapshotURI = UnityAPIGetResourceURI + "/action/copy"

//UnityListHostInitiatorsURI gets Host Initiator URIs
// UnityAPIGetMaxVolumeSize gets the maximum volume size of an array {1}=unique identifier of the systemLimit instance, {2}=fields
UnityAPIGetMaxVolumeSize = UnityAPIInstancesURI + "/systemLimit/%s?fields=%s"

// UnityListHostInitiatorsURI gets Host Initiator URIs
UnityListHostInitiatorsURI = unityAPITypes + "/hostInitiator/instances?fields="
UnityModifyHostInitiators = unityRootAPI + "/instances/hostInitiator/%s/action/modify"

//UnityInstancesFilter does Unity Instance Filter
// UnityInstancesFilter does Unity Instance Filter
UnityInstancesFilter = UnityAPIInstanceTypeResources + "?filter=%s"

UnityMetric = "metric"
Expand All @@ -101,7 +104,7 @@ const (
// UnitySystemCapacity is used to get capacity metrics for Unity XT
UnitySystemCapacity = "systemCapacity"

//Action types for URL's
// Action types for URL's

LunAction = "lun"
CreateLunAction = "createLun"
Expand Down
35 changes: 19 additions & 16 deletions field_constants.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,54 +15,57 @@
package gounity

const (
//LunDisplayFields to display the Volume fields
// LunDisplayFields to display the Volume fields
LunDisplayFields = "id,name,description,type,wwn,sizeTotal,sizeUsed,sizeAllocated,hostAccess,pool,tieringPolicy,ioLimitPolicy,isThinEnabled,isDataReductionEnabled,isThinClone,parentSnap,originalParentLun?fields,health"

//FileSystemDisplayFields to display the File System fields
// FileSystemDisplayFields to display the File System fields
FileSystemDisplayFields = "id,name,description,type,sizeTotal,isThinEnabled,isDataReductionEnabled,pool,nasServer,storageResource,nfsShare?fields,cifsShare,tieringPolicy,hostIOSize,health"

//StorageResourceDisplayFields to display Storage Resource fields
// StorageResourceDisplayFields to display Storage Resource fields
StorageResourceDisplayFields = "id,name,filesystem"

//TenantDisplayFields to display Tenants fields
// TenantDisplayFields to display Tenants fields
TenantDisplayFields = "id,name"

//NFSShareDisplayfields to display the NFS Share fields
// NFSShareDisplayfields to display the NFS Share fields
NFSShareDisplayfields = "id,name,filesystem,readOnlyHosts,readWriteHosts,readOnlyRootAccessHosts,rootAccessHosts,exportPaths"

//NasServerDisplayfields to display the NAS Server fields
// NasServerDisplayfields to display the NAS Server fields
NasServerDisplayfields = "id,name,nfsServer?fields"

//SnapshotDisplayFields to display the Snapshot fields
// SnapshotDisplayFields to display the Snapshot fields
SnapshotDisplayFields = "id,name,description,storageResource?,lun,creationTime,expirationTime,lastRefreshTime,state,size,isAutoDelete,accessType,parentSnap"

//HostInitiatorsDisplayFields to display the HostInitiator fields
// HostInitiatorsDisplayFields to display the HostInitiator fields
HostInitiatorsDisplayFields = "id,health,type,initiatorId,isIgnored,parentHost,paths"

//HostIPPortDisplayFields to display the HostIPPort fields
// HostIPPortDisplayFields to display the HostIPPort fields
HostIPPortDisplayFields = "id,address"

//LicenseInfoDisplayFields to display License Info fields
// LicenseInfoDisplayFields to display License Info fields
LicenseInfoDisplayFields = "isInstalled,isValid"

//HostInitiatorPathDisplayFields to display the HostInitiatorPath fields
// HostInitiatorPathDisplayFields to display the HostInitiatorPath fields
HostInitiatorPathDisplayFields = "fcPort"

//FcPortDisplayFields to display the FC Port fields
// FcPortDisplayFields to display the FC Port fields
FcPortDisplayFields = "wwn"

//HostIOLimitFields to display host IO limit fields
// HostIOLimitFields to display host IO limit fields
HostIOLimitFields = "id,name,description"

//IscsiIPFields to display Iscsi IP fields
// IscsiIPFields to display Iscsi IP fields
IscsiIPFields = "id,ipAddress,type"

//HostfieldsToQuery to display host fields
// HostfieldsToQuery to display host fields
HostfieldsToQuery = "id,name,description,fcHostInitiators,iscsiHostInitiators,hostIPPorts?fields"

//StoragePoolFields to display Storage Pool fields
// StoragePoolFields to display Storage Pool fields
StoragePoolFields = "id,name,description,sizeFree,sizeTotal,sizeUsed,sizeSubscribed,hasDataReductionEnabledLuns,hasDataReductionEnabledFs,isFASTCacheEnabled,type,isAllFlash,poolFastVP"

// SystemCapacityFields to display system capacity details
SystemCapacityFields = "id,sizeFree,sizeTotal,sizeUsed,sizePreallocated,sizeSubscribed,totalLogicalSize"

// MaximumVolumeSize to display limit and unit
MaximumVolumeSize = "limitValue,unit"
)
5 changes: 2 additions & 3 deletions filesystem.go
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,6 @@ func (f *Filesystem) CreateFilesystem(ctx context.Context, name, storagepool, de

poolAPI := NewStoragePool(f.client)
pool, err := poolAPI.FindStoragePoolByID(ctx, storagepool)

if err != nil {
return nil, fmt.Errorf("unable to get PoolID (%s) Error:%v", storagepool, err)
}
Expand All @@ -140,8 +139,8 @@ func (f *Filesystem) CreateFilesystem(ctx context.Context, name, storagepool, de
}

fileEventSettings := types.FileEventSettings{
IsCIFSEnabled: false, //Set to false to disable CIFS
IsNFSEnabled: true, //Set to true to enable NFS alone
IsCIFSEnabled: false, // Set to false to disable CIFS
IsNFSEnabled: true, // Set to true to enable NFS alone
}

nas := types.NasServerID{
Expand Down
Loading
Loading