Class: Akamai::API::CPS

Inherits:
Object
  • Object
show all
Defined in:
lib/akamai/api/cps.rb,
lib/akamai/api/cps/version.rb

Constant Summary collapse

VERSION =
"0.4.0"

Instance Method Summary collapse

Constructor Details

#initialize(edgerc: '~/.edgerc', section: 'default', debug: false) ⇒ CPS

Returns a new instance of CPS.



11
12
13
14
15
# File 'lib/akamai/api/cps.rb', line 11

def initialize(edgerc: '~/.edgerc', section: 'default', debug: false)
  edgerc_path = File.expand_path(edgerc)
  @http = Akamai::Edgegrid::HTTP.new(get_host(edgerc_path, section), 443)
  @http.setup_from_edgerc(debug: debug, filename: edgerc_path, section: section)
end

Instance Method Details

#enrollments(contract_id) ⇒ Object



17
18
19
20
# File 'lib/akamai/api/cps.rb', line 17

def enrollments(contract_id)
  response = api_get("/enrollments?contractId=#{contract_id}", 'application/vnd.akamai.cps.enrollments.v5+json')
  response.enrollments
end

#production_certificate(enrollment_id) ⇒ Object



22
23
24
# File 'lib/akamai/api/cps.rb', line 22

def production_certificate(enrollment_id)
  get_certificate(enrollment_id, 'production')
end

#production_full_chain(enrollment_id) ⇒ Object



26
27
28
# File 'lib/akamai/api/cps.rb', line 26

def production_full_chain(enrollment_id)
  get_full_chain(enrollment_id, 'production')
end

#staging_certificate(enrollment_id) ⇒ Object



30
31
32
# File 'lib/akamai/api/cps.rb', line 30

def staging_certificate(enrollment_id)
  get_certificate(enrollment_id, 'staging')
end

#staging_full_chain(enrollment_id) ⇒ Object



34
35
36
# File 'lib/akamai/api/cps.rb', line 34

def staging_full_chain(enrollment_id)
  get_full_chain(enrollment_id, 'staging')
end