- "/2/jobs": rlib2.R_2_jobs,
- "/2/nodes": rlib2.R_2_nodes,
- "/2/instances": rlib2.R_2_instances,
- re.compile(r'^/2/instances/([\w\._-]+)$'): rlib1.R_instances_name,
- re.compile(r'^/2/instances/([\w\._-]+)/tags$'): rlib2.R_2_instances_name_tags,
- re.compile(r'^/2/instances/([\w\._-]+)/reboot$'):
+ @return: a dictionary with 'name' and 'uri' keys for each of them.
+
+ """
+ return baserlib.BuildUriList(_getResources("2"), "/2/%s")
+
+
+def GetHandlers(node_name_pattern, instance_name_pattern, job_id_pattern):
+ """Returns all supported resources and their handlers.
+
+ """
+ return {
+ "/": R_root,
+
+ "/version": rlib2.R_version,
+
+ "/2": R_2,
+
+ "/2/nodes": rlib2.R_2_nodes,
+ re.compile(r'^/2/nodes/(%s)$' % node_name_pattern):
+ rlib2.R_2_nodes_name,
+ re.compile(r'^/2/nodes/(%s)/tags$' % node_name_pattern):
+ rlib2.R_2_nodes_name_tags,
+ re.compile(r'^/2/nodes/(%s)/role$' % node_name_pattern):
+ rlib2.R_2_nodes_name_role,
+ re.compile(r'^/2/nodes/(%s)/evacuate$' % node_name_pattern):
+ rlib2.R_2_nodes_name_evacuate,
+ re.compile(r'^/2/nodes/(%s)/migrate$' % node_name_pattern):
+ rlib2.R_2_nodes_name_migrate,
+ re.compile(r'^/2/nodes/(%s)/storage$' % node_name_pattern):
+ rlib2.R_2_nodes_name_storage,
+ re.compile(r'^/2/nodes/(%s)/storage/modify$' % node_name_pattern):
+ rlib2.R_2_nodes_name_storage_modify,
+ re.compile(r'^/2/nodes/(%s)/storage/repair$' % node_name_pattern):
+ rlib2.R_2_nodes_name_storage_repair,
+
+ "/2/instances": rlib2.R_2_instances,
+ re.compile(r'^/2/instances/(%s)$' % instance_name_pattern):
+ rlib2.R_2_instances_name,
+ re.compile(r'^/2/instances/(%s)/info$' % instance_name_pattern):
+ rlib2.R_2_instances_name_info,
+ re.compile(r'^/2/instances/(%s)/tags$' % instance_name_pattern):
+ rlib2.R_2_instances_name_tags,
+ re.compile(r'^/2/instances/(%s)/reboot$' % instance_name_pattern):