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



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

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)


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

def proxy_address
  @proxy_address
end

#proxy_passwordString (readonly)

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

Returns:

  • (String)


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

def proxy_password
  @proxy_password
end

#proxy_portInteger (readonly)

The proxy port

Returns:

  • (Integer)


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

def proxy_port
  @proxy_port
end

#proxy_userString (readonly)

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

Returns:

  • (String)


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

def proxy_user
  @proxy_user
end