Add session scheduling information validation.

Change-Id: Ie704a3ee31a56a1fd86d331b3c5cc79795358506
Closes-Bug: #1587069
This commit is contained in:
Pengju Jiao 2016-12-09 18:17:41 +08:00
parent cc95b6d212
commit 8ea79dd19b
2 changed files with 19 additions and 7 deletions

View File

@ -51,7 +51,7 @@ freezer_action_properties = {
},
}
job_schedule_properties = {
schedule_properties = {
"time_created": {
"id": "time_created",
"type": "integer"
@ -187,7 +187,7 @@ job_schema = {
"job_schedule": {
"id": "job_schedule",
"type": "object",
"properties": job_schedule_properties,
"properties": schedule_properties,
"additionalProperties": False,
},
"job_id": {
@ -278,7 +278,7 @@ job_patch_schema = {
"job_schedule": {
"id": "job_schedule",
"type": "object",
"properties": job_schedule_properties,
"properties": schedule_properties,
"additionalProperties": False,
},
"job_id": {
@ -368,6 +368,12 @@ session_schema = {
"id": "/",
"type": "object",
"properties": {
"schedule": {
"id": "schedule",
"type": "object",
"properties": schedule_properties,
"additionalProperties": False,
},
"session_id": {
"id": "session_id",
"pattern": "^[\w-]+$",
@ -403,6 +409,12 @@ session_patch_schema = {
"id": "/",
"type": "object",
"properties": {
"schedule": {
"id": "schedule",
"type": "object",
"properties": schedule_properties,
"additionalProperties": False,
},
"session_id": {
"id": "session_id",
"pattern": "^[\w-]+$",

View File

@ -355,8 +355,8 @@ fake_session_0 = {
"time_created": 1234,
"time_started": 1234,
"time_ended": 0,
"status": "invalid",
"schedule_time": "2015-06-02T16:20:00"
"status": "stop",
"schedule_date": "2015-06-02T16:20:00"
},
"jobs": {
'venerescollataincorpodalolita': {
@ -387,8 +387,8 @@ fake_session_1 = {
"time_created": 1234,
"time_started": 1234,
"time_ended": 0,
"status": "invalid",
"schedule_time": "2015-06-02T16:20:00"
"status": "stop",
"schedule_date": "2015-06-02T16:20:00"
},
"jobs": {
'venerescollataincorpodalolita': {