@@ -19,6 +19,7 @@ type StorageAggregateGetDataModelONTAP struct {
1919 DataEncryption AggregateDataEncryption `mapstructure:"data_encryption"`
2020 SnaplockType string `mapstructure:"snaplock_type"`
2121 State string `mapstructure:"state"`
22+ Space AggregateSpace `mapstructure:"space"`
2223}
2324
2425// StorageAggregateGetDataFilterModel describes filter model
@@ -48,6 +49,16 @@ type AggregateBlockStorageMirror struct {
4849 Enabled bool `mapstructure:"enabled"`
4950}
5051
52+ // AggregateSpace describes space within StorageAggregateGetDataModelONTAP
53+ type AggregateSpace struct {
54+ BlockStorage AggregateSpaceBlockStorage `mapstructure:"block_storage"`
55+ }
56+
57+ // AggregateSpaceBlockStorage describes block_storage within AggregateSpace
58+ type AggregateSpaceBlockStorage struct {
59+ Available int64 `mapstructure:"available"`
60+ }
61+
5162// StorageAggregateResourceModel describes the resource data model.
5263type StorageAggregateResourceModel struct {
5364 Name string `mapstructure:"name,omitempty"`
@@ -94,7 +105,7 @@ func GetStorageAggregateByName(errorHandler *utils.ErrorHandler, r restclient.Re
94105 query := r .NewQuery ()
95106 query .Set ("name" , name )
96107
97- query .Fields ([]string {"name" , "node.name" , "uuid" , "state" , "block_storage.primary.disk_class" , "block_storage.primary.disk_count" , "block_storage.primary.raid_size" , "block_storage.primary.raid_type" , "block_storage.mirror.enabled" , "snaplock_type" , "data_encryption.software_encryption_enabled" })
108+ query .Fields ([]string {"name" , "node.name" , "uuid" , "state" , "block_storage.primary.disk_class" , "block_storage.primary.disk_count" , "block_storage.primary.raid_size" , "block_storage.primary.raid_type" , "block_storage.mirror.enabled" , "snaplock_type" , "data_encryption.software_encryption_enabled" , "space.block_storage.available" })
98109 statusCode , response , err := r .GetNilOrOneRecord (api , query , nil )
99110 if err == nil && response == nil {
100111 err = fmt .Errorf ("no response for GET %s" , api )
@@ -116,7 +127,7 @@ func GetStorageAggregateByName(errorHandler *utils.ErrorHandler, r restclient.Re
116127func GetStorageAggregates (errorHandler * utils.ErrorHandler , r restclient.RestClient , filter * StorageAggregateGetDataFilterModel ) ([]StorageAggregateGetDataModelONTAP , error ) {
117128 api := "storage/aggregates"
118129 query := r .NewQuery ()
119- query .Fields ([]string {"name" , "node.name" , "uuid" , "state" , "block_storage.primary.disk_class" , "block_storage.primary.disk_count" , "block_storage.primary.raid_size" , "block_storage.primary.raid_type" , "block_storage.mirror.enabled" , "snaplock_type" , "data_encryption.software_encryption_enabled" })
130+ query .Fields ([]string {"name" , "node.name" , "uuid" , "state" , "block_storage.primary.disk_class" , "block_storage.primary.disk_count" , "block_storage.primary.raid_size" , "block_storage.primary.raid_type" , "block_storage.mirror.enabled" , "snaplock_type" , "data_encryption.software_encryption_enabled" , "space.block_storage.available" })
120131 if filter != nil {
121132 var filterMap map [string ]interface {}
122133 if err := mapstructure .Decode (filter , & filterMap ); err != nil {
0 commit comments