Merge "Add missing schema for update agent API"
This commit is contained in:
@@ -55,6 +55,28 @@ create_agent = {
|
||||
}
|
||||
}
|
||||
|
||||
update_agent = {
|
||||
'status_code': [200],
|
||||
'response_body': {
|
||||
'type': 'object',
|
||||
'properties': {
|
||||
'agent': {
|
||||
'type': 'object',
|
||||
'properties': {
|
||||
'agent_id': {'type': ['integer', 'string']},
|
||||
'version': {'type': 'string'},
|
||||
'url': {'type': 'string', 'format': 'uri'},
|
||||
'md5hash': {'type': 'string'}
|
||||
},
|
||||
'additionalProperties': False,
|
||||
'required': ['agent_id', 'version', 'url', 'md5hash']
|
||||
}
|
||||
},
|
||||
'additionalProperties': False,
|
||||
'required': ['agent']
|
||||
}
|
||||
}
|
||||
|
||||
delete_agent = {
|
||||
'status_code': [200]
|
||||
}
|
||||
|
@@ -51,4 +51,5 @@ class AgentsClient(rest_client.RestClient):
|
||||
put_body = json.dumps({'para': kwargs})
|
||||
resp, body = self.put('os-agents/%s' % agent_id, put_body)
|
||||
body = json.loads(body)
|
||||
self.validate_response(schema.update_agent, resp, body)
|
||||
return rest_client.ResponseBody(resp, body)
|
||||
|
@@ -33,11 +33,8 @@ class TestAgentsClient(base.BaseComputeServiceTest):
|
||||
FAKE_UPDATE_AGENT = {
|
||||
"agent": {
|
||||
"url": "http://foo.com",
|
||||
"hypervisor": "kvm",
|
||||
"md5hash": "md5",
|
||||
"version": "2",
|
||||
"architecture": "x86_64",
|
||||
"os": "linux",
|
||||
"agent_id": 1
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user