Revision d9fdd354
b/lib/rapi/rlib2.py | ||
---|---|---|
980 | 980 |
raise http.HttpBadRequest("Request is missing required 'instances' field" |
981 | 981 |
" in body") |
982 | 982 |
|
983 |
op_id = { |
|
984 |
"OP_ID": self.POST_OPCODE.OP_ID, # pylint: disable=E1101 |
|
985 |
} |
|
983 |
# Unlike most other RAPI calls, this one is composed of individual opcodes, |
|
984 |
# and we have to do the filling ourselves |
|
985 |
OPCODE_RENAME = { |
|
986 |
"os": "os_type", |
|
987 |
"name": "instance_name", |
|
988 |
} |
|
989 |
|
|
986 | 990 |
body = objects.FillDict(self.request_body, { |
987 |
"instances": [objects.FillDict(inst, op_id) |
|
988 |
for inst in self.request_body["instances"]], |
|
991 |
"instances": [ |
|
992 |
baserlib.FillOpcode(opcodes.OpInstanceCreate, inst, {}, OPCODE_RENAME) |
|
993 |
for inst in self.request_body["instances"] |
|
994 |
], |
|
989 | 995 |
}) |
990 | 996 |
|
991 | 997 |
return (body, { |
Also available in: Unified diff