Merge "Add missing schema for update agent API"

This commit is contained in:
Jenkins
2015-09-24 16:18:15 +00:00
committed by Gerrit Code Review
3 changed files with 23 additions and 3 deletions

View File

@@ -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]
}

View File

@@ -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)

View File

@@ -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
}
}