Class: ProxyAPI::Puppetca

Inherits:
Resource show all
Defined in:
lib/proxy_api/puppetca.rb

Instance Attribute Summary

Attributes inherited from Resource

#url

Instance Method Summary collapse

Constructor Details

#initialize(args) ⇒ Puppetca

Returns a new instance of Puppetca.


3
4
5
6
# File 'lib/proxy_api/puppetca.rb', line 3

def initialize args
  @url  = args[:url] + "/puppet/ca"
  super args
end

Instance Method Details

#allObject


34
35
36
# File 'lib/proxy_api/puppetca.rb', line 34

def all
  parse(get)
end

#autosignObject


8
9
10
# File 'lib/proxy_api/puppetca.rb', line 8

def autosign
  parse(get "autosign")
end

#del_autosign(certname) ⇒ Object


16
17
18
19
20
21
# File 'lib/proxy_api/puppetca.rb', line 16

def del_autosign certname
  parse(delete("autosign/#{certname}"))
rescue RestClient::ResourceNotFound  # entry doesn't exists anyway

  true
end

#del_certificate(certname) ⇒ Object


27
28
29
30
31
32
# File 'lib/proxy_api/puppetca.rb', line 27

def del_certificate certname
  parse(delete("#{certname}"))
rescue RestClient::ResourceNotFound  # entry doesn't exists anyway

  true
end

#set_autosign(certname) ⇒ Object


12
13
14
# File 'lib/proxy_api/puppetca.rb', line 12

def set_autosign certname
  parse(post("", "autosign/#{certname}"))
end

#sign_certificate(certname) ⇒ Object


23
24
25
# File 'lib/proxy_api/puppetca.rb', line 23

def sign_certificate certname
  parse(post("", certname))
end