class Fog::Compute::Google::TargetHttpsProxy

Constants

RUNNING_STATE

Public Instance Methods

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

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

  service.get_target_https_proxy(identity)
  true
rescue ::Google::Apis::ClientError => e
  raise e unless e.status_code == 404
  false
end
reload() click to toggle source
# File lib/fog/compute/google/models/target_https_proxy.rb, line 87
def reload
  requires :identity

  return unless data = begin
    collection.get(identity)
  rescue Excon::Errors::SocketError
    nil
  end

  new_attributes = data.attributes
  merge_attributes(new_attributes)
  self
end
save() click to toggle source
# File lib/fog/compute/google/models/target_https_proxy.rb, line 24
def save
  requires :identity, :url_map, :ssl_certificates

  unless ssl_certificates.is_a?(Array)
    raise Fog::Errors::Error.new("ssl_certificates attribute must be an array")
  end

  data = service.insert_target_https_proxy(
    identity,
    :description => description,
    :url_map => url_map,
    :ssl_certificates => ssl_certificates
  )
  operation = Fog::Compute::Google::Operations.new(:service => service)
                                              .get(data.name)
  operation.wait_for { ready? }
  reload
end
set_ssl_certificates(ssl_certificates, async = true) click to toggle source
# File lib/fog/compute/google/models/target_https_proxy.rb, line 65
def set_ssl_certificates(ssl_certificates, async = true)
  requires :identity

  data = service.set_target_https_proxy_ssl_certificates(
    identity, ssl_certificates
  )
  operation = Fog::Compute::Google::Operations.new(:service => service)
                                              .get(data.name)
  operation.wait_for { ready? } unless async
  reload
end
set_url_map(url_map, async = true) click to toggle source
# File lib/fog/compute/google/models/target_https_proxy.rb, line 53
def set_url_map(url_map, async = true)
  requires :identity

  data = service.set_target_https_proxy_url_map(
    identity, url_map
  )
  operation = Fog::Compute::Google::Operations.new(:service => service)
                                              .get(data.name)
  operation.wait_for { ready? } unless async
  reload
end