Skip to content

Commit

Permalink
Merge pull request #158 from dell/file_system
Browse files Browse the repository at this point in the history
added attributes to file system resource
  • Loading branch information
AnikaAgiwal2711 authored Dec 24, 2024
2 parents 2f3352b + ea592e4 commit db05bc4
Showing 1 changed file with 73 additions and 17 deletions.
90 changes: 73 additions & 17 deletions fs_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -51,22 +51,35 @@ type FLRCreate struct {

// FsCreate params for creating 'create fs' request
type FsCreate struct {
Description string `json:"description,omitempty"`
Name string `json:"name"`
NASServerID string `json:"nas_server_id"`
Size int64 `json:"size_total"`
ConfigType string `json:"config_type,omitempty"`
AccessPolicy string `json:"access_policy,omitempty"`
LockingPolicy string `json:"locking_policy,omitempty"`
FolderRenamePolicy string `json:"folder_rename_policy,omitempty"`
IsAsyncMTimeEnabled bool `json:"is_async_MTime_enabled,omitempty"`
ProtectionPolicyID string `json:"protection_policy_id,omitempty"`
FileEventsPublishingMode string `json:"file_events_publishing_mode,omitempty"`
HostIOSize string `json:"host_io_size,omitempty"`
FlrCreate interface{} `json:"flr_attributes,omitempty"`
Description string `json:"description,omitempty"`
Name string `json:"name,omitempty"`
NASServerID string `json:"nas_server_id,omitempty"`
Size int64 `json:"size_total,omitempty"`
ConfigType string `json:"config_type,omitempty"`
AccessPolicy string `json:"access_policy,omitempty"`
LockingPolicy string `json:"locking_policy,omitempty"`
FolderRenamePolicy string `json:"folder_rename_policy,omitempty"`
IsAsyncMTimeEnabled bool `json:"is_async_MTime_enabled,omitempty"`
ProtectionPolicyID string `json:"protection_policy_id,omitempty"`
FileEventsPublishingMode string `json:"file_events_publishing_mode,omitempty"`
HostIOSize string `json:"host_io_size,omitempty"`
FlrCreate interface{} `json:"flr_attributes,omitempty"`
IsSmbSyncWritesEnabled *bool `json:"is_smb_sync_writes_enabled,omitempty"`
IsSmbNoNotifyEnabled *bool `json:"is_smb_no_notify_enabled,omitempty"`
IsSmbOpLocksEnabled *bool `json:"is_smb_op_locks_enabled,omitempty"`
IsSmbNotifyOnAccessEnabled *bool `json:"is_smb_notify_on_access_enabled,omitempty"`
IsSmbNotifyOnWriteEnabled *bool `json:"is_smb_notify_on_write_enabled,omitempty"`
SmbNotifyOnChangeDirDepth int32 `json:"smb_notify_on_change_dir_depth,omitempty"`
MetaDataHeader
}

type FlrAttributes struct {
Mode string `json:"mode,omitempty"`
MinimumRetention string `json:"minimum_retention,omitempty"`
DefaultRetention string `json:"default_retention,omitempty"`
MaximumRetention string `json:"maximum_retention,omitempty"`
}

const (
VMware8K string = "VMware_8K"
VMware16K string = "VMware_16K"
Expand All @@ -89,9 +102,22 @@ type FSModify struct {
//maximum: 281474976710656
//
//Size, in bytes, presented to the host or end user. This can be used for both expand and shrink on a file system.
Size int `json:"size_total,omitempty"`
Description string `json:"description,omitempty"`
ExpirationTimestamp string `json:"expiration_timestamp,omitempty"`
Size int `json:"size_total"`
Description string `json:"description,omitempty"`
AccessPolicy string `json:"access_policy,omitempty"`
LockingPolicy string `json:"locking_policy,omitempty"`
FolderRenamePolicy string `json:"folder_rename_policy,omitempty"`
IsSmbSyncWritesEnabled *bool `json:"is_smb_sync_writes_enabled,omitempty"`
IsSmbOpLocksEnabled *bool `json:"is_smb_op_locks_enabled,omitempty"`
IsSmbNotifyOnAccessEnabled *bool `json:"is_smb_notify_on_access_enabled,omitempty"`
IsSmbNotifyOnWriteEnabled *bool `json:"is_smb_notify_on_write_enabled,omitempty"`
SmbNotifyOnChangeDirDepth int32 `json:"smb_notify_on_change_dir_depth,omitempty"`
IsSmbNoNotifyEnabled *bool `json:"is_smb_no_notify_enabled,omitempty"`
IsAsyncMtimeEnabled bool `json:"is_async_MTime_enabled,omitempty"`
ProtectionPolicyID string `json:"protection_policy_id,omitempty"`
FileEventsPublishingMode string `json:"file_events_publishing_mode,omitempty"`
FlrCreate FlrAttributes `json:"flr_attributes,omitempty"`
ExpirationTimestamp string `json:"expiration_timestamp,omitempty"`
}

// NASCreate params for creating 'create nas' request
Expand Down Expand Up @@ -146,6 +172,36 @@ type FileSystem struct {
SizeUsed int64 `json:"size_used,omitempty"`
// Id of a parent filesystem
ParentID string `json:"parent_id,omitempty"`
// Indicates the file system type.
ConfigType string `json:"config_type,omitempty"`
// File system security access policies.
AccessPolicy string `json:"access_policy,omitempty"`
// [ Native, UNIX, Windows ]
LockingPolicy string `json:"locking_policy,omitempty"`
// File system folder rename policies for the file system with multiprotocol access enabled.
FolderRenamePolicy string `json:"folder_rename_policy,omitempty"`
// Indicates whether asynchronous MTIME is enabled on the file system
IsAsyncMTimeEnabled bool `json:"is_async_MTime_enabled,omitempty"`
// Unique identifier of the protection policy
ProtectionPolicyID string `json:"protection_policy_id,omitempty"`
// State of the event notification services for all file systems
FileEventsPublishingMode string `json:"file_events_publishing_mode,omitempty"`
// Typical size of writes
HostIOSize string `json:"host_io_size,omitempty"`
// Flr attributes
FlrCreate FlrAttributes `json:"flr_attributes,omitempty"`
// Indicates whether the synchronous writes option is enabled
IsSmbSyncWritesEnabled bool `json:"is_smb_sync_writes_enabled,omitempty"`
// Indicates whether notifications of changes to a directory file structure are enabled.
IsSmbNoNotifyEnabled bool `json:"is_smb_no_notify_enabled,omitempty"`
// Indicates whether opportunistic file locking is enabled on the file system.
IsSmbOpLocksEnabled bool `json:"is_smb_op_locks_enabled,omitempty"`
// Indicates whether file access notifications are enabled on the file system
IsSmbNotifyOnAccessEnabled bool `json:"is_smb_notify_on_access_enabled,omitempty"`
// Indicates whether file writes notifications are enabled on the file system.
IsSmbNotifyOnWriteEnabled bool `json:"is_smb_notify_on_write_enabled,omitempty"`
// Lowest directory level to which the enabled notifications apply
SmbNotifyOnChangeDirDepth int32 `json:"smb_notify_on_change_dir_depth,omitempty"`
// Expiration timestamp in unix timestamp
ExpirationTimestamp string `json:"expiration_timestamp,omitempty"`
// Access type of the file system
Expand Down Expand Up @@ -185,7 +241,7 @@ func (n *NAS) Fields() []string {

// Fields returns fields which must be requested to fill struct
func (n *FileSystem) Fields() []string {
return []string{"description", "id", "name", "nas_server_id", "filesystem_type", "size_total", "size_used", "parent_id", "expiration_timestamp", "access_type"}
return []string{"description", "id", "name", "nas_server_id", "filesystem_type", "size_total", "size_used", "parent_id", "expiration_timestamp", "access_type", "config_type", "access_policy", "locking_policy", "folder_rename_policy", "is_async_MTime_enabled", "protection_policy_id", "file_events_publishing_mode", "host_io_size", "flr_attributes", "is_smb_sync_writes_enabled", "is_smb_no_notify_enabled", "is_smb_op_locks_enabled", "is_smb_notify_on_access_enabled", "is_smb_notify_on_write_enabled", "smb_notify_on_change_dir_depth"}
}

func (n *NFSServerInstance) Fields() []string {
Expand Down

0 comments on commit db05bc4

Please sign in to comment.