Merge "Allow compose node without properties"
This commit is contained in:
commit
a31acd11b0
@ -168,6 +168,7 @@ class TestNodeApi(TestApiValidation):
|
||||
def test_compose_request_invalid_params(self):
|
||||
req = {
|
||||
"name": "test_request1",
|
||||
"properties": {"invalid_key": "invalid_value"}
|
||||
}
|
||||
resp = self.app.post('/v1/nodes',
|
||||
content_type='application/json',
|
||||
|
@ -95,10 +95,42 @@ compose_node_with_flavor = {
|
||||
'additionalProperties': False,
|
||||
}
|
||||
|
||||
compose_node_with_properties = {
|
||||
'type': 'object',
|
||||
'properties': {
|
||||
'name': {'type': 'string'},
|
||||
'description': {'type': 'string'},
|
||||
'properties': {
|
||||
'type': 'object',
|
||||
'properties': {
|
||||
'memory': {
|
||||
'type': 'object',
|
||||
'properties': {
|
||||
'capacity_mib': {'type': 'string'},
|
||||
'type': {'type': 'string'}
|
||||
},
|
||||
'additionalProperties': False,
|
||||
},
|
||||
'processor': {
|
||||
'type': 'object',
|
||||
'properties': {
|
||||
'total_cores': {'type': 'string'},
|
||||
'model': {'type': 'string'},
|
||||
},
|
||||
'additionalProperties': False,
|
||||
},
|
||||
},
|
||||
'additionalProperties': False,
|
||||
},
|
||||
},
|
||||
'required': ['name'],
|
||||
'additionalProperties': False,
|
||||
}
|
||||
|
||||
compose_node_schema = {
|
||||
'anyOf': [
|
||||
compose_node_with_flavor,
|
||||
flavor_schema,
|
||||
compose_node_with_properties
|
||||
]
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user