libraries/resource_providers/api200/volume_provider.rb
def load_resource_with_associated_resources
        if @new_resource.volume_template
          @item.set_storage_volume_template(resource_named(:VolumeTemplate).new(@item.client, name: @new_resource.volume_template))
        else # Can't set the storage_pool or snapshot_pool if we specify a volume_template
          validate_required_properties(:storage_system, :storage_pool)
          storage_system = resource_named(:StorageSystem).new(@item.client, credentials: { ip_hostname: @new_resource.storage_system }, name: @new_resource.storage_system)
          @item.set_storage_system(storage_system)
          @item.set_storage_pool(resource_named(:StoragePool).new(@item.client, name: @new_resource.storage_pool, storageSystemUri: storage_system['uri']))
          @item.set_snapshot_pool(resource_named(:StoragePool).new(@item.client, name: @new_resource.snapshot_pool, storageSystemUri: storage_system['uri'])) if @new_resource.snapshot_pool
        end

        # Convert capacity integers to strings
        @item['provisionedCapacity'] = @item['provisionedCapacity'].to_s if @item['provisionedCapacity']
        @item['allocatedCapacity'] = @item['allocatedCapacity'].to_s if @item['allocatedCapacity']

        set_provisioning_parameters unless @item.exists? # Also set provisioningParameters if the volume does not exist
      end
# Loads the Volume with all the external resources (if needed)
Loads the Volume with all the external resources (if needed)
Loads the Volume with all the external resources ( if needed )
def load_resource_with_associated_resources
        if @new_resource.volume_template
          @item.set_storage_volume_template(resource_named(:VolumeTemplate).new(@item.client, name: @new_resource.volume_template))
        else 
          validate_required_properties(:storage_system, :storage_pool)
          storage_system = resource_named(:StorageSystem).new(@item.client, credentials: { ip_hostname: @new_resource.storage_system }, name: @new_resource.storage_system)
          @item.set_storage_system(storage_system)
          @item.set_storage_pool(resource_named(:StoragePool).new(@item.client, name: @new_resource.storage_pool, storageSystemUri: storage_system['uri']))
          @item.set_snapshot_pool(resource_named(:StoragePool).new(@item.client, name: @new_resource.snapshot_pool, storageSystemUri: storage_system['uri'])) if @new_resource.snapshot_pool
        end
        @item['provisionedCapacity'] = @item['provisionedCapacity'].to_s if @item['provisionedCapacity']
        @item['allocatedCapacity'] = @item['allocatedCapacity'].to_s if @item['allocatedCapacity']
        set_provisioning_parameters unless @item.exists? 
      end
def load_resource_with_associated_resources if @new_resource . volume_template @item . set_storage_volume_template ( resource_named ( :VolumeTemplate ) . new ( @item . client , name : @new_resource . volume_template ) ) else validate_required_properties ( :storage_system , :storage_pool ) storage_system = resource_named ( :StorageSystem ) . new ( @item . client , credentials : { ip_hostname : @new_resource . storage_system } , name : @new_resource . storage_system ) @item . set_storage_system ( storage_system ) @item . set_storage_pool ( resource_named ( :StoragePool ) . new ( @item . client , name : @new_resource . storage_pool , storageSystemUri : storage_system [ 'uri' ] ) ) @item . set_snapshot_pool ( resource_named ( :StoragePool ) . new ( @item . client , name : @new_resource . snapshot_pool , storageSystemUri : storage_system [ 'uri' ] ) ) if @new_resource . snapshot_pool end @item [ 'provisionedCapacity' ] = @item [ 'provisionedCapacity' ] . to_s if @item [ 'provisionedCapacity' ] @item [ 'allocatedCapacity' ] = @item [ 'allocatedCapacity' ] . to_s if @item [ 'allocatedCapacity' ] set_provisioning_parameters unless @item . exists? end
Loads the Volume with all the external resources (if needed)
Loads the Volume with all the external resources ( if needed )
# Can't set the storage_pool or snapshot_pool if we specify a volume_template # Convert capacity integers to strings # Also set provisioningParameters if the volume does not exist