Sha256: 1f4e92729249f4b7a5af95f719b9490459ffca67b69f72e807094cb787e06c21

Contents?: true

Size: 898 Bytes

Versions: 12

Compression:

Stored size: 898 Bytes

Contents

module Hetzner
  class API
    module Subnet
      # shows all IP subnets that belong to the main server IP
      def subnets_for_server?(server_ip)
        path = "/subnet"
        perform_get path, :query => { :server_ip => server_ip }
      end
      
      # shows information of all IP subnets of the customer 
      def subnets?
        get_subnet_or_subnets
      end   
      
      # shows information of a given IP subnet of the customer
      def subnet?(ip)
        get_subnet_or_subnets ip
      end
      
      # sets or unsets traffic warning limits on a specific IP subnet address
      def subnet!(ip, options = {})
        path = "/subnet/#{ip}"
        perform_post path, :query => options
      end
      
      private
      
      def get_subnet_or_subnets(ip = nil)
        path = "/subnet"
        path << "/#{ip}" if ip
        perform_get path
      end
    end
  end
end

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
hetzner-api-1.2.0 lib/hetzner/api/subnet.rb
hetzner-api-1.1.0 lib/hetzner/api/subnet.rb
hetzner-api-1.0.6 lib/hetzner/api/subnet.rb
hetzner-api-1.0.5 lib/hetzner/api/subnet.rb
hetzner-api-1.0.4 lib/hetzner/api/subnet.rb
hetzner-api-1.0.3 lib/hetzner/api/subnet.rb
hetzner-api-1.0.2 lib/hetzner/api/subnet.rb
hetzner-api-1.0.1 lib/hetzner/api/subnet.rb
hetzner-api-1.0.0 lib/hetzner/api/subnet.rb
hetzner-api-1.0.0.beta.2 lib/hetzner/api/subnet.rb
hetzner-api-1.0.0.beta.1 lib/hetzner/api/subnet.rb
hetzner-api-1.0.0.alpha.3 lib/hetzner/api/subnet.rb