Skip to content

Commit

Permalink
Merge pull request #7 from felixcho-msft/master
Browse files Browse the repository at this point in the history
Weekly and Monthly schedule support (on behalf of jemex)
  • Loading branch information
jemex committed Apr 20, 2016
2 parents a417bc2 + 649be3c commit 4e25849
Show file tree
Hide file tree
Showing 8 changed files with 495 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -730,19 +730,19 @@ public async Task<LongRunningOperationResultResponse> GetOperationResultStatusAs
{
result.RequestId = httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault();
}
if (statusCode == HttpStatusCode.BadRequest)
if (statusCode == HttpStatusCode.NotFound)
{
result.Status = OperationStatus.Failed;
}
if (statusCode == HttpStatusCode.NotFound)
if (statusCode == HttpStatusCode.BadRequest)
{
result.Status = OperationStatus.Failed;
}
if (statusCode == HttpStatusCode.Created)
if (statusCode == HttpStatusCode.NoContent)
{
result.Status = OperationStatus.Succeeded;
}
if (statusCode == HttpStatusCode.NoContent)
if (statusCode == HttpStatusCode.Created)
{
result.Status = OperationStatus.Succeeded;
}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
//
// Copyright (c) Microsoft and contributors. All rights reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
//
// See the License for the specific language governing permissions and
// limitations under the License.
//

// Warning: This code was generated by a tool.
//
// Changes to this file may cause incorrect behavior and will be lost if the
// code is regenerated.

using System;
using System.Collections.Generic;
using System.Linq;
using Hyak.Common;
using Microsoft.Azure.Management.Automation.Models;

namespace Microsoft.Azure.Management.Automation.Models
{
/// <summary>
/// The properties of the create Advanced Schedule.
/// </summary>
public partial class AdvancedSchedule
{
private IList<int> _monthDays;

/// <summary>
/// Optional. Days of the month that the job should execute on. Must be
/// between 1 and 31.
/// </summary>
public IList<int> MonthDays
{
get { return this._monthDays; }
set { this._monthDays = value; }
}

private IList<AdvancedScheduleMonthlyOccurrence> _monthlyOccurrences;

/// <summary>
/// Optional. Occurrences of days within a month.
/// </summary>
public IList<AdvancedScheduleMonthlyOccurrence> MonthlyOccurrences
{
get { return this._monthlyOccurrences; }
set { this._monthlyOccurrences = value; }
}

private IList<string> _weekDays;

/// <summary>
/// Optional. Days of the week that the job should execute on.
/// </summary>
public IList<string> WeekDays
{
get { return this._weekDays; }
set { this._weekDays = value; }
}

/// <summary>
/// Initializes a new instance of the AdvancedSchedule class.
/// </summary>
public AdvancedSchedule()
{
this.MonthDays = new LazyList<int>();
this.MonthlyOccurrences = new LazyList<AdvancedScheduleMonthlyOccurrence>();
this.WeekDays = new LazyList<string>();
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
//
// Copyright (c) Microsoft and contributors. All rights reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
//
// See the License for the specific language governing permissions and
// limitations under the License.
//

// Warning: This code was generated by a tool.
//
// Changes to this file may cause incorrect behavior and will be lost if the
// code is regenerated.

using System;
using System.Linq;

namespace Microsoft.Azure.Management.Automation.Models
{
/// <summary>
/// The properties of the create advanced schedule monthly occurrence.
/// </summary>
public partial class AdvancedScheduleMonthlyOccurrence
{
private string _day;

/// <summary>
/// Optional. Day of the occurrence. Must be one of monday, tuesday,
/// wednesday,thursday, friday, saturday, sunday.
/// </summary>
public string Day
{
get { return this._day; }
set { this._day = value; }
}

private int? _occurrence;

/// <summary>
/// Optional. Occurrence of the week within the month. Must be between
/// 1 and 5
/// </summary>
public int? Occurrence
{
get { return this._occurrence; }
set { this._occurrence = value; }
}

/// <summary>
/// Initializes a new instance of the AdvancedScheduleMonthlyOccurrence
/// class.
/// </summary>
public AdvancedScheduleMonthlyOccurrence()
{
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@

using System;
using System.Linq;
using Microsoft.Azure.Management.Automation.Models;

namespace Microsoft.Azure.Management.Automation.Models
{
Expand All @@ -29,6 +30,17 @@ namespace Microsoft.Azure.Management.Automation.Models
/// </summary>
public partial class ScheduleCreateOrUpdateProperties
{
private AdvancedSchedule _advancedSchedule;

/// <summary>
/// Optional. Gets or sets the AdvancedSchedule.
/// </summary>
public AdvancedSchedule AdvancedSchedule
{
get { return this._advancedSchedule; }
set { this._advancedSchedule = value; }
}

private string _description;

/// <summary>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
//
// Copyright (c) Microsoft and contributors. All rights reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
//
// See the License for the specific language governing permissions and
// limitations under the License.
//

// Warning: This code was generated by a tool.
//
// Changes to this file may cause incorrect behavior and will be lost if the
// code is regenerated.

using System;
using System.Linq;

namespace Microsoft.Azure.Management.Automation.Models
{
/// <summary>
/// Must be one of monday, tuesday, wednesday, thursday, friday, saturday,
/// sunday.
/// </summary>
public static partial class ScheduleDay
{
/// <summary>
/// Monday.
/// </summary>
public const string Monday = "Monday";

/// <summary>
/// Tuesday.
/// </summary>
public const string Tuesday = "Tuesday";

/// <summary>
/// Wednsday.
/// </summary>
public const string Wednesday = "Wednesday";

/// <summary>
/// Thursday.
/// </summary>
public const string Thursday = "Thursday";

/// <summary>
/// Friday.
/// </summary>
public const string Friday = "Friday";

/// <summary>
/// Saturday.
/// </summary>
public const string Saturday = "Saturday";

/// <summary>
/// Sunday.
/// </summary>
public const string Sunday = "Sunday";
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -34,5 +34,9 @@ public static partial class ScheduleFrequency
public const string Day = "Day";

public const string Hour = "Hour";

public const string Week = "Week";

public const string Month = "Month";
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,17 @@ namespace Microsoft.Azure.Management.Automation.Models
/// </summary>
public partial class ScheduleProperties : ResourceCommonPropertiesBase
{
private AdvancedSchedule _advancedSchedule;

/// <summary>
/// Optional. Gets or sets the advanced schedule.
/// </summary>
public AdvancedSchedule AdvancedSchedule
{
get { return this._advancedSchedule; }
set { this._advancedSchedule = value; }
}

private DateTimeOffset _expiryTime;

/// <summary>
Expand Down

0 comments on commit 4e25849

Please sign in to comment.