Module: Xnode::Keystone

Defined in:
lib/xnode/keystone.rb,
lib/xnode/keystone/http.rb,
lib/xnode/keystone/utils.rb,
lib/xnode/keystone/version.rb

Defined Under Namespace

Classes: Authenticate

Constant Summary collapse

VERSION =
"0.1.1"

Class Method Summary collapse

Class Method Details

.auth_data(tenant, username, password) ⇒ Object

Set up a Keystone JSON request body for authentication purposes.



10
11
12
13
14
15
16
17
18
19
20
# File 'lib/xnode/keystone/utils.rb', line 10

def auth_data(tenant, username, password)
  headers = {
    :auth => {
      :tenantName => tenant,
      :passwordCredentials => {
        :username => username,
        :password => password
      }
    }
  }
end

.deleteObject

Send an HTTP DELETE request to an OpenStack API endpoint.



26
27
# File 'lib/xnode/keystone/http.rb', line 26

def delete
end

.get(url, headers) ⇒ Object

Send an HTTP GET request to an OpenStack API endpoint.



14
15
# File 'lib/xnode/keystone/http.rb', line 14

def get(url, headers)
end

.patchObject

Send an HTTP PATCH request to an OpenStack API endpoint.



31
32
# File 'lib/xnode/keystone/http.rb', line 31

def patch
end

.post(url, data) ⇒ Object

Send an HTTP POST request to an OpenStack API endpoint.



19
20
21
22
# File 'lib/xnode/keystone/http.rb', line 19

def post(url, data)
  request   = RestClient.post "#{url}", data, :content_type => :json, :accept => :json
  response  = JSON.parse(request.body)
end

.putObject

Send an HTTP PUT request to an OpenStack API endpoint.



36
37
# File 'lib/xnode/keystone/http.rb', line 36

def put
end