lib/azure/armrest/model/storage_account.rb
# Create the specified share file. You may specify any of the following
# options:
#
# * cache_control
# * content_disposition
# * content_length (default: 0)
# * content_encoding
# * content_language
# * content_md5
# * content_type (default: application/octet-stream)
# * meta_name
# * timeout
# * version
#
# Note that this does not set the content of the file, it only creates
# in the file share.
#
Create the specified share file. You may specify any of the following
options.



Note that this does not set the content of the file, it only creates
in the file share.
Create the specified share file . You may specify any of the following options . Note that this does not set the content of the file it only creates in the file share .
def create_file(share, file, key = access_key, options = {})
        raise ArgumentError, "No access key specified" unless key
        timeout = options.delete(:timeout) 
        url = File.join(properties.primary_endpoints.file, share, file)
        url += "?timeout=#{timeout}" if timeout
        hash = options.transform_keys { |okey| 'x-ms-' + okey.to_s.tr('_', '-') }
        hash['verb'] = 'PUT'
        hash['x-ms-type'] = 'file'
        hash['x-ms-content-length'] ||= 0
        hash['x-ms-content-type'] ||= 'application/octet-stream'
        headers = build_headers(url, key, :file, hash)
        response = ArmrestService.send(
          :rest_put,
          :url         => url,
          :payload     => '',
          :headers     => headers,
          :proxy       => configuration.proxy,
          :ssl_version => configuration.ssl_version,
          :ssl_verify  => configuration.ssl_verify,
          :timeout     => configuration.timeout
        )
        Azure::Armrest::ResponseHeaders.new(response.headers).tap do |rh|
          rh.response_code = response.code
        end
      end
def create_file ( share , file , key = access_key , options = { } ) raise ArgumentError , "No access key specified" unless key timeout = options . delete ( :timeout ) url = File . join ( properties . primary_endpoints . file , share , file ) url += "?timeout=#{timeout}" if timeout hash = options . transform_keys { | okey | 'x-ms-' + okey . to_s . tr ( '_' , '-' ) } hash [ 'verb' ] = 'PUT' hash [ 'x-ms-type' ] = 'file' hash [ 'x-ms-content-length' ] ||= 0 hash [ 'x-ms-content-type' ] ||= 'application/octet-stream' headers = build_headers ( url , key , :file , hash ) response = ArmrestService . send ( :rest_put , :url => url , :payload => '' , :headers => headers , :proxy => configuration . proxy , :ssl_version => configuration . ssl_version , :ssl_verify => configuration . ssl_verify , :timeout => configuration . timeout ) Azure :: Armrest :: ResponseHeaders . new ( response . headers ) . tap do | rh | rh . response_code = response . code end end
Create the specified share file.
Create the specified share file .
# Part of request # Mandatory and/or sane defaults
share
<not_specific>
file
<not_specific>
key
<not_specific>
access_key
<not_specific>
options
<not_specific>