Module: Hetzner::API::Subnet

Included in:
Hetzner::API
Defined in:
lib/hetzner/api/subnet.rb

Instance Method Summary collapse

Instance Method Details

#subnet!(ip, options = {}) ⇒ Object

sets or unsets traffic warning limits on a specific IP subnet address



21
22
23
24
# File 'lib/hetzner/api/subnet.rb', line 21

def subnet!(ip, options = {})
  path = "/subnet/#{ip}"
  perform_post path, :query => options
end

#subnet?(ip) ⇒ Boolean

shows information of a given IP subnet of the customer

Returns:

  • (Boolean)


16
17
18
# File 'lib/hetzner/api/subnet.rb', line 16

def subnet?(ip)
  get_subnet_or_subnets ip
end

#subnets?Boolean

shows information of all IP subnets of the customer

Returns:

  • (Boolean)


11
12
13
# File 'lib/hetzner/api/subnet.rb', line 11

def subnets?
  get_subnet_or_subnets
end

#subnets_for_server?(server_ip) ⇒ Boolean

shows all IP subnets that belong to the main server IP

Returns:

  • (Boolean)


5
6
7
8
# File 'lib/hetzner/api/subnet.rb', line 5

def subnets_for_server?(server_ip)
  path = "/subnet"
  perform_get path, :query => { :server_ip => server_ip }
end