Schedule - Create Or Update

Create a schedule.

PUT https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/schedules/{scheduleName}?api-version=2015-10-31

URI Parameters

Name In Required Type Description
subscriptionId
path True
  • string

Gets subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.

resourceGroupName
path True
  • string

Name of an Azure Resource group.

Regex pattern: ^[-\w\._]+$

automationAccountName
path True
  • string

The name of the automation account.

scheduleName
path True
  • string

The schedule name.

api-version
query True
  • string

Client Api Version.

Request Body

Name Required Type Description
name True
  • string

Gets or sets the name of the Schedule.

properties.advancedSchedule

Gets or sets the AdvancedSchedule.

properties.description
  • string

Gets or sets the description of the schedule.

properties.expiryTime
  • string

Gets or sets the end time of the schedule.

properties.frequency True

Gets or sets the frequency of the schedule.

properties.interval

Gets or sets the interval of the schedule.

properties.startTime True
  • string

Gets or sets the start time of the schedule.

properties.timeZone
  • string

Gets or sets the time zone of the schedule.

Responses

Name Type Description
200 OK

OK

201 Created

Created

Other Status Codes

Conflict

Other Status Codes

Automation error response describing why the operation failed.

Examples

Create or update a schedule

Sample Request

PUT https://management.azure.com/subscriptions/subid/resourceGroups/rg/providers/Microsoft.Automation/automationAccounts/myAutomationAccount33/schedules/mySchedule?api-version=2015-10-31
{
  "name": "mySchedule",
  "properties": {
    "description": "my description of schedule goes here",
    "startTime": "2017-03-27T17:28:57.2494819Z",
    "expiryTime": "2017-04-01T17:28:57.2494819Z",
    "interval": 1,
    "frequency": "Hour",
    "advancedSchedule": {}
  }
}

Sample Response

{
  "id": "/subscriptions/subid/resourceGroups/rg/providers/Microsoft.Automation/automationAccounts/myAutomationAccount33/schedules/mySchedule",
  "name": "mySchedule",
  "properties": {
    "description": "my description of schedule goes here",
    "startTime": "2017-03-27T17:28:00+00:00",
    "startTimeOffsetMinutes": 0,
    "expiryTime": "2017-04-01T17:28:00+00:00",
    "expiryTimeOffsetMinutes": 0,
    "isEnabled": true,
    "nextRun": "2017-03-27T17:28:00+00:00",
    "nextRunOffsetMinutes": 0,
    "interval": 1,
    "frequency": "Hour",
    "creationTime": "2017-03-27T16:59:22.697+00:00",
    "lastModifiedTime": "2017-03-27T16:59:22.697+00:00",
    "timeZone": "UTC"
  }
}
{
  "id": "/subscriptions/subid/resourceGroups/rg/providers/Microsoft.Automation/automationAccounts/myAutomationAccount33/schedules/mySchedule",
  "name": "mySchedule",
  "properties": {
    "description": "my description of schedule goes here",
    "startTime": "2017-03-27T17:28:00+00:00",
    "startTimeOffsetMinutes": 0,
    "expiryTime": "2017-04-01T17:28:00+00:00",
    "expiryTimeOffsetMinutes": 0,
    "isEnabled": true,
    "nextRun": "2017-03-27T17:28:00+00:00",
    "nextRunOffsetMinutes": 0,
    "interval": 1,
    "frequency": "Hour",
    "creationTime": "2017-03-27T16:59:22.697+00:00",
    "lastModifiedTime": "2017-03-27T16:59:22.697+00:00",
    "timeZone": "UTC"
  }
}

Definitions

AdvancedSchedule

The properties of the create Advanced Schedule.

AdvancedScheduleMonthlyOccurrence

The properties of the create advanced schedule monthly occurrence.

ErrorResponse

Error response of an operation failure

Schedule

Definition of the schedule.

ScheduleCreateOrUpdateParameters

The parameters supplied to the create or update schedule operation.

ScheduleDay

Day of the occurrence. Must be one of monday, tuesday, wednesday, thursday, friday, saturday, sunday.

ScheduleFrequency

Gets or sets the frequency of the schedule.

AdvancedSchedule

The properties of the create Advanced Schedule.

Name Type Description
monthDays
  • integer[]

Days of the month that the job should execute on. Must be between 1 and 31.

monthlyOccurrences

Occurrences of days within a month.

weekDays
  • string[]

Days of the week that the job should execute on.

AdvancedScheduleMonthlyOccurrence

The properties of the create advanced schedule monthly occurrence.

Name Type Description
day

Day of the occurrence. Must be one of monday, tuesday, wednesday, thursday, friday, saturday, sunday.

occurrence
  • integer

Occurrence of the week within the month. Must be between 1 and 5

ErrorResponse

Error response of an operation failure

Name Type Description
code
  • string

Error code

message
  • string

Error message indicating why the operation failed.

Schedule

Definition of the schedule.

Name Type Description
id
  • string

Fully qualified resource Id for the resource

name
  • string

The name of the resource

properties.advancedSchedule

Gets or sets the advanced schedule.

properties.creationTime
  • string

Gets or sets the creation time.

properties.description
  • string

Gets or sets the description.

properties.expiryTime
  • string

Gets or sets the end time of the schedule.

properties.expiryTimeOffsetMinutes
  • number

Gets or sets the expiry time's offset in minutes.

properties.frequency

Gets or sets the frequency of the schedule.

properties.interval

Gets or sets the interval of the schedule.

properties.isEnabled
  • boolean

Gets or sets a value indicating whether this schedule is enabled.

properties.lastModifiedTime
  • string

Gets or sets the last modified time.

properties.nextRun
  • string

Gets or sets the next run time of the schedule.

properties.nextRunOffsetMinutes
  • number

Gets or sets the next run time's offset in minutes.

properties.startTime
  • string

Gets or sets the start time of the schedule.

properties.startTimeOffsetMinutes
  • number

Gets the start time's offset in minutes.

properties.timeZone
  • string

Gets or sets the time zone of the schedule.

type
  • string

The type of the resource.

ScheduleCreateOrUpdateParameters

The parameters supplied to the create or update schedule operation.

Name Type Description
name
  • string

Gets or sets the name of the Schedule.

properties.advancedSchedule

Gets or sets the AdvancedSchedule.

properties.description
  • string

Gets or sets the description of the schedule.

properties.expiryTime
  • string

Gets or sets the end time of the schedule.

properties.frequency

Gets or sets the frequency of the schedule.

properties.interval

Gets or sets the interval of the schedule.

properties.startTime
  • string

Gets or sets the start time of the schedule.

properties.timeZone
  • string

Gets or sets the time zone of the schedule.

ScheduleDay

Day of the occurrence. Must be one of monday, tuesday, wednesday, thursday, friday, saturday, sunday.

Name Type Description
Friday
  • string
Monday
  • string
Saturday
  • string
Sunday
  • string
Thursday
  • string
Tuesday
  • string
Wednesday
  • string

ScheduleFrequency

Gets or sets the frequency of the schedule.

Name Type Description
Day
  • string
Hour
  • string
Month
  • string
OneTime
  • string
Week
  • string