Skip to content
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

RI from upstream/master into origin/release #75

Merged
merged 54 commits into from
Sep 29, 2015
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
54 commits
Select commit Hold shift + click to select a range
cee2328
FW: Fixing the documentation of the properties in the generated code …
gucalder Apr 8, 2015
83d9cec
FW: [Sdk] Rename skuDefinitions to skus
george-moussa Apr 16, 2015
e73d650
WORK: 3595593: [Sdk] Add Milliseconds unit
george-moussa Apr 20, 2015
af3411d
WORK: 3644439: [Sdk][Sku] Remove antares workarounds
george-moussa Apr 20, 2015
2bea3c9
Revert "WORK: 3644439: [Sdk][Sku] Remove antares workarounds"
george-moussa Apr 21, 2015
0c8adf7
WORK: 3587839 [SDK] Support storage analytic metric schema natively i…
davmc Apr 21, 2015
4c18888
Update SDK version
davmc Apr 21, 2015
2c8e250
Fix exception due to TIMESTAMP field type
davmc Apr 23, 2015
f94730e
WORK: 3644439: [Sdk][Sku] Remove antares workarounds
george-moussa Apr 23, 2015
f0ab40d
Azure SDK changes for the hydra changes
jagadisk Apr 24, 2015
d06a022
Revert "WORK: 3587839 [SDK] Support storage analytic metric schema na…
jagadisk Apr 24, 2015
b892a27
Update the SDK version to 0.8.2
jagadisk Apr 24, 2015
9da58c3
Revert "Revert "WORK: 3587839 [SDK] Support storage analytic metric s…
jagadisk Apr 24, 2015
75a43b8
Reverting the revert of the storage analytics.
jagadisk Apr 24, 2015
5479fab
GetMetrics query instance metrics when they are present and aggregate…
vcanaa May 5, 2015
c962957
Increase Insights version to 0.8.4.0
vcanaa May 6, 2015
bbcff80
1. API to get the event categories
jagadisk May 22, 2015
124f3d0
Including the model classes in the project.
jagadisk May 22, 2015
8a322a6
Update the version to 0.8.5-preview
jagadisk May 22, 2015
8783495
API to get Tenant-level events
davmc Jun 5, 2015
97a96d2
Removing files that are not referenced
vcanaa Jul 20, 2015
a41bf6d
Keeping OnetimeGenerated structure the same as generated
vcanaa Jul 20, 2015
57109e4
WORK: 4057941: [Lastest Sku contract][Sdk] Part1: Update non-breaking…
george-moussa Jul 21, 2015
82ee5a8
Fix timestamp parsing in shoebox metrics
vcanaa Jul 22, 2015
773fa54
[ShoeboxV2] MetricsDefinitionsOperations and MetricsOperations
vcanaa Jul 23, 2015
1ae410b
[ShoeboxV2] Fix null pointer exception when aggregating the data from…
vcanaa Jul 29, 2015
3a32541
Disable encoding for GetMetrics (Generated files)
davmc Jul 31, 2015
3a95b1d
BUG: 4305815 : [SDK][legacy passthrough] move towards using extension…
jagadisk Aug 12, 2015
3dc38c9
WORK: 4057941: [SDK][Generic autoscale] Ensure generic autoscale supp…
george-moussa Aug 18, 2015
bf9fcbe
Merge remote-tracking branch 'origin/dev' into dev
davmc Aug 28, 2015
8a7b436
BUG: 4390874 [SDK] Add missing Id field to UsageMetric
davmc Aug 28, 2015
c66ee16
BUG: 4486642 : [ShoeboxV1] Make sure that the new sdk with extensions…
jagadisk Sep 2, 2015
858e324
Version increment
jagadisk Sep 8, 2015
aafa708
Adding support for webhook actions to the Alert sdk
LeoVannelli Sep 10, 2015
a1a6377
BUG: Call to get the metric definition fails.
jagadisk Sep 11, 2015
77fd924
BUG: Call to get the metric definition fails.
jagadisk Sep 11, 2015
b07d61f
Merge branch 'dev' of https://github.com/AuxMon/azure-sdk-for-net int…
jagadisk Sep 11, 2015
db53eb4
Merge branch 'dev' into shoeboxv2
jagadisk Sep 11, 2015
02be46b
Removing the duplicate entries in the csproj (due to merge conflicts)
jagadisk Sep 11, 2015
dc94348
Update the version
jagadisk Sep 11, 2015
5bbd18c
Update the version
jagadisk Sep 11, 2015
829dca6
Merge branch 'dev'
jagadisk Sep 15, 2015
327f123
Remove the code from the old location
jagadisk Sep 15, 2015
7506cde
Overwriting the Insights folder with the latest from the dev branch
jagadisk Sep 15, 2015
9dc40aa
Fix build break with pragma; Account for types supported by AppInsights
jagadisk Sep 16, 2015
0fa6cda
Removing event tests that are not relavant.
jagadisk Sep 16, 2015
8ff3568
Refreshing the SDK with the latest hydra generated files
jagadisk Sep 21, 2015
82adfdc
Search SDK: Removing dependency on JsonConvert.DefaultSettings
brjohnstmsft Sep 24, 2015
3a880ab
Increment the SDK version
jagadisk Sep 24, 2015
a9d90be
Add ListLocations to subscriptions client
vivsriaus Sep 24, 2015
f849555
Merge pull request #1451 from brjohnstmsft/jsonfix-pr
Sep 25, 2015
21db6e5
Merge pull request #1452 from vivsriaus/master
Sep 25, 2015
7eb1056
Merge pull request #1454 from MabOneSdk/release
ogail Sep 28, 2015
2cc2860
Merge pull request #1456 from AuxMon/master
stankovski Sep 28, 2015
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Add ListLocations to subscriptions client
  • Loading branch information
