Sha256: 0ac5097f834468fe1bd39403ccf33d934160c3cb77b8c934b3b5a8c416068a41
Contents?: true
Size: 1.02 KB
Versions: 37
Compression:
Stored size: 1.02 KB
Contents
require 'fog/core/model' module Fog module HP class Network class Subnet < Fog::Model identity :id attribute :name attribute :network_id attribute :cidr attribute :ip_version attribute :tenant_id attribute :dns_nameservers attribute :allocation_pools attribute :host_routes attribute :gateway_ip attribute :enable_dhcp def destroy requires :id service.delete_subnet(id) true end def save requires :network_id, :cidr, :ip_version identity ? update : create end private def create requires :network_id, :cidr, :ip_version merge_attributes(service.create_subnet(network_id, cidr, ip_version, attributes).body['subnet']) true end def update requires :id merge_attributes(service.update_subnet(id, attributes).body['subnet']) true end end end end end
Version data entries
37 entries across 37 versions & 2 rubygems