Jobs - Create Or Update
Creates or updates a job.
PUT https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/jobAgents/{jobAgentName}/jobs/{jobName}?api-version=2023-08-01
URI Parameters
| Name | In | Required | Type | Description |
|---|---|---|---|---|
|
job
|
path | True |
string |
The name of the job agent. |
|
job
|
path | True |
string |
The name of the job to get. |
|
resource
|
path | True |
string |
The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. |
|
server
|
path | True |
string |
The name of the server. |
|
subscription
|
path | True |
string |
The subscription ID that identifies an Azure subscription. |
|
api-version
|
query | True |
string |
The API version to use for the request. |
Request Body
| Name | Type | Description |
|---|---|---|
| properties.description |
string |
User-defined description of the job. |
| properties.schedule |
Schedule properties of the job. |
Responses
| Name | Type | Description |
|---|---|---|
| 200 OK |
Successfully updated the job. |
|
| 201 Created |
Successfully created the job. |
|
| Other Status Codes |
*** Error Responses: ***
|
Examples
| Create a job with all properties specified |
| Create a job with default properties |
Create a job with all properties specified
Sample request
PUT https://management.azure.com/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/group1/providers/Microsoft.Sql/servers/server1/jobAgents/agent1/jobs/job1?api-version=2023-08-01
{
"properties": {
"description": "my favourite job",
"schedule": {
"startTime": "2015-09-24T18:30:01Z",
"endTime": "2015-09-24T23:59:59Z",
"type": "Recurring",
"interval": "PT5M",
"enabled": true
}
}
}
Sample response
{
"id": "/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/group1/providers/Microsoft.Sql/servers/server1/jobAgents/agent1/jobs/job1",
"name": "job1",
"type": "Microsoft.Sql/servers/jobAccounts/jobs",
"properties": {
"description": "my favourite job",
"version": 0,
"schedule": {
"startTime": "2015-09-24T18:30:01Z",
"endTime": "2015-09-24T23:59:59Z",
"type": "Recurring",
"interval": "PT5M",
"enabled": true
}
}
}
{
"id": "/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/group1/providers/Microsoft.Sql/servers/server1/jobAgents/agent1/jobs/job1",
"name": "job1",
"type": "Microsoft.Sql/servers/jobAccounts/jobs",
"properties": {
"description": "my favourite job",
"version": 0,
"schedule": {
"startTime": "2015-09-24T18:30:01Z",
"endTime": "2015-09-24T23:59:59Z",
"type": "Recurring",
"interval": "PT5M",
"enabled": true
}
}
}
Create a job with default properties
Sample request
Sample response
{
"id": "/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/group1/providers/Microsoft.Sql/servers/server1/jobAgents/agent1/jobs/job1",
"name": "job1",
"type": "Microsoft.Sql/servers/jobAccounts/jobs",
"properties": {
"description": "",
"version": 0,
"schedule": {
"startTime": "0001-01-01T00:00:00Z",
"endTime": "9999-12-31T11:59:59Z",
"type": "Once",
"enabled": false
}
}
}
{
"id": "/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/group1/providers/Microsoft.Sql/servers/server1/jobAgents/agent1/jobs/job1",
"name": "job1",
"type": "Microsoft.Sql/servers/jobAccounts/jobs",
"properties": {
"description": "",
"version": 0,
"schedule": {
"startTime": "0001-01-01T00:00:00Z",
"endTime": "9999-12-31T11:59:59Z",
"type": "Once",
"enabled": false
}
}
}
Definitions
| Name | Description |
|---|---|
|
Error |
The resource management error additional info. |
|
Error |
The error detail. |
|
Error |
Error response |
| Job |
A job. |
|
Job |
Scheduling properties of a job. |
|
Job |
Schedule interval type |
ErrorAdditionalInfo
The resource management error additional info.
| Name | Type | Description |
|---|---|---|
| info |
object |
The additional info. |
| type |
string |
The additional info type. |
ErrorDetail
The error detail.
| Name | Type | Description |
|---|---|---|
| additionalInfo |
The error additional info. |
|
| code |
string |
The error code. |
| details |
The error details. |
|
| message |
string |
The error message. |
| target |
string |
The error target. |
ErrorResponse
Error response
| Name | Type | Description |
|---|---|---|
| error |
The error object. |
Job
A job.
| Name | Type | Description |
|---|---|---|
| id |
string |
Resource ID. |
| name |
string |
Resource name. |
| properties.description |
string |
User-defined description of the job. |
| properties.schedule |
Schedule properties of the job. |
|
| properties.version |
integer (int32) |
The job version number. |
| type |
string |
Resource type. |
JobSchedule
Scheduling properties of a job.
| Name | Type | Default value | Description |
|---|---|---|---|
| enabled |
boolean |
Whether or not the schedule is enabled. |
|
| endTime |
string (date-time) |
9999-12-31T17:29:59+05:30 |
Schedule end time. |
| interval |
string |
Value of the schedule's recurring interval, if the ScheduleType is recurring. ISO8601 duration format. |
|
| startTime |
string (date-time) |
0001-01-01T05:30:00+05:30 |
Schedule start time. |
| type | Once |
Schedule interval type |
JobScheduleType
Schedule interval type
| Value | Description |
|---|---|
| Once | |
| Recurring |