Class: Fog::Proxmox::Identity::Real

Inherits:
Object
  • Object
show all
Includes:
Core
Defined in:
lib/fog/proxmox/identity.rb,
lib/fog/proxmox/identity/requests/get_pool.rb,
lib/fog/proxmox/identity/requests/get_role.rb,
lib/fog/proxmox/identity/requests/get_user.rb,
lib/fog/proxmox/identity/requests/get_group.rb,
lib/fog/proxmox/identity/requests/get_domain.rb,
lib/fog/proxmox/identity/requests/list_pools.rb,
lib/fog/proxmox/identity/requests/list_roles.rb,
lib/fog/proxmox/identity/requests/list_users.rb,
lib/fog/proxmox/identity/requests/create_pool.rb,
lib/fog/proxmox/identity/requests/create_role.rb,
lib/fog/proxmox/identity/requests/create_user.rb,
lib/fog/proxmox/identity/requests/delete_pool.rb,
lib/fog/proxmox/identity/requests/delete_role.rb,
lib/fog/proxmox/identity/requests/delete_user.rb,
lib/fog/proxmox/identity/requests/list_groups.rb,
lib/fog/proxmox/identity/requests/list_tokens.rb,
lib/fog/proxmox/identity/requests/update_pool.rb,
lib/fog/proxmox/identity/requests/update_role.rb,
lib/fog/proxmox/identity/requests/update_user.rb,
lib/fog/proxmox/identity/requests/create_group.rb,
lib/fog/proxmox/identity/requests/create_token.rb,
lib/fog/proxmox/identity/requests/delete_group.rb,
lib/fog/proxmox/identity/requests/delete_token.rb,
lib/fog/proxmox/identity/requests/list_domains.rb,
lib/fog/proxmox/identity/requests/read_version.rb,
lib/fog/proxmox/identity/requests/update_group.rb,
lib/fog/proxmox/identity/requests/update_token.rb,
lib/fog/proxmox/identity/requests/create_domain.rb,
lib/fog/proxmox/identity/requests/delete_domain.rb,
lib/fog/proxmox/identity/requests/update_domain.rb,
lib/fog/proxmox/identity/requests/get_token_info.rb,
lib/fog/proxmox/identity/requests/change_password.rb,
lib/fog/proxmox/identity/requests/list_permissions.rb,
lib/fog/proxmox/identity/requests/check_permissions.rb,
lib/fog/proxmox/identity/requests/update_permissions.rb,
lib/fog/proxmox/identity/requests/list_user_permissions.rb

Overview

class Real list_user_permissions request

Instance Attribute Summary

Attributes included from Core

#auth_method, #current_user, #expires, #token

Class Method Summary collapse

Instance Method Summary collapse

Methods included from Core

#credentials, #initialize, #reload, #setup, #user_token?

Class Method Details

.not_found_classObject



122
123
124
# File 'lib/fog/proxmox/identity.rb', line 122

def self.not_found_class
  Fog::Proxmox::Identity::NotFound
end

Instance Method Details

#change_password(userid, password) ⇒ Object



26
27
28
29
30
31
32
33
# File 'lib/fog/proxmox/identity/requests/change_password.rb', line 26

def change_password(userid, password)
  request(
    expects: [200],
    method: 'PUT',
    path: 'access/password',
    body: URI.encode_www_form(userid: userid, password: password)
  )
end

#check_permissions(principal) ⇒ Object



26
27
28
29
30
31
32
33
# File 'lib/fog/proxmox/identity/requests/check_permissions.rb', line 26

def check_permissions(principal)
  request(
    expects: [200],
    method: 'POST',
    path: 'access/ticket',
    body: URI.encode_www_form(principal)
  )
end

#configObject



126
127
128
# File 'lib/fog/proxmox/identity.rb', line 126

def config
  self
end

#config_service?Boolean

Returns:

  • (Boolean)


130
131
132
# File 'lib/fog/proxmox/identity.rb', line 130

def config_service?
  true
end

#create_domain(domain) ⇒ Object



25
26
27
28
29
30
31
32
# File 'lib/fog/proxmox/identity/requests/create_domain.rb', line 25

def create_domain(domain)
  request(
    expects: [200],
    method: 'POST',
    path: 'access/domains',
    body: URI.encode_www_form(domain)
  )
end

#create_group(group) ⇒ Object



25
26
27
28
29
30
31
32
# File 'lib/fog/proxmox/identity/requests/create_group.rb', line 25

def create_group(group)
  request(
    expects: [200],
    method: 'POST',
    path: 'access/groups',
    body: URI.encode_www_form(group)
  )
end

#create_pool(pool) ⇒ Object



25
26
27
28
29
30
31
32
# File 'lib/fog/proxmox/identity/requests/create_pool.rb', line 25

def create_pool(pool)
  request(
    expects: [200],
    method: 'POST',
    path: 'pools',
    body: URI.encode_www_form(pool)
  )
end

