Class: Fog::Compute::Google::SslCertificates

Inherits:
Fog::Collection
  • Object
show all
Defined in:
lib/fog/compute/google/models/ssl_certificates.rb

Instance Method Summary collapse

Instance Method Details

#all(_filters = {}) ⇒ Object


16
17
18
19
# File 'lib/fog/compute/google/models/ssl_certificates.rb', line 16

def all(_filters = {})
  data = service.list_ssl_certificates.to_h[:items] || []
  load(data)
end

#get(certificate_name) ⇒ Object


7
8
9
10
11
12
13
14
# File 'lib/fog/compute/google/models/ssl_certificates.rb', line 7

def get(certificate_name)
  if certificate = service.get_ssl_certificate(certificate_name)
    new(certificate.to_h)
  end
rescue ::Google::Apis::ClientError => e
  raise e unless e.status_code == 404
  nil
end