]> git.donarmstrong.com Git - dsa-puppet.git/blob - 3rdparty/modules/aviator/lib/puppet/feature/aviator/openstack/compute/requests/v2/public/create_keypair.rb
add aimonb/aviator to 3rdparty
[dsa-puppet.git] / 3rdparty / modules / aviator / lib / puppet / feature / aviator / openstack / compute / requests / v2 / public / create_keypair.rb
1 module Aviator
2
3   define_request :create_keypair, :inherit => [:openstack, :common, :v2, :public, :base] do
4
5     meta :service, :compute
6
7     link 'documentation',
8          'http://docs.openstack.org/api/openstack-compute/2/content/POST_os-keypairs-v2_createKeypair__v2__tenant_id__os-keypairs_ext-os-keypairs.html'
9
10     param :name,        :required => true
11     param :public_key,  :required => false
12
13     def body
14       {
15         :keypair => {
16           :name       => params[:name],
17           :public_key => params[:public_key],
18         }
19       }
20     end
21
22
23     def headers
24       super
25     end
26
27
28     def http_method
29       :post
30     end
31
32
33     def url
34       "#{ base_url }/os-keypairs"
35     end
36
37   end
38
39 end