Module: Luminati::Client::Zone::Ips

Included in:
Luminati::Client
Defined in:
lib/luminati/client/zone/ips.rb

Instance Method Summary collapse

Instance Method Details

#add_ips(ip_info) ⇒ Hash

Add IPs to a given zone

Parameters:

  • ip_info (Hash)

Returns:

  • (Hash)

    Added IPs information

See Also:



29
30
31
32
# File 'lib/luminati/client/zone/ips.rb', line 29

def add_ips(ip_info)
  data = ip_info
  request(:post, "/api/zone/ips", Oj.dump(data, mode: :compat))
end

#remove_ips(zone_name, ips) ⇒ Hash

Remove Ips from a given zone

Parameters:

  • zone_name (String)
  • ips (Array)

    An array of IPs

Returns:

  • (Hash)

See Also:



39
40
41
42
43
44
# File 'lib/luminati/client/zone/ips.rb', line 39

def remove_ips(zone_name, ips)
  data = {}
  data["zone"] = zone_name
  data["ips"] = ips
  request(:delete, "/api/zone/ips", Oj.dump(data, mode: :compat))
end

#unavailable_zones_ipsHash

Returns zones and IPs with connectivity issues.

Returns:

  • (Hash)

    When there’s no zones that has issues, this should be ‘{}`.

See Also:



21
22
23
# File 'lib/luminati/client/zone/ips.rb', line 21

def unavailable_zones_ips
  request(:get, "/api/zone/ips/unavailable")
end

#zone_ips(zone_name, ip_per_country = false) ⇒ Hash

Returns datacenter IPs for a given zone.

Parameters:

  • zone_name (String)
  • ip_per_country (Boolean) (defaults to: false)

    ‘true` when you want to get a total amount of IPs per country

Returns:

  • (Hash)

See Also:



12
13
14
15
16
# File 'lib/luminati/client/zone/ips.rb', line 12

def zone_ips(zone_name, ip_per_country = false)
  parameters = "zone=#{zone_name}"
  parameters << "&ip_per_country" if ip_per_country
  request(:get, "/api/zone/ips?#{parameters}")
end