class Fog::Compute::Google::Subnetwork

Represents a Subnetwork resource

@see developers.google.com/compute/docs/reference/latest/subnetworks

Public Instance Methods

destroy(async = true) click to toggle source
# File lib/fog/compute/google/models/subnetwork.rb, line 33
def destroy(async = true)
  requires :identity, :region

  data = service.delete_subnetwork(identity, region)
  operation = Fog::Compute::Google::Operations.new(:service => service)
                                              .get(data.name, nil, data.region)
  operation.wait_for { ready? } unless async
  operation
end
expand_ip_cidr_range(range, async = true) click to toggle source
# File lib/fog/compute/google/models/subnetwork.rb, line 48
def expand_ip_cidr_range(range, async = true)
  requires :identity, :region

  data = service.expand_subnetwork_ip_cidr_range(
    identity, region, range
  )
  operation = Fog::Compute::Google::Operations.new(:service => service)
                                              .get(data.name, nil, data.region)
  operation.wait_for { ready? } unless async
  reload
end
reload() click to toggle source
# File lib/fog/compute/google/models/subnetwork.rb, line 73
def reload
  requires :identity, :region

  data = collection.get(identity, region.split("/")[-1])
  merge_attributes(data.attributes)
  self
end
save() click to toggle source
# File lib/fog/compute/google/models/subnetwork.rb, line 23
def save
  requires :identity, :network, :region, :ip_cidr_range

  data = service.insert_subnetwork(identity, region, network, ip_cidr_range, attributes)
  operation = Fog::Compute::Google::Operations.new(:service => service)
                                              .get(data.name, nil, data.region)
  operation.wait_for { ready? }
  reload
end
set_private_ip_google_access(access, async = true) click to toggle source
# File lib/fog/compute/google/models/subnetwork.rb, line 60
def set_private_ip_google_access(access, async = true)
  requires :identity, :region

  data = service.set_subnetwork_private_ip_google_access(
    identity, region, access
  )
  operation = Fog::Compute::Google::Operations.new(:service => service)
                                              .get(data.name, nil, data.region)

  operation.wait_for { ready? } unless async
  reload
end
update_interface_config(network_interface) click to toggle source
# File lib/fog/compute/google/models/subnetwork.rb, line 43
def update_interface_config(network_interface)
  network_interface["subnetwork"] = self_link if network_interface
  network_interface
end