#create_role(role) ⇒ Object



25
26
27
28
29
30
31
32
# File 'lib/fog/proxmox/identity/requests/create_role.rb', line 25

def create_role(role)
  request(
    expects: [200],
    method: 'POST',
    path: 'access/roles',
    body: URI.encode_www_form(role)
  )
end

#create_token(userid, tokenid, options) ⇒ Object



25
26
27
28
29
30
31
32
# File 'lib/fog/proxmox/identity/requests/create_token.rb', line 25

def create_token(userid, tokenid, options)
  request(
    expects: [200],
    method: 'POST',
    path: "access/users/#{URI.encode_www_form_component(userid)}/token/#{tokenid}",
    body: URI.encode_www_form(options)
  )
end

#create_user(user) ⇒ Object



25
26
27
28
29
30
31
32
# File 'lib/fog/proxmox/identity/requests/create_user.rb', line 25

def create_user(user)
  request(
    expects: [200],
    method: 'POST',
    path: 'access/users',
    body: URI.encode_www_form(user)
  )
end

#delete_domain(realm) ⇒ Object



26
27
28
29
30
31
32
# File 'lib/fog/proxmox/identity/requests/delete_domain.rb', line 26

def delete_domain(realm)
  request(
    expects: [200],
    method: 'DELETE',
    path: "access/domains/#{realm}"
  )
end

#delete_group(groupid) ⇒ Object



26
27
28
29
30
31
32
# File 'lib/fog/proxmox/identity/requests/delete_group.rb', line 26

def delete_group(groupid)
  request(
    expects: [200],
    method: 'DELETE',
    path: "access/groups/#{groupid}"
  )
end

#delete_pool(poolid) ⇒ Object



25
26
27
28
29
30
31
# File 'lib/fog/proxmox/identity/requests/delete_pool.rb', line 25

def delete_pool(poolid)
  request(
    expects: [200],
    method: 'DELETE',
    path: "pools/#{poolid}"
  )
end

#delete_role(roleid) ⇒ Object



26
27
28
29
30
31
32
# File 'lib/fog/proxmox/identity/requests/delete_role.rb', line 26

def delete_role(roleid)
  request(
    expects: [200],
    method: 'DELETE',
    path: "access/roles/#{roleid}"
  )
end

#delete_token(userid, tokenid) ⇒ Object



26
27
28
29
30
31
32
# File 'lib/fog/proxmox/identity/requests/delete_token.rb', line 26

def delete_token(userid, tokenid)
  request(
    expects: [200],
    method: 'DELETE',
    path: "access/users/#{URI.encode_www_form_component(userid)}/token/#{tokenid}"
  )
end

#delete_user(userid) ⇒ Object



25
26
27
28
29
30
31
# File 'lib/fog/proxmox/identity/requests/delete_user.rb', line 25

def delete_user(userid)
  request(
    expects: [200],
    method: 'DELETE',
    path: "access/users/#{userid}"
  )
end

#get_domain(realm) ⇒ Object



26
27
28
29
30
31
32
# File 'lib/fog/proxmox/identity/requests/get_domain.rb', line 26

def get_domain(realm)
  request(
    expects: [200],
    method: 'GET',
    path: "access/domains/#{realm}"
  )
end

#get_group(groupid) ⇒ Object



26
27
28
29
30
31
32
# File 'lib/fog/proxmox/identity/requests/get_group.rb', line 26

def get_group(groupid)
  request(
    expects: [200],
    method: 'GET',
    path: "access/groups/#{groupid}"
  )
end

#get_pool(poolid) ⇒ Object



26
27
28
29
30
31
32
# File 'lib/fog/proxmox/identity/requests/get_pool.rb', line 26

def get_pool(poolid)
  request(
    expects: [200],
    method: 'GET',
    path: "pools/#{poolid}"
  )
end

#get_role(roleid) ⇒ Object



26
27
28
29
30
31
32
# File 'lib/fog/proxmox/identity/requests/get_role.rb', line 26

def get_role(roleid)
  request(
    expects: [200],
    method: 'GET',
    path: "access/roles/#{roleid}"
  )
end

#get_token_info(userid, tokenid) ⇒ Object



26
27
28
29
30
31
32
# File 'lib/fog/proxmox/identity/requests/get_token_info.rb', line 26

def get_token_info(userid, tokenid)
  request(
    expects: [200],
    method: 'GET',
    path: "access/users/#{URI.encode_www_form_component(userid)}/token/#{tokenid}"
  )
end

#get_user(userid) ⇒ Object



26
27
28
29
30
31
32
# File 'lib/fog/proxmox/identity/requests/get_user.rb', line 26

def get_user(userid)
  request(
    expects: [200],
    method: 'GET',
    path: "access/users/#{userid}"
  )
end

#list_domainsObject



26
27
28
29
30
31
32
# File 'lib/fog/proxmox/identity/requests/list_domains.rb', line 26

