From e0ea6bcff5a1744aaddf9a02df5cc03955410e60 Mon Sep 17 00:00:00 2001 From: Varad Meru Date: Wed, 30 May 2018 11:24:52 -0700 Subject: [PATCH] Refactoring Job Definitions (#3116) --- .../stable/2015-10-31/definitions.json | 317 +++++------------- .../stable/2015-10-31/job.json | 265 ++++++++++++++- 2 files changed, 337 insertions(+), 245 deletions(-) diff --git a/specification/automation/resource-manager/Microsoft.Automation/stable/2015-10-31/definitions.json b/specification/automation/resource-manager/Microsoft.Automation/stable/2015-10-31/definitions.json index 2007e8198995..8d619afe74b0 100644 --- a/specification/automation/resource-manager/Microsoft.Automation/stable/2015-10-31/definitions.json +++ b/specification/automation/resource-manager/Microsoft.Automation/stable/2015-10-31/definitions.json @@ -1092,6 +1092,84 @@ ], "description": "The parameters supplied to the create compilation job operation." }, + "JobStreamListResult": { + "properties": { + "value": { + "type": "array", + "items": { + "$ref": "#/definitions/JobStream" + }, + "description": "A list of job streams." + }, + "nextLink": { + "type": "string", + "description": "Gets or sets the next link." + } + }, + "description": "The response model for the list job stream operation." + }, + "JobStream": { + "properties": { + "id": { + "type": "string", + "description": "Gets or sets the id of the resource." + }, + "properties": { + "$ref": "#/definitions/JobStreamProperties", + "x-ms-client-flatten": true, + "description": "Gets or sets the id of the job stream." + } + }, + "description": "Definition of the job stream." + }, + "JobStreamProperties": { + "properties": { + "jobStreamId": { + "type": "string", + "description": "Gets or sets the id of the job stream." + }, + "time": { + "type": "string", + "format": "date-time", + "description": "Gets or sets the creation time of the job.", + "x-nullable": false + }, + "streamType": { + "type": "string", + "description": "Gets or sets the stream type.", + "enum": [ + "Progress", + "Output", + "Warning", + "Error", + "Debug", + "Verbose", + "Any" + ], + "x-ms-enum": { + "name": "JobStreamType", + "modelAsString": true + } + }, + "streamText": { + "type": "string", + "description": "Gets or sets the stream text." + }, + "summary": { + "type": "string", + "description": "Gets or sets the summary." + }, + "value": { + "type": "object", + "additionalProperties": { + "type": "object" + }, + "description": "Gets or sets the values of the job stream." + } + }, + "x-ms-client-flatten": true, + "description": "Definition of the job stream." + }, "DscCompilationJobProperties": { "properties": { "configuration": { @@ -1842,72 +1920,6 @@ }, "description": "Parameters supplied to the update operation." }, - "Job": { - "properties": { - "id": { - "type": "string", - "description": "Id of the resource." - }, - "properties": { - "$ref": "./definitions.json#/definitions/JobProperties", - "x-ms-client-flatten": true, - "description": "The properties of the job." - } - }, - "description": "Definition of the job." - }, - "JobCreateProperties": { - "properties": { - "runbook": { - "$ref": "./definitions.json#/definitions/RunbookAssociationProperty", - "description": "Gets or sets the runbook." - }, - "parameters": { - "type": "object", - "additionalProperties": { - "type": "string" - }, - "description": "Gets or sets the parameters of the job." - }, - "runOn": { - "type": "string", - "description": "Gets or sets the runOn which specifies the group name where the job is to be executed." - } - }, - "required": [ - "runbook" - ], - "description": "The parameters supplied to the create job operation." - }, - "JobCreateParameters": { - "properties": { - "properties": { - "$ref": "./definitions.json#/definitions/JobCreateProperties", - "x-ms-client-flatten": true, - "description": "Gets or sets the list of job properties." - } - }, - "required": [ - "properties" - ], - "description": "The parameters supplied to the create job operation." - }, - "JobListResult": { - "properties": { - "value": { - "type": "array", - "items": { - "$ref": "./definitions.json#/definitions/Job" - }, - "description": "Gets or sets a list of jobs." - }, - "nextLink": { - "type": "string", - "description": "Gets or sets the next link." - } - }, - "description": "The response model for the list job operation." - }, "JobScheduleCreateProperties": { "properties": { "schedule": { @@ -2018,179 +2030,6 @@ }, "description": "The response model for the list job schedule operation." }, - "JobStream": { - "properties": { - "id": { - "type": "string", - "description": "Gets or sets the id of the resource." - }, - "properties": { - "$ref": "./definitions.json#/definitions/JobStreamProperties", - "x-ms-client-flatten": true, - "description": "Gets or sets the id of the job stream." - } - }, - "description": "Definition of the job stream." - }, - "JobStreamListResult": { - "properties": { - "value": { - "type": "array", - "items": { - "$ref": "./definitions.json#/definitions/JobStream" - }, - "description": "A list of job streams." - }, - "nextLink": { - "type": "string", - "description": "Gets or sets the next link." - } - }, - "description": "The response model for the list job stream operation." - }, - "JobProperties": { - "properties": { - "runbook": { - "$ref": "./definitions.json#/definitions/RunbookAssociationProperty", - "description": "Gets or sets the runbook." - }, - "startedBy": { - "type": "string", - "description": "Gets or sets the job started by." - }, - "runOn": { - "type": "string", - "description": "Gets or sets the runOn which specifies the group name where the job is to be executed." - }, - "jobId": { - "type": "string", - "format": "uuid", - "description": "Gets or sets the id of the job.", - "x-nullable": false - }, - "creationTime": { - "type": "string", - "format": "date-time", - "description": "Gets or sets the creation time of the job.", - "x-nullable": false - }, - "status": { - "type": "string", - "description": "Gets or sets the status of the job.", - "enum": [ - "New", - "Activating", - "Running", - "Completed", - "Failed", - "Stopped", - "Blocked", - "Suspended", - "Disconnected", - "Suspending", - "Stopping", - "Resuming", - "Removing" - ], - "x-ms-enum": { - "name": "JobStatus", - "modelAsString": true - } - }, - "statusDetails": { - "type": "string", - "description": "Gets or sets the status details of the job." - }, - "startTime": { - "type": "string", - "format": "date-time", - "description": "Gets or sets the start time of the job.", - "x-nullable": true - }, - "endTime": { - "type": "string", - "format": "date-time", - "description": "Gets or sets the end time of the job.", - "x-nullable": true - }, - "exception": { - "type": "string", - "description": "Gets or sets the exception of the job." - }, - "lastModifiedTime": { - "type": "string", - "format": "date-time", - "description": "Gets or sets the last modified time of the job.", - "x-nullable": true - }, - "lastStatusModifiedTime": { - "type": "string", - "format": "date-time", - "description": "Gets or sets the last status modified time of the job.", - "x-nullable": true - }, - "parameters": { - "type": "object", - "additionalProperties": { - "type": "string" - }, - "description": "Gets or sets the parameters of the job." - }, - "provisioningState": { - "$ref": "#/definitions/JobProvisioningStateProperty", - "description": "The provisioning state of a resource." - } - }, - "description": "Definition of job properties." - }, - "JobStreamProperties": { - "properties": { - "jobStreamId": { - "type": "string", - "description": "Gets or sets the id of the job stream." - }, - "time": { - "type": "string", - "format": "date-time", - "description": "Gets or sets the creation time of the job.", - "x-nullable": false - }, - "streamType": { - "type": "string", - "description": "Gets or sets the stream type.", - "enum": [ - "Progress", - "Output", - "Warning", - "Error", - "Debug", - "Verbose", - "Any" - ], - "x-ms-enum": { - "name": "JobStreamType", - "modelAsString": true - } - }, - "streamText": { - "type": "string", - "description": "Gets or sets the stream text." - }, - "summary": { - "type": "string", - "description": "Gets or sets the summary." - }, - "value": { - "type": "object", - "additionalProperties": { - "type": "object" - }, - "description": "Gets or sets the values of the job stream." - } - }, - "x-ms-client-flatten": true, - "description": "Definition of the job stream." - }, "Key":{ "properties": { "keyName": { diff --git a/specification/automation/resource-manager/Microsoft.Automation/stable/2015-10-31/job.json b/specification/automation/resource-manager/Microsoft.Automation/stable/2015-10-31/job.json index b7f13d811c8d..f06bcc73a6c6 100644 --- a/specification/automation/resource-manager/Microsoft.Automation/stable/2015-10-31/job.json +++ b/specification/automation/resource-manager/Microsoft.Automation/stable/2015-10-31/job.json @@ -291,7 +291,7 @@ "200": { "description": "OK", "schema": { - "$ref": "./definitions.json#/definitions/Job" + "$ref": "#/definitions/Job" } }, "default": { @@ -340,7 +340,7 @@ "in": "body", "required": true, "schema": { - "$ref": "./definitions.json#/definitions/JobCreateParameters" + "$ref": "#/definitions/JobCreateParameters" }, "description": "The parameters supplied to the create job operation." }, @@ -355,7 +355,7 @@ "201": { "description": "Created", "schema": { - "$ref": "./definitions.json#/definitions/Job" + "$ref": "#/definitions/Job" } }, "default": { @@ -411,7 +411,7 @@ "200": { "description": "OK", "schema": { - "$ref": "./definitions.json#/definitions/JobListResult" + "$ref": "#/definitions/JobListResult" } }, "default": { @@ -526,7 +526,7 @@ "200": { "description": "OK", "schema": { - "$ref": "./definitions.json#/definitions/JobStream" + "$ref": "#/definitions/JobStream" } }, "default": { @@ -600,6 +600,259 @@ } } }, - "definitions": {}, + "definitions": { + "Job": { + "properties": { + "id": { + "type": "string", + "description": "Id of the resource." + }, + "properties": { + "$ref": "#/definitions/JobProperties", + "x-ms-client-flatten": true, + "description": "The properties of the job." + } + }, + "description": "Definition of the job." + }, + "JobListResult": { + "properties": { + "value": { + "type": "array", + "items": { + "$ref": "#/definitions/Job" + }, + "description": "Gets or sets a list of jobs." + }, + "nextLink": { + "type": "string", + "description": "Gets or sets the next link." + } + }, + "description": "The response model for the list job operation." + }, + "JobProperties": { + "properties": { + "runbook": { + "$ref": "#/definitions/RunbookAssociationProperty", + "description": "Gets or sets the runbook." + }, + "startedBy": { + "type": "string", + "description": "Gets or sets the job started by." + }, + "runOn": { + "type": "string", + "description": "Gets or sets the runOn which specifies the group name where the job is to be executed." + }, + "jobId": { + "type": "string", + "format": "uuid", + "description": "Gets or sets the id of the job.", + "x-nullable": false + }, + "creationTime": { + "type": "string", + "format": "date-time", + "description": "Gets or sets the creation time of the job.", + "x-nullable": false + }, + "status": { + "type": "string", + "description": "Gets or sets the status of the job.", + "enum": [ + "New", + "Activating", + "Running", + "Completed", + "Failed", + "Stopped", + "Blocked", + "Suspended", + "Disconnected", + "Suspending", + "Stopping", + "Resuming", + "Removing" + ], + "x-ms-enum": { + "name": "JobStatus", + "modelAsString": true + } + }, + "statusDetails": { + "type": "string", + "description": "Gets or sets the status details of the job." + }, + "startTime": { + "type": "string", + "format": "date-time", + "description": "Gets or sets the start time of the job.", + "x-nullable": true + }, + "endTime": { + "type": "string", + "format": "date-time", + "description": "Gets or sets the end time of the job.", + "x-nullable": true + }, + "exception": { + "type": "string", + "description": "Gets or sets the exception of the job." + }, + "lastModifiedTime": { + "type": "string", + "format": "date-time", + "description": "Gets or sets the last modified time of the job.", + "x-nullable": true + }, + "lastStatusModifiedTime": { + "type": "string", + "format": "date-time", + "description": "Gets or sets the last status modified time of the job.", + "x-nullable": true + }, + "parameters": { + "type": "object", + "additionalProperties": { + "type": "string" + }, + "description": "Gets or sets the parameters of the job." + }, + "provisioningState": { + "$ref": "#/definitions/JobProvisioningStateProperty", + "description": "The provisioning state of a resource." + } + }, + "description": "Definition of job properties." + }, + "RunbookAssociationProperty": { + "properties": { + "name": { + "type": "string", + "description": "Gets or sets the name of the runbook." + } + }, + "description": "The runbook property associated with the entity." + }, + "JobProvisioningStateProperty": { + "properties": { + "provisioningState": { + "readOnly": true, + "type": "string", + "description": "The provisioning state of the resource.", + "enum": [ + "Failed", + "Succeeded", + "Suspended", + "Processing" + ], + "x-ms-enum": { + "name": "JobProvisioningState", + "modelAsString": true + } + } + }, + "description": "The provisioning state property." + }, + "JobCreateParameters": { + "properties": { + "properties": { + "$ref": "#/definitions/JobCreateProperties", + "x-ms-client-flatten": true, + "description": "Gets or sets the list of job properties." + } + }, + "required": [ + "properties" + ], + "description": "The parameters supplied to the create job operation." + }, + "JobCreateProperties": { + "properties": { + "runbook": { + "$ref": "#/definitions/RunbookAssociationProperty", + "description": "Gets or sets the runbook." + }, + "parameters": { + "type": "object", + "additionalProperties": { + "type": "string" + }, + "description": "Gets or sets the parameters of the job." + }, + "runOn": { + "type": "string", + "description": "Gets or sets the runOn which specifies the group name where the job is to be executed." + } + }, + "required": [ + "runbook" + ], + "description": "The parameters supplied to the create job operation." + }, + "JobStream": { + "properties": { + "id": { + "type": "string", + "description": "Gets or sets the id of the resource." + }, + "properties": { + "$ref": "#/definitions/JobStreamProperties", + "x-ms-client-flatten": true, + "description": "Gets or sets the id of the job stream." + } + }, + "description": "Definition of the job stream." + }, + "JobStreamProperties": { + "properties": { + "jobStreamId": { + "type": "string", + "description": "Gets or sets the id of the job stream." + }, + "time": { + "type": "string", + "format": "date-time", + "description": "Gets or sets the creation time of the job.", + "x-nullable": false + }, + "streamType": { + "type": "string", + "description": "Gets or sets the stream type.", + "enum": [ + "Progress", + "Output", + "Warning", + "Error", + "Debug", + "Verbose", + "Any" + ], + "x-ms-enum": { + "name": "JobStreamType", + "modelAsString": true + } + }, + "streamText": { + "type": "string", + "description": "Gets or sets the stream text." + }, + "summary": { + "type": "string", + "description": "Gets or sets the summary." + }, + "value": { + "type": "object", + "additionalProperties": { + "type": "object" + }, + "description": "Gets or sets the values of the job stream." + } + }, + "x-ms-client-flatten": true, + "description": "Definition of the job stream." + } + }, "parameters": {} }