-
Notifications
You must be signed in to change notification settings - Fork 5.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add specs for start, stop & executions for Container Apps Jobs #22594
Changes from 12 commits
cd4b446
7847035
f58d64b
51883a5
20cc731
f6eb5ee
09d7743
535a0b2
ce59029
8846578
8fc91c6
faa7968
efc199d
5413b21
57b2d9e
932cf90
ee770b2
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -349,13 +349,25 @@ | |
"type": "string", | ||
"pattern": "^[-\\w\\._\\(\\)]+$" | ||
}, | ||
{ | ||
"name": "template", | ||
"in": "body", | ||
"description": "Properties used to create a container apps job", | ||
anandanthony marked this conversation as resolved.
Show resolved
Hide resolved
|
||
"required": true, | ||
"schema": { | ||
"$ref": "#/definitions/JobExecutionTemplate" | ||
} | ||
}, | ||
{ | ||
"$ref": "../../../../../common-types/resource-management/v3/types.json#/parameters/ApiVersionParameter" | ||
} | ||
], | ||
"responses": { | ||
"200": { | ||
"description": "Container Apps Jobs started successfully." | ||
"description": "OK", | ||
"schema": { | ||
"$ref": "#/definitions/JobExecutionBase" | ||
} | ||
}, | ||
"202": { | ||
"description": "OK", | ||
|
@@ -383,7 +395,7 @@ | |
} | ||
} | ||
}, | ||
"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/jobs/{jobName}/stop": { | ||
"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/jobs/{jobName}/executions/{jobExecutionName}/stop": { | ||
"post": { | ||
"tags": [ | ||
"Jobs" | ||
|
@@ -407,6 +419,14 @@ | |
"required": true, | ||
"type": "string", | ||
"pattern": "^[-\\w\\._\\(\\)]+$" | ||
}, | ||
{ | ||
"name": "jobExecutionName", | ||
"in": "path", | ||
"description": "Name of the Container Apps Job's Execution.", | ||
anandanthony marked this conversation as resolved.
Show resolved
Hide resolved
|
||
"required": true, | ||
"type": "string", | ||
"pattern": "^[-\\w\\._\\(\\)]+$" | ||
} | ||
], | ||
"responses": { | ||
|
@@ -430,9 +450,136 @@ | |
}, | ||
"x-ms-examples": { | ||
"Terminate a Container Apps Job": { | ||
"$ref": "./examples/Job_Stop.json" | ||
"$ref": "./examples/Job__Stop_Execution.json" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @vinisoto yes, it was a typo.. fixed it. |
||
} | ||
}, | ||
"x-ms-long-running-operation": true, | ||
"x-ms-long-running-operation-options": { | ||
"final-state-via": "location" | ||
} | ||
} | ||
}, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We should also add the stopAll endpoint here and implement it to reduce overhead. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @trajkobal can we reuse this endpoint? If the customer does not give a payload consisting of the job executions to be stopped, we stop all? I believe we would have to rename the endpoint to "StopAll" just so their is no confusion and the payload will make sense then, that if we have a payload passed we will only stop those job executions.?
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. What would be the difference between these two in this case?: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/jobs/{jobName}/stop I think it is clearer to have only |
||
"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/jobs/{jobName}/stop": { | ||
"post": { | ||
"tags": [ | ||
"Jobs" | ||
], | ||
"summary": "Terminates execution of a running container apps job", | ||
"operationId": "Job_terminateMultipleExecutions", | ||
"parameters": [ | ||
{ | ||
"$ref": "../../../../../common-types/resource-management/v3/types.json#/parameters/SubscriptionIdParameter" | ||
}, | ||
{ | ||
"$ref": "../../../../../common-types/resource-management/v3/types.json#/parameters/ResourceGroupNameParameter" | ||
}, | ||
{ | ||
"$ref": "../../../../../common-types/resource-management/v3/types.json#/parameters/ApiVersionParameter" | ||
}, | ||
{ | ||
"name": "jobName", | ||
"in": "path", | ||
"description": "Name of the Container Apps Job.", | ||
"required": true, | ||
"type": "string", | ||
"pattern": "^[-\\w\\._\\(\\)]+$" | ||
}, | ||
{ | ||
"name": "jobExecutionName", | ||
"in": "body", | ||
"description": "List of all job executions that should be stopped.", | ||
"required": true, | ||
"schema": { | ||
"$ref": "#/definitions/JobExecutionNamesCollection" | ||
} | ||
} | ||
], | ||
"responses": { | ||
"200": { | ||
"description": "Container Apps Jobs terminated successfully." | ||
anandanthony marked this conversation as resolved.
Show resolved
Hide resolved
|
||
}, | ||
"202": { | ||
"description": "OK", | ||
"headers": { | ||
"Location": { | ||
"type": "string" | ||
} | ||
} | ||
}, | ||
"default": { | ||
"description": "Common error response.", | ||
"schema": { | ||
"$ref": "./CommonDefinitions.json#/definitions/DefaultErrorResponse" | ||
} | ||
} | ||
}, | ||
"x-ms-examples": { | ||
"Terminate Multiple Container Apps Job": { | ||
"$ref": "./examples/Job_Stop_Multiple.json" | ||
} | ||
}, | ||
"x-ms-long-running-operation": true, | ||
"x-ms-long-running-operation-options": { | ||
"final-state-via": "location" | ||
} | ||
} | ||
}, | ||
"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/jobs/{jobName}/executions": { | ||
"post": { | ||
"tags": [ | ||
"Jobs" | ||
], | ||
"summary": "Get a Container Apps Job's executions", | ||
"operationId": "Job_Executions", | ||
"parameters": [ | ||
{ | ||
"$ref": "../../../../../common-types/resource-management/v3/types.json#/parameters/SubscriptionIdParameter" | ||
}, | ||
{ | ||
"$ref": "../../../../../common-types/resource-management/v3/types.json#/parameters/ResourceGroupNameParameter" | ||
}, | ||
{ | ||
"name": "jobName", | ||
"in": "path", | ||
"description": "Name of the Container Apps Job.", | ||
"required": true, | ||
"type": "string", | ||
"pattern": "^[-\\w\\._\\(\\)]+$" | ||
}, | ||
{ | ||
"$ref": "../../../../../common-types/resource-management/v3/types.json#/parameters/ApiVersionParameter" | ||
} | ||
], | ||
"responses": { | ||
"200": { | ||
"description": "OK", | ||
"schema": { | ||
"$ref": "#/definitions/ContainerAppJobExecutions" | ||
} | ||
}, | ||
"202": { | ||
"description": "OK", | ||
"headers": { | ||
"Location": { | ||
"type": "string" | ||
} | ||
} | ||
}, | ||
"default": { | ||
"description": "Common error response.", | ||
"schema": { | ||
"$ref": "./CommonDefinitions.json#/definitions/DefaultErrorResponse" | ||
} | ||
} | ||
}, | ||
"x-ms-examples": { | ||
"Run a Container Apps Job": { | ||
"$ref": "./examples/Job_Executions.json" | ||
} | ||
}, | ||
"x-ms-pageable": { | ||
"nextLinkName": "nextLink" | ||
}, | ||
"x-ms-long-running-operation": true, | ||
"x-ms-long-running-operation-options": { | ||
"final-state-via": "location" | ||
|
@@ -758,6 +905,169 @@ | |
"description": "Number of parallel replicas of a job that can run at a given time.", | ||
"format": "int32", | ||
"type": "integer" | ||
}, | ||
"JobExecutionBase": { | ||
"description": "Container App's Job execution name.", | ||
"type": "object", | ||
"properties": { | ||
"name": { | ||
"description": "Job execution name.", | ||
"type": "string" | ||
}, | ||
"id": { | ||
"description": "Job execution Id.", | ||
"type": "string" | ||
} | ||
} | ||
}, | ||
"JobExecution": { | ||
"description": "Container Apps Jobs execution.", | ||
"type": "object", | ||
"properties": { | ||
"name": { | ||
"description": "Job execution Name.", | ||
"type": "string" | ||
}, | ||
"id": { | ||
"description": "Job execution Id.", | ||
"type": "string" | ||
}, | ||
"type": { | ||
"description": "Job Type.", | ||
"type": "string" | ||
}, | ||
"status": { | ||
"description": "Current running State of the job", | ||
"enum": [ | ||
"Running", | ||
"Processing", | ||
"Stopped", | ||
"Degraded", | ||
"Failed", | ||
"Unknown" | ||
], | ||
"type": "string", | ||
"readOnly": true, | ||
"x-ms-enum": { | ||
"name": "JobExecutionRunningState", | ||
"modelAsString": true | ||
} | ||
}, | ||
"startTime": { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
"description": "Job execution start time.", | ||
"format": "date-time", | ||
"type": "string" | ||
}, | ||
"template": { | ||
"description": "Job's execution container.", | ||
"$ref": "#/definitions/JobExecutionTemplate" | ||
} | ||
} | ||
}, | ||
"ContainerAppJobExecutions": { | ||
"description": "Container App executions collection ARM resource.", | ||
"type": "object", | ||
"properties": { | ||
"value": { | ||
"description": "Collection of resources.", | ||
"type": "array", | ||
"items": { | ||
"$ref": "#/definitions/JobExecution" | ||
} | ||
}, | ||
"nextLink": { | ||
"description": "Link to next page of resources.", | ||
"type": "string", | ||
"readOnly": true | ||
} | ||
}, | ||
"required": [ | ||
"value" | ||
] | ||
}, | ||
"JobExecutionNamesCollection": { | ||
"description": "Container App executions names list.", | ||
"required": [ | ||
"value" | ||
], | ||
"type": "object", | ||
"properties": { | ||
"value": { | ||
"description": "Collection of resources.", | ||
"type": "array", | ||
"items": { | ||
"$ref": "#/definitions/JobExecutionBase" | ||
} | ||
} | ||
} | ||
}, | ||
"JobExecutionTemplate": { | ||
"description": "Job's execution template, containing container configuration for a job's execution", | ||
"type": "object", | ||
"properties": { | ||
"containers": { | ||
"description": "List of container definitions for the Container Apps Job.", | ||
"type": "array", | ||
"items": { | ||
"$ref": "#/definitions/JobExecutionContainer" | ||
}, | ||
"x-ms-identifiers": [ | ||
"name" | ||
] | ||
}, | ||
"initContainers": { | ||
"description": "List of specialized containers that run before job containers.", | ||
"type": "array", | ||
"items": { | ||
"$ref": "#/definitions/JobExecutionContainer" | ||
}, | ||
"x-ms-identifiers": [ | ||
"name" | ||
] | ||
} | ||
} | ||
}, | ||
"JobExecutionContainer": { | ||
"description": "Container Apps Jobs execution container definition.", | ||
"type": "object", | ||
"properties": { | ||
"image": { | ||
"description": "Container image tag.", | ||
"type": "string" | ||
}, | ||
"name": { | ||
"description": "Custom container name.", | ||
"type": "string" | ||
}, | ||
"command": { | ||
"description": "Container start command.", | ||
"type": "array", | ||
"items": { | ||
"type": "string" | ||
} | ||
}, | ||
"args": { | ||
"description": "Container start command arguments.", | ||
"type": "array", | ||
"items": { | ||
"type": "string" | ||
} | ||
}, | ||
"env": { | ||
"description": "Container environment variables.", | ||
"type": "array", | ||
"items": { | ||
"$ref": "./CommonDefinitions.json#/definitions/EnvironmentVar" | ||
}, | ||
"x-ms-identifiers": [ | ||
"name" | ||
] | ||
}, | ||
"resources": { | ||
"$ref": "./CommonDefinitions.json#/definitions/ContainerResources", | ||
"description": "Container resource requirements." | ||
} | ||
} | ||
} | ||
}, | ||
"securityDefinitions": { | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
pl check the warnings here and make corrections - https://github.com/Azure/azure-rest-api-specs/pull/22594/checks?check_run_id=11428332921
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@rkmanda we have addressed some of the comments. For the others related to the operation names, the current names best define the operation behavior. Can you please proceed with merging this PR?