def list_domains
  request(
    expects: [200],
    method: 'GET',
    path: 'access/domains'
  )
end

#list_groupsObject



26
27
28
29
30
31
32
# File 'lib/fog/proxmox/identity/requests/list_groups.rb', line 26

def list_groups
  request(
    expects: [200],
    method: 'GET',
    path: 'access/groups'
  )
end

#list_permissionsObject



26
27
28
29
30
31
32
# File 'lib/fog/proxmox/identity/requests/list_permissions.rb', line 26

def list_permissions
  request(
    expects: [200],
    method: 'GET',
    path: 'access/acl'
  )
end

#list_poolsObject



26
27
28
29
30
31
32
# File 'lib/fog/proxmox/identity/requests/list_pools.rb', line 26

def list_pools
  request(
    expects: [200],
    method: 'GET',
    path: 'pools'
  )
end

#list_rolesObject



25
26
27
28
29
30
31
# File 'lib/fog/proxmox/identity/requests/list_roles.rb', line 25

def list_roles
  request(
    expects: [200],
    method: 'GET',
    path: 'access/roles'
  )
end

#list_tokens(userid) ⇒ Object



26
27
28
29
30
31
32
# File 'lib/fog/proxmox/identity/requests/list_tokens.rb', line 26

def list_tokens(userid)
  request(
    expects: [200],
    method: 'GET',
    path: "access/users/#{URI.encode_www_form_component(userid)}/token"
  )
end

#list_user_permissions(userid, path) ⇒ Object



26
27
28
29
30
31
32
33
34
35
# File 'lib/fog/proxmox/identity/requests/list_user_permissions.rb', line 26

def list_user_permissions(userid, path)
  options = { userid: userid }
  options.store(:path, path) if path
  request(
    expects: [200],
    method: 'GET',
    path: 'access/permissions',
    query: URI.encode_www_form(options)
  )
end

#list_users(options = {}) ⇒ Object



26
27
28
29
30
31
32
33
# File 'lib/fog/proxmox/identity/requests/list_users.rb', line 26

def list_users(options = {})
  request(
    expects: [200],
    method: 'GET',
    path: 'access/users',
    query: options
  )
end

#read_versionObject



25
26
27
28
29
30
31
# File 'lib/fog/proxmox/identity/requests/read_version.rb', line 25

def read_version
  request(
    expects: [200],
    method: 'GET',
    path: 'version'
  )
end

#update_domain(realm, attributes) ⇒ Object



26
27
28
29
30
31
32
33
# File 'lib/fog/proxmox/identity/requests/update_domain.rb', line 26

def update_domain(realm, attributes)
  request(
    expects: [200],
    method: 'PUT',
    path: "access/domains/#{realm}",
    body: URI.encode_www_form(attributes)
  )
end

#update_group(groupid, options) ⇒ Object



25
26
27
28
29
30
31
32
# File 'lib/fog/proxmox/identity/requests/update_group.rb', line 25

def update_group(groupid, options)
  request(
    expects: [200],
    method: 'PUT',
    path: "access/groups/#{groupid}",
    body: URI.encode_www_form(options)
  )
end

#update_permissions(body_params) ⇒ Object



26
27
28
29
30
31
32
33
# File 'lib/fog/proxmox/identity/requests/update_permissions.rb', line 26

def update_permissions(body_params)
  request(
    expects: [200],
    method: 'PUT',
    path: 'access/acl',
    body: URI.encode_www_form(body_params)
  )
end

#update_pool(poolid, attributes) ⇒ Object



26
27
28
29
30
31
32
33
# File 'lib/fog/proxmox/identity/requests/update_pool.rb', line 26

def update_pool(poolid, attributes)
  request(
    expects: [200],
    method: 'PUT',
    path: "pools/#{poolid}",
    body: URI.encode_www_form(attributes)
  )
end

#update_role(roleid, attributes) ⇒ Object



26
27
28
29
30
31
32
33
# File 'lib/fog/proxmox/identity/requests/update_role.rb', line 26

def update_role(roleid, attributes)
  request(
    expects: [200],
    method: 'PUT',
    path: "access/roles/#{roleid}",
    body: URI.encode_www_form(attributes)
  )
end

#update_token(userid, tokenid, attributes) ⇒ Object



26
27
28
29
30
31
32
33
# File 'lib/fog/proxmox/identity/requests/update_token.rb', line 26

def update_token(userid, tokenid, attributes)
  request(
    expects: [200],
    method: 'PUT',
    path: "access/users/#{URI.encode_www_form_component(userid)}/token/#{tokenid}",
    body: URI.encode_www_form(attributes)
  )
end

#update_user(userid, attributes) ⇒ Object



26
27
28
29
30
31
32
33
# File 'lib/fog/proxmox/identity/requests/update_user.rb', line 26

def update_user(userid, attributes)
  request(
    expects: [200],
    method: 'PUT',
    path: "access/users/#{userid}",
    body: URI.encode_www_form(attributes)
  )
end