Merge "correct api schema for instance patch"
This commit is contained in:
commit
3c8112735d
@ -197,9 +197,14 @@ users_list = {
|
||||
}
|
||||
}
|
||||
|
||||
null_configuration_id = {
|
||||
"type": "null"
|
||||
}
|
||||
|
||||
configuration_id = {
|
||||
'oneOf': [
|
||||
uuid
|
||||
uuid,
|
||||
null_configuration_id
|
||||
]
|
||||
}
|
||||
|
||||
@ -301,10 +306,12 @@ instance = {
|
||||
"instance": {
|
||||
"type": "object",
|
||||
"required": [],
|
||||
"additionalProperties": False,
|
||||
"properties": {
|
||||
"slave_of": {},
|
||||
"replica_of": {},
|
||||
"name": non_empty_string,
|
||||
"configuration_id": configuration_id,
|
||||
"configuration": configuration_id,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -304,7 +304,9 @@ class InstanceController(wsgi.Controller):
|
||||
instance = models.Instance.load(context, id)
|
||||
|
||||
args = {}
|
||||
args['detach_replica'] = 'slave_of' in body['instance']
|
||||
args['detach_replica'] = ('replica_of' in body['instance'] or
|
||||
'slave_of' in body['instance'])
|
||||
|
||||
if 'name' in body['instance']:
|
||||
args['name'] = body['instance']['name']
|
||||
if 'configuration' in body['instance']:
|
||||
|
Loading…
x
Reference in New Issue
Block a user