Share via


Jobs - List By Agent

Gets a list of jobs.

GET https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/jobAgents/{jobAgentName}/jobs?api-version=2023-08-01

URI Parameters

Name In Required Type Description
jobAgentName
path True

string

The name of the job agent.

resourceGroupName
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.

serverName
path True

string

The name of the server.

subscriptionId
path True

string

The subscription ID that identifies an Azure subscription.

api-version
query True

string

The API version to use for the request.

Responses

Name Type Description
200 OK

JobListResult

Successfully retrieved the list of jobs.

Other Status Codes

ErrorResponse

*** Error Responses: ***

  • 400 ManagedInstanceStoppingOrStopped - Conflicting operation submitted while instance is in stopping/stopped state

  • 400 ManagedInstanceStarting - Conflicting operation submitted while instance is in starting state

  • 404 JobAgentNotFound - Specified job agent does not exist in the specified logical server.

  • 404 ServerNotInSubscriptionResourceGroup - Specified server does not exist in the specified resource group and subscription.

  • 404 SubscriptionDoesNotHaveServer - The requested server was not found

Examples

List jobs in a job agent

Sample request

GET https://management.azure.com/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/group1/providers/Microsoft.Sql/servers/server1/jobAgents/agent1/jobs?api-version=2023-08-01

Sample response

{
  "value": [
    {
      "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/job3",
      "name": "job3",
      "type": "Microsoft.Sql/servers/jobAccounts/jobs",
      "properties": {
        "description": "this job will be scheduled once",
        "version": 1,
        "schedule": {
          "startTime": "2017-07-01T03:45:00Z",
          "endTime": "2017-12-27T06:00:00Z",
          "type": "Once",
          "enabled": true
        }
      }
    },
    {
      "id": "/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/group1/providers/Microsoft.Sql/servers/server1/jobAgents/agent1/jobs/job2",
      "name": "job2",
      "type": "Microsoft.Sql/servers/jobAccounts/jobs",
      "properties": {
        "description": "this job will never be automatically scheduled",
        "version": 1,
        "schedule": {
          "startTime": "2017-07-01T03:45:00Z",
          "endTime": "2017-12-27T06:00:00Z",
          "type": "Once",
          "enabled": false
        }
      }
    }
  ]
}

Definitions

Name Description
ErrorAdditionalInfo

The resource management error additional info.

ErrorDetail

The error detail.

ErrorResponse

Error response

Job

A job.

JobListResult

A list of jobs.

JobSchedule

Scheduling properties of a job.

JobScheduleType

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

ErrorAdditionalInfo[]

The error additional info.

code

string

The error code.

details

ErrorDetail[]

The error details.

message

string

The error message.

target

string

The error target.

ErrorResponse

Error response

Name Type Description
error

ErrorDetail

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

JobSchedule

Schedule properties of the job.

properties.version

integer (int32)

The job version number.

type

string

Resource type.

JobListResult

A list of jobs.

Name Type Description
nextLink

string

Link to retrieve next page of results.

value

Job[]

Array of results.

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

JobScheduleType

Once

Schedule interval type

JobScheduleType

Schedule interval type

Value Description
Once
Recurring