lib/azure/armrest/storage_account_service.rb
# Creates and returns a new StorageAccountService (SAS) instance.
#
Creates and returns a new StorageAccountService (SAS) instance.
Creates and returns a new StorageAccountService ( SAS ) instance .
def parse_uri(uri)
        uri = Addressable::URI.parse(uri)
        host_components = uri.host.split('.')
        rh = {
          :scheme        => uri.scheme,
          :account_name  => host_components[0],
          :service_name  => host_components[1],
          :resource_path => uri.path
        }
        return rh unless rh[:service_name] == "blob"
        blob_components = uri.path.split('/', 3)
        if blob_components[2]
          rh[:container] = blob_components[1]
          rh[:blob]      = blob_components[2]
        else
          rh[:container] = '$root'
          rh[:blob]      = blob_components[1]
        end
        return rh unless uri.query && uri.query.start_with?("snapshot=")
        rh[:snapshot] = uri.query.split('=', 2)[1]
        rh
      end
def parse_uri ( uri ) uri = Addressable :: URI . parse ( uri ) host_components = uri . host . split ( '.' ) rh = { :scheme => uri . scheme , :account_name => host_components [ 0 ] , :service_name => host_components [ 1 ] , :resource_path => uri . path } return rh unless rh [ :service_name ] == "blob" blob_components = uri . path . split ( '/' , 3 ) if blob_components [ 2 ] rh [ :container ] = blob_components [ 1 ] rh [ :blob ] = blob_components [ 2 ] else rh [ :container ] = '$root' rh [ :blob ] = blob_components [ 1 ] end return rh unless uri . query && uri . query . start_with? ( "snapshot=" ) rh [ :snapshot ] = uri . query . split ( '=' , 2 ) [ 1 ] rh end
Creates and returns a new StorageAccountService (SAS) instance.
Creates and returns a new StorageAccountService ( SAS ) instance .
# TODO: support other service types.
uri
<not_specific>