lib/azure/armrest/model/storage_account.rb
# Copy the blob from the source container/blob to the destination container/blob.
# If no destination blob name is provided, it will use the same name as the source.
#
# Example:
#
#   source = "Microsoft.Compute/Images/your_container/your-img-osDisk.123xyz.vhd"
#   storage_acct.copy_blob('system', source, 'vhds', nil, your_key)
#
Copy the blob from the source container/blob to the destination container/blob.
If no destination blob name is provided, it will use the same name as the source.




Copy the blob from the source container / blob to the destination container / blob . If no destination blob name is provided it will use the same name as the source .
def copy_blob(src_container, src_blob, dst_container, dst_blob = nil, key = access_key)
        raise ArgumentError, "No access key specified" unless key
        dst_blob ||= File.basename(src_blob)
        dst_url = File.join(properties.primary_endpoints.blob, dst_container, dst_blob)
        src_url = File.join(properties.primary_endpoints.blob, src_container, src_blob)
        options = {'x-ms-copy-source' => src_url, 'if-none-match' => '*', :verb => 'PUT'}
        headers = build_headers(dst_url, key, :blob, options)
        response = ArmrestService.send(
          :rest_put,
          :url         => dst_url,
          :payload     => '',
          :headers     => headers,
          :proxy       => configuration.proxy,
          :ssl_version => configuration.ssl_version,
          :ssl_verify  => configuration.ssl_verify,
          :timeout     => configuration.timeout
        )
        blob = blob_properties(dst_container, dst_blob, key)
        blob.response_headers = Azure::Armrest::ResponseHeaders.new(response.headers)
        blob.response_code = response.code
        blob
      end
def copy_blob ( src_container , src_blob , dst_container , dst_blob = nil , key = access_key ) raise ArgumentError , "No access key specified" unless key dst_blob ||= File . basename ( src_blob ) dst_url = File . join ( properties . primary_endpoints . blob , dst_container , dst_blob ) src_url = File . join ( properties . primary_endpoints . blob , src_container , src_blob ) options = { 'x-ms-copy-source' => src_url , 'if-none-match' => '*' , :verb => 'PUT' } headers = build_headers ( dst_url , key , :blob , options ) response = ArmrestService . send ( :rest_put , :url => dst_url , :payload => '' , :headers => headers , :proxy => configuration . proxy , :ssl_version => configuration . ssl_version , :ssl_verify => configuration . ssl_verify , :timeout => configuration . timeout ) blob = blob_properties ( dst_container , dst_blob , key ) blob . response_headers = Azure :: Armrest :: ResponseHeaders . new ( response . headers ) blob . response_code = response . code blob end
Copy the blob from the source container/blob to the destination container/blob.
Copy the blob from the source container / blob to the destination container / blob .
src_container
<not_specific>
src_blob
<not_specific>
dst_container
<not_specific>
dst_blob
<not_specific>
key
<not_specific>
access_key
<not_specific>