A ruby library which wraps the Akamai CPS API.
https://github.com/rajiv/akamai-api-cps
Not all CPS API endpoints and features are implemented.
Add this line to your application's Gemfile:
gem 'akamai-api-cps'
And then execute:
$ bundle
First, setup .edgerc
as detailed in the AkamaiOPEN-edgegrid-ruby gem instructions. Then:
client = Akamai::API::CPS.new
enrollments = client.enrollments(contract_id)
enrollments.each do |enrollment|
puts enrollment.csr.cn
end
cert = production_certificate(enrollment_id)
cert_pem = production_full_chain(enrollment_id)
cert = staging_certificate(enrollment_id)
cert_pem = staging_full_chain(enrollment_id)
You can optionally configure an .edgerc
filename and section:
client = Akamai::API::CPS.new(edgerc: '~/.edgerc-qa', section: 'cps')
The client also supports printing of debug messages:
client = Akamai::API::CPS.new(debug: true)
Authored by Rajiv Aaron Manglani.
Copyright 2017 Akamai Technologies, Inc. All rights reserved.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.