Class: Fog::Compute::Brightbox::LoadBalancer
- Inherits:
-
Brightbox::Model
- Object
- Model
- Brightbox::Model
- Fog::Compute::Brightbox::LoadBalancer
- Defined in:
- lib/fog/brightbox/models/compute/load_balancer.rb
Instance Method Summary collapse
-
#certificate=(cert_metadata) ⇒ Object
Sets the certificate metadata from the JSON object that contains it.
-
#certificate_expires_at ⇒ Object
SSL cert metadata for expiration of certificate.
-
#certificate_subject ⇒ Object
SSL cert metadata for subject.
- #destroy ⇒ Object
- #ready? ⇒ Boolean
- #save ⇒ Object
Methods included from Brightbox::ModelHelper
#collection_name, #resource_name
Instance Method Details
#certificate=(cert_metadata) ⇒ Object
Sets the certificate metadata from the JSON object that contains it.
It is used by fog’s attribute setting and should not be used for attempting to set a certificate on a load balancer.
82 83 84 85 86 87 88 89 90 91 92 93 94 |
# File 'lib/fog/brightbox/models/compute/load_balancer.rb', line 82 def certificate=() if attributes[:certificate_valid_from] = time_or_original(["valid_from"]) attributes[:certificate_expires_at] = time_or_original(["expires_at"]) attributes[:certificate_issuer] = ["issuer"] attributes[:certificate_subject] = ["subject"] else attributes[:certificate_valid_from] = nil attributes[:certificate_expires_at] = nil attributes[:certificate_issuer] = nil attributes[:certificate_subject] = nil end end |
#certificate_expires_at ⇒ Object
SSL cert metadata for expiration of certificate
67 68 69 |
# File 'lib/fog/brightbox/models/compute/load_balancer.rb', line 67 def certificate_expires_at attributes[:certificate_expires_at] end |
#certificate_subject ⇒ Object
SSL cert metadata for subject
72 73 74 |
# File 'lib/fog/brightbox/models/compute/load_balancer.rb', line 72 def certificate_subject attributes[:certificate_subject] end |
#destroy ⇒ Object
60 61 62 63 64 |
# File 'lib/fog/brightbox/models/compute/load_balancer.rb', line 60 def destroy requires :identity service.destroy_load_balancer(identity) true end |
#ready? ⇒ Boolean
39 40 41 |
# File 'lib/fog/brightbox/models/compute/load_balancer.rb', line 39 def ready? status == 'active' end |
#save ⇒ Object
43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 |
# File 'lib/fog/brightbox/models/compute/load_balancer.rb', line 43 def save raise Fog::Errors::Error.new('Resaving an existing object may create a duplicate') if persisted? requires :nodes, :listeners, :healthcheck = { :nodes => nodes, :listeners => listeners, :healthcheck => healthcheck, :policy => policy, :name => name, :certificate_pem => certificate_pem, :certificate_private_key => certificate_private_key }.delete_if { |k, v| v.nil? || v == "" } data = service.create_load_balancer() merge_attributes(data) true end |