Package cm_api :: Package endpoints :: Module roles
[hide private]
[frames] | no frames]

Module roles

source code

Classes [hide private]
  ApiRole
Functions [hide private]
 
_get_roles_path(cluster_name, service_name) source code
 
_get_role_path(cluster_name, service_name, role_name) source code
 
create_role(resource_root, service_name, role_type, role_name, host_id, cluster_name='default')
Create a role
source code
 
get_role(resource_root, service_name, name, cluster_name='default')
Lookup a role by name
source code
 
_get_role(resource_root, path) source code
 
get_all_roles(resource_root, service_name, cluster_name='default', view=None)
Get all roles
source code
 
get_roles_by_type(resource_root, service_name, role_type, cluster_name='default', view=None)
Get all roles of a certain type in a service
source code
 
delete_role(resource_root, service_name, name, cluster_name='default')
Delete a role by name
source code
Variables [hide private]
  ROLES_PATH = '/clusters/%s/services/%s/roles'
  CM_ROLES_PATH = '/cm/service/roles'
  __package__ = 'cm_api.endpoints'
Function Details [hide private]

create_role(resource_root, service_name, role_type, role_name, host_id, cluster_name='default')

source code 

Create a role

Parameters:
  • resource_root - The root Resource object.
  • service_name - Service name
  • role_type - Role type
  • role_name - Role name
  • cluster_name - Cluster name
Returns:
An ApiRole object

get_role(resource_root, service_name, name, cluster_name='default')

source code 

Lookup a role by name

Parameters:
  • resource_root - The root Resource object.
  • service_name - Service name
  • name - Role name
  • cluster_name - Cluster name
Returns:
An ApiRole object

get_all_roles(resource_root, service_name, cluster_name='default', view=None)

source code 

Get all roles

Parameters:
  • resource_root - The root Resource object.
  • service_name - Service name
  • cluster_name - Cluster name
Returns:
A list of ApiRole objects.

get_roles_by_type(resource_root, service_name, role_type, cluster_name='default', view=None)

source code 

Get all roles of a certain type in a service

Parameters:
  • resource_root - The root Resource object.
  • service_name - Service name
  • role_type - Role type
  • cluster_name - Cluster name
Returns:
A list of ApiRole objects.

delete_role(resource_root, service_name, name, cluster_name='default')

source code 

Delete a role by name

Parameters:
  • resource_root - The root Resource object.
  • service_name - Service name
  • name - Role name
  • cluster_name - Cluster name
Returns:
The deleted ApiRole object