Class: CloudflareClient::Zone::SSL::CertificatePack

Inherits:
CloudflareClient::Zone::SSL show all
Defined in:
lib/cloudflare_client/zone/ssl/certificate_pack.rb

Constant Summary

Constants inherited from CloudflareClient::Zone::SSL

VALID_RETRY_VERIFICATIONS

Constants inherited from CloudflareClient::Zone

VALID_ZONE_STATUSES

Constants inherited from CloudflareClient

API_BASE, POSSIBLE_API_SETTINGS, VALID_BUNDLE_METHODS, VALID_DIRECTIONS, VALID_MATCHES, VERSION

Instance Attribute Summary

Attributes inherited from Base

#zone_id

Instance Method Summary collapse

Methods inherited from CloudflareClient::Zone::SSL

#analyze, #verification

Methods inherited from Base

#initialize

Methods inherited from CloudflareClient::Zone

#create_zone, #delete_zone, #edit_zone, #purge_zone_cache, #update_zone_settings, #zone, #zone_activation_check, #zone_setting, #zone_settings, #zones

Methods inherited from CloudflareClient

#initialize

Constructor Details

This class inherits a constructor from CloudflareClient::Zone::Base

Instance Method Details

#listObject

list all certificate packs



7
8
9
# File 'lib/cloudflare_client/zone/ssl/certificate_pack.rb', line 7

def list
  cf_get(path: "/zones/#{zone_id}/ssl/certificate_packs")
end

#order(hosts: nil) ⇒ Object

re-order certificate packs



13
14
15
16
17
18
19
20
# File 'lib/cloudflare_client/zone/ssl/certificate_pack.rb', line 13

def order(hosts: nil)
  non_empty_array_check(:hosts, hosts) unless hosts.nil?

  data = {hosts: hosts}

  # TODO: test against api
  cf_post(path: "/zones/#{zone_id}/ssl/certificate_packs", data: data)
end

#update(id:, hosts:) ⇒ Object

edit a certificate pack



24
25
26
27
28
29
30
31
# File 'lib/cloudflare_client/zone/ssl/certificate_pack.rb', line 24

def update(id:, hosts:)
  id_check(:id, id)
  non_empty_array_check(:hosts, hosts) unless hosts.nil?

  data = {hosts: hosts}

  cf_patch(path: "/zones/#{zone_id}/ssl/certificate_packs/#{id}", data: data)
end