Class: OCI::ApiClientProxySettings

Inherits:
Object
  • Object
show all
Defined in:
lib/oci/api_client_proxy_settings.rb

Overview

This class contains proxy configuration information that can be provided to ApiClient. If ApiClient is provided a proxy settings object then it will send requests via the specified proxy.

If no object of this class is provided to ApiClient then it will use the proxy settings from the http_proxy environment variable, if present.

To make ApiClient bypass proxies completely, pass it an object of this class with a nil #proxy_address

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(proxy_address, proxy_port = nil, proxy_user = nil, proxy_password = nil) ⇒ ApiClientProxySettings

Creates a new ApiClientProxySettings object that can be provided to an OCI::ApiClient

Parameters:

  • proxy_address (String)

    The address of the proxy. This should be a DNS hostname or an IP address. nil can be provided to indicate that proxies should be bypassed

  • proxy_port (Integer) (defaults to: nil)

    The proxy port

  • proxy_user (String) (defaults to: nil)

    Optional the username used for the proxy if it supports username/password authentication

  • proxy_password (String) (defaults to: nil)

    Optional the password used for the proxy if it supports username/password authentication



42
43
44
45
46
47
48
49
50
# File 'lib/oci/api_client_proxy_settings.rb', line 42

def initialize(proxy_address, proxy_port = nil, proxy_user = nil, proxy_password = nil)
  validate_proxy_address_port(proxy_address, proxy_port)
  validate_proxy_user_password(proxy_user, proxy_password)

  @proxy_address = proxy_address
  @proxy_port = proxy_port
  @proxy_user = proxy_user
  @proxy_password = proxy_password
end

Instance Attribute Details

#proxy_addressString (readonly)

The address of the proxy. This should be a DNS hostname or an IP address, but may be nil to indicate that proxies should be bypassed

Returns:

  • (String)


19
20
21
# File 'lib/oci/api_client_proxy_settings.rb', line 19

def proxy_address
  @proxy_address
end

#proxy_passwordString (readonly)

The password used for the proxy if it supports username/password authentication

Returns:

  • (String)


34
35
36
# File 'lib/oci/api_client_proxy_settings.rb', line 34

def proxy_password
  @proxy_password
end

#proxy_portInteger (readonly)

The proxy port

Returns:

  • (Integer)


24
25
26
# File 'lib/oci/api_client_proxy_settings.rb', line 24

def proxy_port
  @proxy_port
end

#proxy_userString (readonly)

The username used for the proxy if it supports username/password authentication

Returns:

  • (String)


29
30
31
# File 'lib/oci/api_client_proxy_settings.rb', line 29

def proxy_user
  @proxy_user
end