0bee46951e83de77227cb7d8c7f5d04a27856685
[mirror/dsa-puppet.git] /
1 module Aviator
2
3   define_request :delete_user do
4
5     meta :provider,      :openstack
6     meta :service,       :identity
7     meta :api_version,   :v2
8     meta :endpoint_type, :admin
9
10     link 'documentation',
11       'http://docs.openstack.org/api/openstack-identity-service/2.0/content/DELETE_deleteUser_v2.0_users__userId__.html'
12
13     param :id, :required => true
14
15
16     def headers
17       h = {}
18
19       unless self.anonymous?
20         h['X-Auth-Token'] = session_data[:body][:access][:token][:id]
21       end
22
23       h
24     end
25
26
27     def http_method
28       :delete
29     end
30
31
32     def url
33       service_spec = session_data[:body][:access][:serviceCatalog].find{|s| s[:type] == service.to_s }
34       "#{ service_spec[:endpoints][0][:adminURL] }/users/#{ params[:id]}"
35     end
36
37   end
38
39 end