Revision e23881ed lib/rapi/connector.py
b/lib/rapi/connector.py | ||
---|---|---|
38 | 38 |
|
39 | 39 |
|
40 | 40 |
_NAME_PATTERN = r"[\w\._-]+" |
41 |
_DISK_PATTERN = r"\d+" |
|
41 | 42 |
|
42 | 43 |
# the connection map is created at the end of this file |
43 | 44 |
CONNECTOR = {} |
... | ... | |
147 | 148 |
|
148 | 149 |
|
149 | 150 |
def GetHandlers(node_name_pattern, instance_name_pattern, |
150 |
group_name_pattern, job_id_pattern): |
|
151 |
group_name_pattern, job_id_pattern, disk_pattern):
|
|
151 | 152 |
"""Returns all supported resources and their handlers. |
152 | 153 |
|
153 | 154 |
""" |
... | ... | |
211 | 212 |
rlib2.R_2_instances_name_rename, |
212 | 213 |
re.compile(r'^/2/instances/(%s)/modify$' % instance_name_pattern): |
213 | 214 |
rlib2.R_2_instances_name_modify, |
215 |
re.compile(r"^/2/instances/(%s)/disk/(%s)/grow$" % |
|
216 |
(instance_name_pattern, disk_pattern)): |
|
217 |
rlib2.R_2_instances_name_disk_grow, |
|
214 | 218 |
|
215 | 219 |
"/2/groups": rlib2.R_2_groups, |
216 | 220 |
re.compile(r'^/2/groups/(%s)$' % group_name_pattern): |
... | ... | |
236 | 240 |
|
237 | 241 |
|
238 | 242 |
CONNECTOR.update(GetHandlers(_NAME_PATTERN, _NAME_PATTERN, _NAME_PATTERN, |
239 |
constants.JOB_ID_TEMPLATE)) |
|
243 |
constants.JOB_ID_TEMPLATE, _DISK_PATTERN)) |
Also available in: Unified diff