Merge "Add validation for action_logs.additional_info field"

This commit is contained in:
Jenkins 2014-10-29 15:51:26 +00:00 committed by Gerrit Code Review
commit edc03d4168
2 changed files with 70 additions and 20 deletions

View File

@ -14,20 +14,55 @@
"master_node_uid": {"type": "string"},
"external_id": {"type": "integer"},
"body": {
"type": "object",
"properties": {
"id": {"type": "number"},
"actor_id": {"type": ["string", "null"]},
"action_group": {"type": "string"},
"action_name": {"type": "string"},
"action_type": {"type": "string"},
"start_timestamp": {"type": "string"},
"end_timestamp": {"type": "string"},
"additional_info": {"type": "object"},
"is_sent": {"type": "boolean"},
"cluster_id": {"type": ["number", "null"]},
"task_uuid": {"type": ["string", "null"]}
}
"oneOf": [
{
"type": "object",
"properties": {
"id": {"type": "number"},
"actor_id": {"type": ["string", "null"]},
"action_group": {"type": "string"},
"action_name": {"type": "string"},
"action_type": {"enum": ["http_request"]},
"start_timestamp": {"type": "string"},
"end_timestamp": {"type": "string"},
"additional_info": {
"type": "object",
"properties": {
"request_data": {"type": "object"},
"response_data": {"type": "object"}
}
},
"is_sent": {"type": "boolean"},
"cluster_id": {"type": ["number", "null"]},
"task_uuid": {"type": ["string", "null"]}
}
},
{
"type": "object",
"properties": {
"id": {"type": "number"},
"actor_id": {"type": ["string", "null"]},
"action_group": {"type": "string"},
"action_name": {"type": "string"},
"action_type": {"enum": ["nailgun_task"]},
"start_timestamp": {"type": "string"},
"end_timestamp": {"type": "string"},
"additional_info": {
"type": "object",
"properties": {
"parent_task_id": {"type": "number"},
"subtasks_ids": {"type": "array"},
"operation": {"type": "string"},
"nodes_from_resp": {"type": "array"},
"ended_with_status": {"type": "string"}
}
},
"is_sent": {"type": "boolean"},
"cluster_id": {"type": ["number", "null"]},
"task_uuid": {"type": ["string", "null"]}
}
}
]
}
},
"required": ["master_node_uid", "external_id", "body"]

View File

@ -48,10 +48,13 @@ class TestActionLogs(DbTest):
"actor_id": "",
"action_group": "",
"action_name": "",
"action_type": "",
"action_type": "http_request",
"start_timestamp": "",
"end_timestamp": "",
"additional_info": {},
"additional_info": {
"request_data": {},
"response_data": {}
},
"is_sent": False,
"cluster_id": 5,
"task_uuid": None
@ -89,10 +92,16 @@ class TestActionLogs(DbTest):
"actor_id": "",
"action_group": "",
"action_name": "",
"action_type": "",
"action_type": "nailgun_task",
"start_timestamp": "",
"end_timestamp": "",
"additional_info": {},
"additional_info": {
"parent_task_id": 0,
"subtasks_ids": [],
"operation": "",
"nodes_from_resp": [],
"ended_with_status": ""
},
"is_sent": False,
"cluster_id": 5,
"task_uuid": None
@ -124,10 +133,16 @@ class TestActionLogs(DbTest):
"actor_id": "",
"action_group": "",
"action_name": "",
"action_type": "",
"action_type": "nailgun_task",
"start_timestamp": "",
"end_timestamp": "",
"additional_info": {},
"additional_info": {
"parent_task_id": 0,
"subtasks_ids": [],
"operation": "",
"nodes_from_resp": [],
"ended_with_status": ""
},
"is_sent": False,
"cluster_id": 5,
"task_uuid": None