client/lib/deltacloud/client/connection.rb
# Change the API provider but keep the current client credentials.
# This allows to change the EC2 region and list instances in that
# region without need to supply credentials.
#
# client.use_provider('eu-west-1') { |p| p.instances }
#
# - provider_id -> API provider (aka API_PROVIDER)
#
Change the API provider but keep the current client credentials.
This allows to change the EC2 region and list instances in that
region without need to supply credentials.



> API provider (aka API_PROVIDER)
Change the API provider but keep the current client credentials . This allows to change the EC2 region and list instances in that region without need to supply credentials . > API provider ( aka API_PROVIDER )
def use_provider(provider_id, &block)
      new_client = self.clone
      new_connection = @connection.clone
      new_connection.headers['X-Deltacloud-Provider'] = provider_id
      new_client.connection = new_connection
      new_client.cache_entrypoint!(true)
      yield new_client if block_given?
      new_client
    end
def use_provider ( provider_id , & block ) new_client = self . clone new_connection = @connection . clone new_connection . headers [ 'X-Deltacloud-Provider' ] = provider_id new_client . connection = new_connection new_client . cache_entrypoint! ( true ) yield new_client if block_given? new_client end
Change the API provider but keep the current client credentials.
Change the API provider but keep the current client credentials .
provider_id
<not_specific>
block
<not_specific>