vivsriaus committed Sep 24, 2015
commit a9d90be98eb364a21dcc1bbc087040a73a413453
Original file line number Diff line number Diff line change
Expand Up @@ -56,5 +56,19 @@ public partial interface ISubscriptionOperations
/// Subscription list operation response.
/// </returns>
Task<SubscriptionListResult> ListAsync(CancellationToken cancellationToken);

/// <summary>
/// Gets a list of the subscription locations.
/// </summary>
/// <param name='subscriptionId'>
/// Id of the subscription
/// </param>
/// <param name='cancellationToken'>
/// Cancellation token.
/// </param>
/// <returns>
/// Location list operation response.
/// </returns>
Task<LocationListResult> ListLocationsAsync(string subscriptionId, CancellationToken cancellationToken);
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,106 @@
//
// 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.Subscriptions.Models
{
/// <summary>
/// Location information.
/// </summary>
public partial class Location
{
private string _displayName;

/// <summary>
/// Optional. Gets or sets the display name of the location
/// </summary>
public string DisplayName
{
get { return this._displayName; }
set { this._displayName = value; }
}

private string _id;

/// <summary>
/// Optional. Gets or sets the ID of the resource
/// (/subscriptions/SubscriptionId).
/// </summary>
public string Id
{
get { return this._id; }
set { this._id = value; }
}

private string _latitude;

/// <summary>
/// Optional. Gets or sets the latitude of the location
/// </summary>
public string Latitude
{
get { return this._latitude; }
set { this._latitude = value; }
}

private string _longitude;

/// <summary>
/// Optional. Gets or sets the longitude of the location
/// </summary>
public string Longitude
{
get { return this._longitude; }
set { this._longitude = value; }
}

private string _name;

/// <summary>
/// Optional. Gets or sets the location name
/// </summary>
public string Name
{
get { return this._name; }
set { this._name = value; }
}

private string _subscriptionId;

/// <summary>
/// Optional. Gets or sets the subscription Id.
/// </summary>
public string SubscriptionId
{
get { return this._subscriptionId; }
set { this._subscriptionId = value; }
}

/// <summary>
/// Initializes a new instance of the Location class.
/// </summary>
public Location()
{
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
//
// 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;
using Microsoft.Azure.Subscriptions.Models;

namespace Microsoft.Azure.Subscriptions.Models
{
/// <summary>
/// Location list operation response.
/// </summary>
public partial class LocationListResult : AzureOperationResponse
{
private IList<Location> _locations;

/// <summary>
/// Optional. Gets the locations.
/// </summary>
public IList<Location> Locations
{
get { return this._locations; }
set { this._locations = value; }
}

/// <summary>
/// Initializes a new instance of the LocationListResult class.
/// </summary>
public LocationListResult()
{
this.Locations = new LazyList<Location>();
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -401,5 +401,199 @@ public async Task<SubscriptionListResult> ListAsync(CancellationToken cancellati
}
}
}

/// <summary>
/// Gets a list of the subscription locations.
/// </summary>
/// <param name='subscriptionId'>
/// Required. Id of the subscription
/// </param>
/// <param name='cancellationToken'>
/// Cancellation token.
/// </param>
/// <returns>
/// Location list operation response.
/// </returns>
public async Task<LocationListResult> ListLocationsAsync(string subscriptionId, CancellationToken cancellationToken)
{
// Validate
if (subscriptionId == null)
{
throw new ArgumentNullException("subscriptionId");
}

// Tracing
bool shouldTrace = TracingAdapter.IsEnabled;
string invocationId = null;
if (shouldTrace)
{
invocationId = TracingAdapter.NextInvocationId.ToString();
Dictionary<string, object> tracingParameters = new Dictionary<string, object>();
tracingParameters.Add("subscriptionId", subscriptionId);
TracingAdapter.Enter(invocationId, this, "ListLocationsAsync", tracingParameters);
}

// Construct URL
string url = "";
url = url + "/subscriptions/";
url = url + Uri.EscapeDataString(subscriptionId);
url = url + "/locations";
List<string> queryParameters = new List<string>();
queryParameters.Add("api-version=2014-04-01-preview");
if (queryParameters.Count > 0)
{
url = url + "?" + string.Join("&", queryParameters);
}
string baseUrl = this.Client.BaseUri.AbsoluteUri;
// Trim '/' character from the end of baseUrl and beginning of url.
if (baseUrl[baseUrl.Length - 1] == '/')
{
baseUrl = baseUrl.Substring(0, baseUrl.Length - 1);
}
if (url[0] == '/')
{
url = url.Substring(1);
}
url = baseUrl + "/" + url;
url = url.Replace(" ", "%20");

// Create HTTP transport objects
HttpRequestMessage httpRequest = null;
try
{
httpRequest = new HttpRequestMessage();
httpRequest.Method = HttpMethod.Get;
httpRequest.RequestUri = new Uri(url);

// Set Headers

// Set Credentials
cancellationToken.ThrowIfCancellationRequested();
await this.Client.Credentials.ProcessHttpRequestAsync(httpRequest, cancellationToken).ConfigureAwait(false);

// Send Request
HttpResponseMessage httpResponse = null;
try
{
if (shouldTrace)
{
TracingAdapter.SendRequest(invocationId, httpRequest);
}
cancellationToken.ThrowIfCancellationRequested();
httpResponse = await this.Client.HttpClient.SendAsync(httpRequest, cancellationToken).ConfigureAwait(false);
if (shouldTrace)
{
TracingAdapter.ReceiveResponse(invocationId, httpResponse);
}
HttpStatusCode statusCode = httpResponse.StatusCode;
if (statusCode != HttpStatusCode.OK)
{
cancellationToken.ThrowIfCancellationRequested();
CloudException ex = CloudException.Create(httpRequest, null, httpResponse, await httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false));
if (shouldTrace)
{
TracingAdapter.Error(invocationId, ex);
}
throw ex;
}

// Create Result
LocationListResult result = null;
// Deserialize Response
if (statusCode == HttpStatusCode.OK)
{
cancellationToken.ThrowIfCancellationRequested();
string responseContent = await httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false);
result = new LocationListResult();
JToken responseDoc = null;
if (string.IsNullOrEmpty(responseContent) == false)
{
responseDoc = JToken.Parse(responseContent);
}

if (responseDoc != null && responseDoc.Type != JTokenType.Null)
{
JToken valueArray = responseDoc["value"];
if (valueArray != null && valueArray.Type != JTokenType.Null)
{
foreach (JToken valueValue in ((JArray)valueArray))
{
Location locationInstance = new Location();
result.Locations.Add(locationInstance);

JToken idValue = valueValue["id"];
if (idValue != null && idValue.Type != JTokenType.Null)
{
string idInstance = ((string)idValue);
locationInstance.Id = idInstance;
}

JToken subscriptionIdValue = valueValue["subscriptionId"];
if (subscriptionIdValue != null && subscriptionIdValue.Type != JTokenType.Null)
{
string subscriptionIdInstance = ((string)subscriptionIdValue);
locationInstance.SubscriptionId = subscriptionIdInstance;
}

JToken nameValue = valueValue["name"];
if (nameValue != null && nameValue.Type != JTokenType.Null)
{
string nameInstance = ((string)nameValue);
locationInstance.Name = nameInstance;
}

JToken displayNameValue = valueValue["displayName"];
if (displayNameValue != null && displayNameValue.Type != JTokenType.Null)
{
string displayNameInstance = ((string)displayNameValue);
locationInstance.DisplayName = displayNameInstance;
}

JToken latitudeValue = valueValue["latitude"];
if (latitudeValue != null && latitudeValue.Type != JTokenType.Null)
{
string latitudeInstance = ((string)latitudeValue);
locationInstance.Latitude = latitudeInstance;
}

JToken longitudeValue = valueValue["longitude"];
if (longitudeValue != null && longitudeValue.Type != JTokenType.Null)
{
string longitudeInstance = ((string)longitudeValue);
locationInstance.Longitude = longitudeInstance;
}
}
}
}

}
result.StatusCode = statusCode;
if (httpResponse.Headers.Contains("x-ms-request-id"))
{
result.RequestId = httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault();
}

if (shouldTrace)
{
TracingAdapter.Exit(invocationId, result);
}
return result;
}
finally
{
if (httpResponse != null)
{
httpResponse.Dispose();
}
}
}
finally
{
if (httpRequest != null)
{
httpRequest.Dispose();
}
}
}
}
}
Loading