Class: Fog::Compute::Gridscale::Loadbalancer

Inherits:
Model
  • Object
show all
Defined in:
lib/fog/compute/gridscale/models/loadbalancer.rb

Instance Method Summary collapse

Instance Method Details

#deleteObject



49
50
51
52
53
# File 'lib/fog/compute/gridscale/models/loadbalancer.rb', line 49

def delete
  requires :object_uuid
  response = service.load_balancer_delete object_uuid
  response.body
end

#destroyObject



55
56
57
58
59
# File 'lib/fog/compute/gridscale/models/loadbalancer.rb', line 55

def destroy
  requires :object_uuid
  response = service.load_balancer_delete(object_uuid)
  response.body
end

#saveObject

Raises:

  • (Fog::Errors::Error)


29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
# File 'lib/fog/compute/gridscale/models/loadbalancer.rb', line 29

def save
  raise Fog::Errors::Error.new('Re-saving an existing object may create a duplicate') if persisted?
  requires :name, :algorithm, :listen_ipv4_uuid, :listen_ipv6_uuid, :backend_servers, :forwarding_rules, :redirect_http_to_https, :labels

  options = {}

  if attributes[:storage_type]
    options[:storage_type] = storage_type
  end

  if attributes[:location_uuid]
    options[:location_uuid] = location_uuid
  end

  data = service.load_balancer_create(name, algorithm, listen_ipv4_uuid, listen_ipv6_uuid, backend_servers, forwarding_rules, redirect_http_to_https, labels, options)

  merge_attributes(data.body)
  true
end