From 3511f1fcbb89cd01777046852ba4b9f71e097160 Mon Sep 17 00:00:00 2001 From: Harvey Chen <30464227+HarveyLink@users.noreply.github.com> Date: Wed, 28 Apr 2021 14:58:55 +0800 Subject: [PATCH 01/16] Initial --- .../src/Generated/ChangeTrackingList.cs | 194 ++++++++++++ .../LocationListResult.Serialization.cs | 38 +++ .../src/Generated/LocationListResult.cs | 29 ++ .../ManagedByTenant.Serialization.cs | 25 ++ .../src/Generated/ManagedByTenant.cs | 24 ++ .../Generated/SpendingLimit.Serialization.cs | 29 ++ .../src/Generated/SpendingLimit.cs | 16 + .../SubscriptionData.Serialization.cs | 106 +++++++ .../src/Generated/SubscriptionData.cs | 88 ++++++ .../SubscriptionListResult.Serialization.cs | 44 +++ .../src/Generated/SubscriptionListResult.cs | 41 +++ .../SubscriptionPolicies.Serialization.cs | 42 +++ .../src/Generated/SubscriptionPolicies.cs | 32 ++ .../SubscriptionState.Serialization.cs | 37 +++ .../src/Generated/SubscriptionState.cs | 22 ++ .../src/Generated/SubscriptionsOperations.cs | 205 ++++++++++++ .../Generated/SubscriptionsRestOperations.cs | 292 ++++++++++++++++++ .../src/Placeholder/SubscriptionData.cs | 71 ----- .../src/Resources/LocationContainer.cs | 12 +- .../src/SubscriptionContainer.cs | 19 +- .../src/SubscriptionOperations.cs | 24 +- 21 files changed, 1297 insertions(+), 93 deletions(-) create mode 100644 sdk/resourcemanager/Azure.ResourceManager.Core/src/Generated/ChangeTrackingList.cs create mode 100644 sdk/resourcemanager/Azure.ResourceManager.Core/src/Generated/LocationListResult.Serialization.cs create mode 100644 sdk/resourcemanager/Azure.ResourceManager.Core/src/Generated/LocationListResult.cs create mode 100644 sdk/resourcemanager/Azure.ResourceManager.Core/src/Generated/ManagedByTenant.Serialization.cs create mode 100644 sdk/resourcemanager/Azure.ResourceManager.Core/src/Generated/ManagedByTenant.cs create mode 100644 sdk/resourcemanager/Azure.ResourceManager.Core/src/Generated/SpendingLimit.Serialization.cs create mode 100644 sdk/resourcemanager/Azure.ResourceManager.Core/src/Generated/SpendingLimit.cs create mode 100644 sdk/resourcemanager/Azure.ResourceManager.Core/src/Generated/SubscriptionData.Serialization.cs create mode 100644 sdk/resourcemanager/Azure.ResourceManager.Core/src/Generated/SubscriptionData.cs create mode 100644 sdk/resourcemanager/Azure.ResourceManager.Core/src/Generated/SubscriptionListResult.Serialization.cs create mode 100644 sdk/resourcemanager/Azure.ResourceManager.Core/src/Generated/SubscriptionListResult.cs create mode 100644 sdk/resourcemanager/Azure.ResourceManager.Core/src/Generated/SubscriptionPolicies.Serialization.cs create mode 100644 sdk/resourcemanager/Azure.ResourceManager.Core/src/Generated/SubscriptionPolicies.cs create mode 100644 sdk/resourcemanager/Azure.ResourceManager.Core/src/Generated/SubscriptionState.Serialization.cs create mode 100644 sdk/resourcemanager/Azure.ResourceManager.Core/src/Generated/SubscriptionState.cs create mode 100644 sdk/resourcemanager/Azure.ResourceManager.Core/src/Generated/SubscriptionsOperations.cs create mode 100644 sdk/resourcemanager/Azure.ResourceManager.Core/src/Generated/SubscriptionsRestOperations.cs delete mode 100644 sdk/resourcemanager/Azure.ResourceManager.Core/src/Placeholder/SubscriptionData.cs diff --git a/sdk/resourcemanager/Azure.ResourceManager.Core/src/Generated/ChangeTrackingList.cs b/sdk/resourcemanager/Azure.ResourceManager.Core/src/Generated/ChangeTrackingList.cs new file mode 100644 index 000000000000..13ff40b55a48 --- /dev/null +++ b/sdk/resourcemanager/Azure.ResourceManager.Core/src/Generated/ChangeTrackingList.cs @@ -0,0 +1,194 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using Azure.Core; + +#nullable enable + +namespace Azure.ResourceManager.Core +{ + internal class ChangeTrackingList : IList, IReadOnlyList + { + private IList? _innerList; + + public ChangeTrackingList() + { + } + + public ChangeTrackingList(Optional> optionalList) : this(optionalList.Value) + { + } + + public ChangeTrackingList(Optional> optionalList) : this(optionalList.Value) + { + } + + private ChangeTrackingList(IEnumerable innerList) + { + if (innerList == null) + { + return; + } + + _innerList = innerList.ToList(); + } + + private ChangeTrackingList(IList innerList) + { + if (innerList == null) + { + return; + } + + _innerList = innerList; + } + + public bool IsUndefined => _innerList == null; + + public void Reset() + { + _innerList = null; + } + + public IEnumerator GetEnumerator() + { + if (IsUndefined) + { + IEnumerator EnumerateEmpty() + { + yield break; + } + + return EnumerateEmpty(); + } + return EnsureList().GetEnumerator(); + } + + IEnumerator IEnumerable.GetEnumerator() + { + return GetEnumerator(); + } + + public void Add(T item) + { + EnsureList().Add(item); + } + + public void Clear() + { + EnsureList().Clear(); + } + + public bool Contains(T item) + { + if (IsUndefined) + { + return false; + } + + return EnsureList().Contains(item); + } + + public void CopyTo(T[] array, int arrayIndex) + { + if (IsUndefined) + { + return; + } + + EnsureList().CopyTo(array, arrayIndex); + } + + public bool Remove(T item) + { + if (IsUndefined) + { + return false; + } + + return EnsureList().Remove(item); + } + + public int Count + { + get + { + if (IsUndefined) + { + return 0; + } + return EnsureList().Count; + } + } + + public bool IsReadOnly + { + get + { + if (IsUndefined) + { + return false; + } + + return EnsureList().IsReadOnly; + } + } + + public int IndexOf(T item) + { + if (IsUndefined) + { + return -1; + } + + return EnsureList().IndexOf(item); + } + + public void Insert(int index, T item) + { + EnsureList().Insert(index, item); + } + + public void RemoveAt(int index) + { + if (IsUndefined) + { + throw new ArgumentOutOfRangeException(nameof(index)); + } + + EnsureList().RemoveAt(index); + } + + public T this[int index] + { + get + { + if (IsUndefined) + { + throw new ArgumentOutOfRangeException(nameof(index)); + } + + return EnsureList()[index]; + } + set + { + if (IsUndefined) + { + throw new ArgumentOutOfRangeException(nameof(index)); + } + + EnsureList()[index] = value; + } + } + + private IList EnsureList() + { + return _innerList ??= new List(); + } + } +} diff --git a/sdk/resourcemanager/Azure.ResourceManager.Core/src/Generated/LocationListResult.Serialization.cs b/sdk/resourcemanager/Azure.ResourceManager.Core/src/Generated/LocationListResult.Serialization.cs new file mode 100644 index 000000000000..8bd803c25991 --- /dev/null +++ b/sdk/resourcemanager/Azure.ResourceManager.Core/src/Generated/LocationListResult.Serialization.cs @@ -0,0 +1,38 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System; +using System.Collections.Generic; +using System.Text; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.Core +{ + internal partial class LocationListResult + { + internal static LocationListResult DeserializeLocationListResult(JsonElement element) + { + Optional> value = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("value")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(item.GetProperty("displayName").GetString()); + } + value = array; + continue; + } + } + return new LocationListResult(Optional.ToList(value)); + } + } +} diff --git a/sdk/resourcemanager/Azure.ResourceManager.Core/src/Generated/LocationListResult.cs b/sdk/resourcemanager/Azure.ResourceManager.Core/src/Generated/LocationListResult.cs new file mode 100644 index 000000000000..1c6889f64070 --- /dev/null +++ b/sdk/resourcemanager/Azure.ResourceManager.Core/src/Generated/LocationListResult.cs @@ -0,0 +1,29 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System; +using System.Collections.Generic; +using System.Text; + +namespace Azure.ResourceManager.Core +{ + /// Location list operation response. + internal partial class LocationListResult + { + /// Initializes a new instance of LocationListResult. + internal LocationListResult() + { + Value = new ChangeTrackingList(); + } + + /// Initializes a new instance of LocationListResult. + /// An array of locations. + internal LocationListResult(IReadOnlyList value) + { + Value = value; + } + + /// An array of locations. + public IReadOnlyList Value { get; } + } +} diff --git a/sdk/resourcemanager/Azure.ResourceManager.Core/src/Generated/ManagedByTenant.Serialization.cs b/sdk/resourcemanager/Azure.ResourceManager.Core/src/Generated/ManagedByTenant.Serialization.cs new file mode 100644 index 000000000000..da1128a24691 --- /dev/null +++ b/sdk/resourcemanager/Azure.ResourceManager.Core/src/Generated/ManagedByTenant.Serialization.cs @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.Core +{ + public partial class ManagedByTenant + { + internal static ManagedByTenant DeserializeManagedByTenant(JsonElement element) + { + Optional tenantId = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("tenantId")) + { + tenantId = property.Value.GetString(); + continue; + } + } + return new ManagedByTenant(tenantId.Value); + } + } +} diff --git a/sdk/resourcemanager/Azure.ResourceManager.Core/src/Generated/ManagedByTenant.cs b/sdk/resourcemanager/Azure.ResourceManager.Core/src/Generated/ManagedByTenant.cs new file mode 100644 index 000000000000..d6531be0de35 --- /dev/null +++ b/sdk/resourcemanager/Azure.ResourceManager.Core/src/Generated/ManagedByTenant.cs @@ -0,0 +1,24 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +namespace Azure.ResourceManager.Core +{ + /// Information about a tenant managing the subscription. + public partial class ManagedByTenant + { + /// Initializes a new instance of ManagedByTenant. + internal ManagedByTenant() + { + } + + /// Initializes a new instance of ManagedByTenant. + /// The tenant ID of the managing tenant. This is a GUID. + internal ManagedByTenant(string tenantId) + { + TenantId = tenantId; + } + + /// The tenant ID of the managing tenant. This is a GUID. + public string TenantId { get; } + } +} diff --git a/sdk/resourcemanager/Azure.ResourceManager.Core/src/Generated/SpendingLimit.Serialization.cs b/sdk/resourcemanager/Azure.ResourceManager.Core/src/Generated/SpendingLimit.Serialization.cs new file mode 100644 index 000000000000..ceb5c3ee0bc7 --- /dev/null +++ b/sdk/resourcemanager/Azure.ResourceManager.Core/src/Generated/SpendingLimit.Serialization.cs @@ -0,0 +1,29 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System; + +namespace Azure.ResourceManager.Core +{ + internal static partial class SpendingLimitExtensions + { + public static string ToSerialString(this SpendingLimit value) => value switch + { + SpendingLimit.On => "On", + SpendingLimit.Off => "Off", + SpendingLimit.CurrentPeriodOff => "CurrentPeriodOff", + _ => throw new ArgumentOutOfRangeException(nameof(value), value, "Unknown SpendingLimit value.") + }; + + public static SpendingLimit ToSpendingLimit(this string value) + { + if (string.Equals(value, "On", StringComparison.InvariantCultureIgnoreCase)) + return SpendingLimit.On; + if (string.Equals(value, "Off", StringComparison.InvariantCultureIgnoreCase)) + return SpendingLimit.Off; + if (string.Equals(value, "CurrentPeriodOff", StringComparison.InvariantCultureIgnoreCase)) + return SpendingLimit.CurrentPeriodOff; + throw new ArgumentOutOfRangeException(nameof(value), value, "Unknown SpendingLimit value."); + } + } +} diff --git a/sdk/resourcemanager/Azure.ResourceManager.Core/src/Generated/SpendingLimit.cs b/sdk/resourcemanager/Azure.ResourceManager.Core/src/Generated/SpendingLimit.cs new file mode 100644 index 000000000000..6298419076e1 --- /dev/null +++ b/sdk/resourcemanager/Azure.ResourceManager.Core/src/Generated/SpendingLimit.cs @@ -0,0 +1,16 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +namespace Azure.ResourceManager.Core +{ + /// The subscription spending limit. + public enum SpendingLimit + { + /// On. + On, + /// Off. + Off, + /// CurrentPeriodOff. + CurrentPeriodOff + } +} diff --git a/sdk/resourcemanager/Azure.ResourceManager.Core/src/Generated/SubscriptionData.Serialization.cs b/sdk/resourcemanager/Azure.ResourceManager.Core/src/Generated/SubscriptionData.Serialization.cs new file mode 100644 index 000000000000..3a6e1c4f0698 --- /dev/null +++ b/sdk/resourcemanager/Azure.ResourceManager.Core/src/Generated/SubscriptionData.Serialization.cs @@ -0,0 +1,106 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System; +using System.Collections.Generic; +using System.Text; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.Core +{ + public partial class SubscriptionData + { + internal static SubscriptionData DeserializeSubscriptionData(JsonElement element) + { + Optional id = default; + Optional subscriptionId = default; + Optional displayName = default; + Optional tenantId = default; + Optional state = default; + Optional subscriptionPolicies = default; + Optional authorizationSource = default; + Optional> managedByTenants = default; + Optional> tags = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("id")) + { + id = property.Value.GetString(); + continue; + } + if (property.NameEquals("subscriptionId")) + { + subscriptionId = property.Value.GetString(); + continue; + } + if (property.NameEquals("displayName")) + { + displayName = property.Value.GetString(); + continue; + } + if (property.NameEquals("tenantId")) + { + tenantId = property.Value.GetString(); + continue; + } + if (property.NameEquals("state")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + state = property.Value.GetString().ToSubscriptionState(); + continue; + } + if (property.NameEquals("subscriptionPolicies")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + subscriptionPolicies = SubscriptionPolicies.DeserializeSubscriptionPolicies(property.Value); + continue; + } + if (property.NameEquals("authorizationSource")) + { + authorizationSource = property.Value.GetString(); + continue; + } + if (property.NameEquals("managedByTenants")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(ManagedByTenant.DeserializeManagedByTenant(item)); + } + managedByTenants = array; + continue; + } + if (property.NameEquals("tags")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + Dictionary dictionary = new Dictionary(); + foreach (var property0 in property.Value.EnumerateObject()) + { + dictionary.Add(property0.Name, property0.Value.GetString()); + } + tags = dictionary; + continue; + } + } + return new SubscriptionData(id.Value, subscriptionId.Value, displayName.Value, tenantId.Value, Optional.ToNullable(state), subscriptionPolicies.Value, authorizationSource.Value, Optional.ToList(managedByTenants), Optional.ToDictionary(tags)); + } + } +} diff --git a/sdk/resourcemanager/Azure.ResourceManager.Core/src/Generated/SubscriptionData.cs b/sdk/resourcemanager/Azure.ResourceManager.Core/src/Generated/SubscriptionData.cs new file mode 100644 index 000000000000..db74ce64de17 --- /dev/null +++ b/sdk/resourcemanager/Azure.ResourceManager.Core/src/Generated/SubscriptionData.cs @@ -0,0 +1,88 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System.Collections.Generic; + +namespace Azure.ResourceManager.Core +{ + /// + /// A class representing the subscription data model. + /// + public partial class SubscriptionData : TrackedResource + { + /// + /// Initializes a new instance of the class. + /// + /// The subscription id. + /// The subscription ID. + /// The subscription name. + /// The subscription resource type. + /// The subscription tenant ID. + /// The subscription state. Possible values are Enabled, Warned, PastDue, Disabled, and Deleted. + /// The subscription policies. + /// The authorization source of the request. Valid values are one or more combinations of Legacy, RoleBased, Bypassed, Direct and Management. For example, 'Legacy, RoleBased'. + /// An array containing the tenants managing the subscription. + /// The tags attached to the subscription. + public SubscriptionData(string id, + string displayName, + string subscriptionId, + string tenantId, + SubscriptionState? state, + SubscriptionPolicies subscriptionPolicies, + string authorizationSource, + IReadOnlyList managedByTenants, + IDictionary tags, + string resourceType = "Microsoft.Resources/subscriptions") + : base(id, displayName, resourceType, tags, null) + { + Name = displayName; + SubscriptionGuid = subscriptionId; + DisplayName = displayName; + State = state; + TenantId = tenantId; + SubscriptionPolicies = subscriptionPolicies; + AuthorizationSource = authorizationSource; + ManagedByTenants = managedByTenants; + } + + /// + /// Gets the subscription id. + /// + public override string Name { get; } + + /// + /// Gets the Id of the Subscription. + /// + public string SubscriptionGuid { get; } + + /// + /// Gets the display name of the subscription. + /// + public string DisplayName { get; } + + /// + /// The subscription tenant ID. + /// + public string TenantId { get; } + + /// + /// Gets the state of the subscription. + /// + public SubscriptionState? State { get; } + + /// + /// Gets the policies of the subscription. + /// + public SubscriptionPolicies SubscriptionPolicies { get; } + + /// + /// Gets the authorization source of the subscription. + /// + public string AuthorizationSource { get; } + + /// + /// Gets an array containing the tenants managing the subscription. + /// + public IReadOnlyList ManagedByTenants { get; } + } +} diff --git a/sdk/resourcemanager/Azure.ResourceManager.Core/src/Generated/SubscriptionListResult.Serialization.cs b/sdk/resourcemanager/Azure.ResourceManager.Core/src/Generated/SubscriptionListResult.Serialization.cs new file mode 100644 index 000000000000..e0f94b280c3c --- /dev/null +++ b/sdk/resourcemanager/Azure.ResourceManager.Core/src/Generated/SubscriptionListResult.Serialization.cs @@ -0,0 +1,44 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System; +using System.Collections.Generic; +using System.Text; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.Core +{ + internal partial class SubscriptionListResult + { + internal static SubscriptionListResult DeserializeSubscriptionListResult(JsonElement element) + { + Optional> value = default; + string nextLink = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("value")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(SubscriptionData.DeserializeSubscriptionData(item)); + } + value = array; + continue; + } + if (property.NameEquals("nextLink")) + { + nextLink = property.Value.GetString(); + continue; + } + } + return new SubscriptionListResult(Optional.ToList(value), nextLink); + } + } +} diff --git a/sdk/resourcemanager/Azure.ResourceManager.Core/src/Generated/SubscriptionListResult.cs b/sdk/resourcemanager/Azure.ResourceManager.Core/src/Generated/SubscriptionListResult.cs new file mode 100644 index 000000000000..2a15f7a43d67 --- /dev/null +++ b/sdk/resourcemanager/Azure.ResourceManager.Core/src/Generated/SubscriptionListResult.cs @@ -0,0 +1,41 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System; +using System.Collections.Generic; +using System.Text; + +namespace Azure.ResourceManager.Core +{ + /// Subscription list operation response. + internal partial class SubscriptionListResult + { + /// Initializes a new instance of SubscriptionListResult. + /// The URL to get the next set of results. + /// is null. + internal SubscriptionListResult(string nextLink) + { + if (nextLink == null) + { + throw new ArgumentNullException(nameof(nextLink)); + } + + Value = new ChangeTrackingList(); + NextLink = nextLink; + } + + /// Initializes a new instance of SubscriptionListResult. + /// An array of subscriptions. + /// The URL to get the next set of results. + internal SubscriptionListResult(IReadOnlyList value, string nextLink) + { + Value = value; + NextLink = nextLink; + } + + /// An array of subscriptions. + public IReadOnlyList Value { get; } + /// The URL to get the next set of results. + public string NextLink { get; } + } +} diff --git a/sdk/resourcemanager/Azure.ResourceManager.Core/src/Generated/SubscriptionPolicies.Serialization.cs b/sdk/resourcemanager/Azure.ResourceManager.Core/src/Generated/SubscriptionPolicies.Serialization.cs new file mode 100644 index 000000000000..53bb70a33cb1 --- /dev/null +++ b/sdk/resourcemanager/Azure.ResourceManager.Core/src/Generated/SubscriptionPolicies.Serialization.cs @@ -0,0 +1,42 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.Core +{ + public partial class SubscriptionPolicies + { + internal static SubscriptionPolicies DeserializeSubscriptionPolicies(JsonElement element) + { + Optional locationPlacementId = default; + Optional quotaId = default; + Optional spendingLimit = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("locationPlacementId")) + { + locationPlacementId = property.Value.GetString(); + continue; + } + if (property.NameEquals("quotaId")) + { + quotaId = property.Value.GetString(); + continue; + } + if (property.NameEquals("spendingLimit")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + spendingLimit = property.Value.GetString().ToSpendingLimit(); + continue; + } + } + return new SubscriptionPolicies(locationPlacementId.Value, quotaId.Value, Optional.ToNullable(spendingLimit)); + } + } +} diff --git a/sdk/resourcemanager/Azure.ResourceManager.Core/src/Generated/SubscriptionPolicies.cs b/sdk/resourcemanager/Azure.ResourceManager.Core/src/Generated/SubscriptionPolicies.cs new file mode 100644 index 000000000000..f2fde1e24c30 --- /dev/null +++ b/sdk/resourcemanager/Azure.ResourceManager.Core/src/Generated/SubscriptionPolicies.cs @@ -0,0 +1,32 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +namespace Azure.ResourceManager.Core +{ + /// Subscription policies. + public partial class SubscriptionPolicies + { + /// Initializes a new instance of SubscriptionPolicies. + internal SubscriptionPolicies() + { + } + + /// Initializes a new instance of SubscriptionPolicies. + /// The subscription location placement ID. The ID indicates which regions are visible for a subscription. For example, a subscription with a location placement Id of Public_2014-09-01 has access to Azure public regions. + /// The subscription quota ID. + /// The subscription spending limit. + internal SubscriptionPolicies(string locationPlacementId, string quotaId, SpendingLimit? spendingLimit) + { + LocationPlacementId = locationPlacementId; + QuotaId = quotaId; + SpendingLimit = spendingLimit; + } + + /// The subscription location placement ID. The ID indicates which regions are visible for a subscription. For example, a subscription with a location placement Id of Public_2014-09-01 has access to Azure public regions. + public string LocationPlacementId { get; } + /// The subscription quota ID. + public string QuotaId { get; } + /// The subscription spending limit. + public SpendingLimit? SpendingLimit { get; } + } +} diff --git a/sdk/resourcemanager/Azure.ResourceManager.Core/src/Generated/SubscriptionState.Serialization.cs b/sdk/resourcemanager/Azure.ResourceManager.Core/src/Generated/SubscriptionState.Serialization.cs new file mode 100644 index 000000000000..bd584e0c9875 --- /dev/null +++ b/sdk/resourcemanager/Azure.ResourceManager.Core/src/Generated/SubscriptionState.Serialization.cs @@ -0,0 +1,37 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System; +using System.Collections.Generic; +using System.Text; + +namespace Azure.ResourceManager.Core +{ + internal static partial class SubscriptionStateExtensions + { + public static string ToSerialString(this SubscriptionState value) => value switch + { + SubscriptionState.Enabled => "Enabled", + SubscriptionState.Warned => "Warned", + SubscriptionState.PastDue => "PastDue", + SubscriptionState.Disabled => "Disabled", + SubscriptionState.Deleted => "Deleted", + _ => throw new ArgumentOutOfRangeException(nameof(value), value, "Unknown SubscriptionState value.") + }; + + public static SubscriptionState ToSubscriptionState(this string value) + { + if (string.Equals(value, "Enabled", StringComparison.InvariantCultureIgnoreCase)) + return SubscriptionState.Enabled; + if (string.Equals(value, "Warned", StringComparison.InvariantCultureIgnoreCase)) + return SubscriptionState.Warned; + if (string.Equals(value, "PastDue", StringComparison.InvariantCultureIgnoreCase)) + return SubscriptionState.PastDue; + if (string.Equals(value, "Disabled", StringComparison.InvariantCultureIgnoreCase)) + return SubscriptionState.Disabled; + if (string.Equals(value, "Deleted", StringComparison.InvariantCultureIgnoreCase)) + return SubscriptionState.Deleted; + throw new ArgumentOutOfRangeException(nameof(value), value, "Unknown SubscriptionState value."); + } + } +} diff --git a/sdk/resourcemanager/Azure.ResourceManager.Core/src/Generated/SubscriptionState.cs b/sdk/resourcemanager/Azure.ResourceManager.Core/src/Generated/SubscriptionState.cs new file mode 100644 index 000000000000..2590f4eac174 --- /dev/null +++ b/sdk/resourcemanager/Azure.ResourceManager.Core/src/Generated/SubscriptionState.cs @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +namespace Azure.ResourceManager.Core +{ + /// + /// The subscription state. Possible values are Enabled, Warned, PastDue, Disabled, and Deleted. + /// + public enum SubscriptionState + { + /// Enabled. + Enabled, + /// Warned. + Warned, + /// PastDue. + PastDue, + /// Disabled. + Disabled, + /// Deleted. + Deleted + } +} diff --git a/sdk/resourcemanager/Azure.ResourceManager.Core/src/Generated/SubscriptionsOperations.cs b/sdk/resourcemanager/Azure.ResourceManager.Core/src/Generated/SubscriptionsOperations.cs new file mode 100644 index 000000000000..883736453f8d --- /dev/null +++ b/sdk/resourcemanager/Azure.ResourceManager.Core/src/Generated/SubscriptionsOperations.cs @@ -0,0 +1,205 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System; +using System.Collections.Generic; +using System.Text; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Core.Pipeline; + +namespace Azure.ResourceManager.Core +{ + /// The Subscriptions service client. + public partial class SubscriptionsOperations + { + private readonly ClientDiagnostics _clientDiagnostics; + private readonly HttpPipeline _pipeline; + internal SubscriptionsRestOperations RestClient { get; } + + /// Initializes a new instance of SubscriptionsOperations for mocking. + protected SubscriptionsOperations() + { + } + + /// Initializes a new instance of SubscriptionsOperations. + /// The handler for diagnostic messaging in the client. + /// The HTTP pipeline for sending and receiving REST requests and responses. + /// server parameter. + internal SubscriptionsOperations(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, Uri endpoint = null) + { + RestClient = new SubscriptionsRestOperations(clientDiagnostics, pipeline, endpoint); + _clientDiagnostics = clientDiagnostics; + _pipeline = pipeline; + } + + /// Gets details about a specified subscription. + /// The ID of the target subscription. + /// The cancellation token to use. + public virtual async Task> GetAsync(string subscriptionId, CancellationToken cancellationToken = default) + { + using var scope = _clientDiagnostics.CreateScope("SubscriptionsOperations.Get"); + scope.Start(); + try + { + return await RestClient.GetAsync(subscriptionId, cancellationToken).ConfigureAwait(false); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// Gets details about a specified subscription. + /// The ID of the target subscription. + /// The cancellation token to use. + public virtual Response Get(string subscriptionId, CancellationToken cancellationToken = default) + { + using var scope = _clientDiagnostics.CreateScope("SubscriptionsOperations.Get"); + scope.Start(); + try + { + return RestClient.Get(subscriptionId, cancellationToken); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// This operation provides all the locations that are available for resource providers; however, each resource provider may support a subset of this list. + /// The ID of the target subscription. + /// The cancellation token to use. + /// is null. + public virtual AsyncPageable ListLocationsAsync(string subscriptionId, CancellationToken cancellationToken = default) + { + if (subscriptionId == null) + { + throw new ArgumentNullException(nameof(subscriptionId)); + } + + async Task> FirstPageFunc(int? pageSizeHint) + { + using var scope = _clientDiagnostics.CreateScope("SubscriptionsOperations.ListLocations"); + scope.Start(); + try + { + var response = await RestClient.ListLocationsAsync(subscriptionId, cancellationToken).ConfigureAwait(false); + return Page.FromValues(response.Value.Value, null, response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + return PageableHelpers.CreateAsyncEnumerable(FirstPageFunc, null); + } + + /// This operation provides all the locations that are available for resource providers; however, each resource provider may support a subset of this list. + /// The ID of the target subscription. + /// The cancellation token to use. + /// is null. + public virtual Pageable ListLocations(string subscriptionId, CancellationToken cancellationToken = default) + { + if (subscriptionId == null) + { + throw new ArgumentNullException(nameof(subscriptionId)); + } + + Page FirstPageFunc(int? pageSizeHint) + { + using var scope = _clientDiagnostics.CreateScope("SubscriptionsOperations.ListLocations"); + scope.Start(); + try + { + var response = RestClient.ListLocations(subscriptionId, cancellationToken); + return Page.FromValues(response.Value.Value, null, response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + return PageableHelpers.CreateEnumerable(FirstPageFunc, null); + } + + /// Gets all subscriptions for a tenant. + /// The cancellation token to use. + public virtual AsyncPageable ListAsync(CancellationToken cancellationToken = default) + { + async Task> FirstPageFunc(int? pageSizeHint) + { + using var scope = _clientDiagnostics.CreateScope("SubscriptionsOperations.List"); + scope.Start(); + try + { + var response = await RestClient.ListAsync(cancellationToken).ConfigureAwait(false); + return Page.FromValues(response.Value.Value, response.Value.NextLink, response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + async Task> NextPageFunc(string nextLink, int? pageSizeHint) + { + using var scope = _clientDiagnostics.CreateScope("SubscriptionsOperations.List"); + scope.Start(); + try + { + var response = await RestClient.ListNextPageAsync(nextLink, cancellationToken).ConfigureAwait(false); + return Page.FromValues(response.Value.Value, response.Value.NextLink, response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + return PageableHelpers.CreateAsyncEnumerable(FirstPageFunc, NextPageFunc); + } + + /// Gets all subscriptions for a tenant. + /// The cancellation token to use. + public virtual Pageable List(CancellationToken cancellationToken = default) + { + Page FirstPageFunc(int? pageSizeHint) + { + using var scope = _clientDiagnostics.CreateScope("SubscriptionsOperations.List"); + scope.Start(); + try + { + var response = RestClient.List(cancellationToken); + return Page.FromValues(response.Value.Value, response.Value.NextLink, response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + Page NextPageFunc(string nextLink, int? pageSizeHint) + { + using var scope = _clientDiagnostics.CreateScope("SubscriptionsOperations.List"); + scope.Start(); + try + { + var response = RestClient.ListNextPage(nextLink, cancellationToken); + return Page.FromValues(response.Value.Value, response.Value.NextLink, response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + return PageableHelpers.CreateEnumerable(FirstPageFunc, NextPageFunc); + } + } +} diff --git a/sdk/resourcemanager/Azure.ResourceManager.Core/src/Generated/SubscriptionsRestOperations.cs b/sdk/resourcemanager/Azure.ResourceManager.Core/src/Generated/SubscriptionsRestOperations.cs new file mode 100644 index 000000000000..208de345af7f --- /dev/null +++ b/sdk/resourcemanager/Azure.ResourceManager.Core/src/Generated/SubscriptionsRestOperations.cs @@ -0,0 +1,292 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System; +using System.Text.Json; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Core.Pipeline; + +namespace Azure.ResourceManager.Core +{ + internal partial class SubscriptionsRestOperations : SubscriptionOperations + { + private Uri endpoint; + private ClientDiagnostics _clientDiagnostics; + private HttpPipeline _pipeline; + + /// Initializes a new instance of SubscriptionsRestOperations. + /// The handler for diagnostic messaging in the client. + /// The HTTP pipeline for sending and receiving REST requests and responses. + /// server parameter. + public SubscriptionsRestOperations(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, Uri endpoint = null) + { + endpoint ??= new Uri("https://management.azure.com"); + + this.endpoint = endpoint; + _clientDiagnostics = clientDiagnostics; + _pipeline = pipeline; + } + + internal Azure.Core.HttpMessage CreateListLocationsRequest(string subscriptionId) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/locations", false); + uri.AppendQuery("api-version", "2019-11-01", true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + /// This operation provides all the locations that are available for resource providers; however, each resource provider may support a subset of this list. + /// The ID of the target subscription. + /// The cancellation token to use. + /// is null. + public async Task> ListLocationsAsync(string subscriptionId, CancellationToken cancellationToken = default) + { + if (subscriptionId == null) + { + throw new ArgumentNullException(nameof(subscriptionId)); + } + + using var message = CreateListLocationsRequest(subscriptionId); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + LocationListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = LocationListResult.DeserializeLocationListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// This operation provides all the locations that are available for resource providers; however, each resource provider may support a subset of this list. + /// The ID of the target subscription. + /// The cancellation token to use. + /// is null. + public Response ListLocations(string subscriptionId, CancellationToken cancellationToken = default) + { + if (subscriptionId == null) + { + throw new ArgumentNullException(nameof(subscriptionId)); + } + + using var message = CreateListLocationsRequest(subscriptionId); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + LocationListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = LocationListResult.DeserializeLocationListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal Azure.Core.HttpMessage CreateGetRequest(string subscriptionId) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendQuery("api-version", "2019-11-01", true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + /// Gets details about a specified subscription. + /// The ID of the target subscription. + /// The cancellation token to use. + /// is null. + public async Task> GetAsync(string subscriptionId, CancellationToken cancellationToken = default) + { + if (subscriptionId == null) + { + throw new ArgumentNullException(nameof(subscriptionId)); + } + + using var message = CreateGetRequest(subscriptionId); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + SubscriptionData value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = SubscriptionData.DeserializeSubscriptionData(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Gets details about a specified subscription. + /// The ID of the target subscription. + /// The cancellation token to use. + /// is null. + public Response Get(string subscriptionId, CancellationToken cancellationToken = default) + { + if (subscriptionId == null) + { + throw new ArgumentNullException(nameof(subscriptionId)); + } + + using var message = CreateGetRequest(subscriptionId); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + SubscriptionData value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = SubscriptionData.DeserializeSubscriptionData(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal Azure.Core.HttpMessage CreateListRequest() + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendPath("/subscriptions", false); + uri.AppendQuery("api-version", "2019-11-01", true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + /// Gets all subscriptions for a tenant. + /// The cancellation token to use. + public async Task> ListAsync(CancellationToken cancellationToken = default) + { + using var message = CreateListRequest(); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + SubscriptionListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = SubscriptionListResult.DeserializeSubscriptionListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Gets all subscriptions for a tenant. + /// The cancellation token to use. + public Response List(CancellationToken cancellationToken = default) + { + using var message = CreateListRequest(); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + SubscriptionListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = SubscriptionListResult.DeserializeSubscriptionListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal Azure.Core.HttpMessage CreateListNextPageRequest(string nextLink) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendRawNextLink(nextLink, false); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + /// Gets all subscriptions for a tenant. + /// The URL to the next page of results. + /// The cancellation token to use. + /// is null. + public async Task> ListNextPageAsync(string nextLink, CancellationToken cancellationToken = default) + { + if (nextLink == null) + { + throw new ArgumentNullException(nameof(nextLink)); + } + + using var message = CreateListNextPageRequest(nextLink); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + SubscriptionListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = SubscriptionListResult.DeserializeSubscriptionListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Gets all subscriptions for a tenant. + /// The URL to the next page of results. + /// The cancellation token to use. + /// is null. + public Response ListNextPage(string nextLink, CancellationToken cancellationToken = default) + { + if (nextLink == null) + { + throw new ArgumentNullException(nameof(nextLink)); + } + + using var message = CreateListNextPageRequest(nextLink); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + SubscriptionListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = SubscriptionListResult.DeserializeSubscriptionListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + } +} diff --git a/sdk/resourcemanager/Azure.ResourceManager.Core/src/Placeholder/SubscriptionData.cs b/sdk/resourcemanager/Azure.ResourceManager.Core/src/Placeholder/SubscriptionData.cs deleted file mode 100644 index f3aecbe61853..000000000000 --- a/sdk/resourcemanager/Azure.ResourceManager.Core/src/Placeholder/SubscriptionData.cs +++ /dev/null @@ -1,71 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -using Azure.ResourceManager.Resources.Models; -using System.Collections.Generic; - -namespace Azure.ResourceManager.Core -{ - /// - /// A class representing the subscription data model. - /// - public class SubscriptionData : Resource - { - /// - /// Initializes a new instance of the class. - /// - /// The subscription model. - public SubscriptionData(ResourceManager.Resources.Models.Subscription subscription) - :base(subscription.Id, subscription.DisplayName, SubscriptionOperations.ResourceType) - { - Name = subscription.DisplayName; - SubscriptionGuid = subscription.SubscriptionId; - DisplayName = subscription.DisplayName; - State = subscription.State; - SubscriptionPolicies = subscription.SubscriptionPolicies; - AuthorizationSource = subscription.AuthorizationSource; - ManagedByTenants = subscription.ManagedByTenants; - Tags = subscription.Tags; - } - - /// - /// Gets the subscription id. - /// - public override string Name { get; } - - /// - /// Gets the Id of the Subscription. - /// - public string SubscriptionGuid { get; } - - /// - /// Gets the display name of the subscription. - /// - public string DisplayName { get; } - - /// - /// Gets the state of the subscription. - /// - public SubscriptionState? State { get; } - - /// - /// Gets the policies of the subscription. - /// - public SubscriptionPolicies SubscriptionPolicies { get; } - - /// - /// Gets the authorization source of the subscription. - /// - public string AuthorizationSource { get; } - - /// - /// Gets an array containing the tenants managing the subscription. - /// - public IReadOnlyList ManagedByTenants { get; } - - /// - /// Gets the tags attached to the subscription. - /// - public IReadOnlyDictionary Tags { get; } - } -} diff --git a/sdk/resourcemanager/Azure.ResourceManager.Core/src/Resources/LocationContainer.cs b/sdk/resourcemanager/Azure.ResourceManager.Core/src/Resources/LocationContainer.cs index 8635e8caf966..ffe4c20d8d43 100644 --- a/sdk/resourcemanager/Azure.ResourceManager.Core/src/Resources/LocationContainer.cs +++ b/sdk/resourcemanager/Azure.ResourceManager.Core/src/Resources/LocationContainer.cs @@ -2,6 +2,8 @@ // Licensed under the MIT License. using System.Threading; +using Azure.Core; +using Azure.Core.Pipeline; using Azure.ResourceManager.Resources; namespace Azure.ResourceManager.Core @@ -19,6 +21,10 @@ internal LocationContainer(SubscriptionOperations subscriptionOperations) : base(new ClientContext(subscriptionOperations.ClientOptions, subscriptionOperations.Credential, subscriptionOperations.BaseUri, subscriptionOperations.Pipeline), subscriptionOperations.Id) { Id = subscriptionOperations.Id; + ResourceManager.Resources.ResourcesManagementClientOptions options = new(); + SubscriptionsClient = new SubscriptionsOperations(new ClientDiagnostics(options), + ManagementPipelineBuilder.Build(Credential, BaseUri, options), + BaseUri); } /// @@ -27,7 +33,7 @@ internal LocationContainer(SubscriptionOperations subscriptionOperations) /// /// Gets the subscription client. /// - private SubscriptionsOperations SubscriptionsClient => ResourcesClient.Subscriptions; + private SubscriptionsOperations SubscriptionsClient; /// /// The resource id @@ -49,7 +55,7 @@ public SubscriptionContainer GetSubscriptions() /// A collection of location data that may take multiple service requests to iterate over. public Pageable List() { - return new PhWrappingPageable(SubscriptionsClient.ListLocations(Id.SubscriptionId), s => s.DisplayName); + return SubscriptionsClient.ListLocations(Id.SubscriptionId); } /// @@ -59,7 +65,7 @@ public Pageable List() /// An async collection of location data that may take multiple service requests to iterate over. public AsyncPageable ListAsync(CancellationToken token = default(CancellationToken)) { - return new PhWrappingAsyncPageable(SubscriptionsClient.ListLocationsAsync(Id.SubscriptionId, token), s => s.DisplayName); + return SubscriptionsClient.ListLocationsAsync(Id.SubscriptionId, token); } } } diff --git a/sdk/resourcemanager/Azure.ResourceManager.Core/src/SubscriptionContainer.cs b/sdk/resourcemanager/Azure.ResourceManager.Core/src/SubscriptionContainer.cs index 26cbf02b7264..b0613d6daaa5 100644 --- a/sdk/resourcemanager/Azure.ResourceManager.Core/src/SubscriptionContainer.cs +++ b/sdk/resourcemanager/Azure.ResourceManager.Core/src/SubscriptionContainer.cs @@ -4,6 +4,7 @@ using System; using System.Threading; using Azure.Core; +using Azure.Core.Pipeline; using Azure.ResourceManager.Resources; namespace Azure.ResourceManager.Core @@ -27,6 +28,10 @@ protected SubscriptionContainer() internal SubscriptionContainer(ClientContext clientContext) : base(clientContext, null) { + ResourceManager.Resources.ResourcesManagementClientOptions options = new(); + Operations = new SubscriptionsOperations(new ClientDiagnostics(options), + ManagementPipelineBuilder.Build(Credential, BaseUri, options), + BaseUri); } /// @@ -37,11 +42,7 @@ internal SubscriptionContainer(ClientContext clientContext) /// /// Gets the operations that can be performed on the container. /// - private SubscriptionsOperations Operations => new ResourcesManagementClient( - BaseUri, - Guid.NewGuid().ToString(), - Credential, - ClientOptions.Convert()).Subscriptions; + private SubscriptionsOperations Operations; /// /// Lists all subscriptions in the current container. @@ -57,7 +58,7 @@ public virtual Pageable List(CancellationToken cancellationToken = try { - return new PhWrappingPageable( + return new PhWrappingPageable( Operations.List(cancellationToken), Converter()); } @@ -82,7 +83,7 @@ public virtual AsyncPageable ListAsync(CancellationToken cancellat try { - return new PhWrappingAsyncPageable( + return new PhWrappingAsyncPageable( Operations.ListAsync(cancellationToken), Converter()); } @@ -114,9 +115,9 @@ protected override ResourceOperationsBase Converter() + private Func Converter() { - return s => new Subscription(new SubscriptionOperations(new ClientContext(ClientOptions, Credential, BaseUri, Pipeline), s.SubscriptionId), new SubscriptionData(s)); + return s => new Subscription(new SubscriptionOperations(new ClientContext(ClientOptions, Credential, BaseUri, Pipeline), s.Id), s); } } } diff --git a/sdk/resourcemanager/Azure.ResourceManager.Core/src/SubscriptionOperations.cs b/sdk/resourcemanager/Azure.ResourceManager.Core/src/SubscriptionOperations.cs index a93b8fde435a..ad7259cd5c23 100644 --- a/sdk/resourcemanager/Azure.ResourceManager.Core/src/SubscriptionOperations.cs +++ b/sdk/resourcemanager/Azure.ResourceManager.Core/src/SubscriptionOperations.cs @@ -5,7 +5,7 @@ using System.Threading; using System.Threading.Tasks; using Azure.Core; -using Azure.ResourceManager.Resources; +using Azure.Core.Pipeline; namespace Azure.ResourceManager.Core { @@ -34,6 +34,10 @@ protected SubscriptionOperations() internal SubscriptionOperations(ClientContext clientContext, string subscriptionGuid) : base(clientContext, new SubscriptionResourceIdentifier(subscriptionGuid)) { + ResourceManager.Resources.ResourcesManagementClientOptions options = new(); + SubscriptionsClient = new SubscriptionsOperations(new ClientDiagnostics(options), + ManagementPipelineBuilder.Build(Credential, BaseUri, options), + BaseUri); } /// @@ -44,6 +48,10 @@ internal SubscriptionOperations(ClientContext clientContext, string subscription protected SubscriptionOperations(SubscriptionOperations subscription, SubscriptionResourceIdentifier id) : base(subscription, id) { + ResourceManager.Resources.ResourcesManagementClientOptions options = new(); + SubscriptionsClient = new SubscriptionsOperations(new ClientDiagnostics(options), + ManagementPipelineBuilder.Build(Credential, BaseUri, options), + BaseUri); } /// @@ -73,11 +81,7 @@ public virtual AsyncPageable ListResourcesAsync(Func protected override ResourceType ValidResourceType => ResourceType; - private SubscriptionsOperations SubscriptionsClient => new ResourcesManagementClient( - BaseUri, - Guid.NewGuid().ToString(), - Credential, - ClientOptions.Convert()).Subscriptions; + private SubscriptionsOperations SubscriptionsClient; /// /// Gets the resource group container under this subscription. @@ -100,7 +104,7 @@ public virtual LocationContainer GetLocations() /// public override ArmResponse Get(CancellationToken cancellationToken = default) { - return new PhArmResponse( + return new PhArmResponse( SubscriptionsClient.Get(Id.Name, cancellationToken), Converter()); } @@ -108,14 +112,14 @@ public override ArmResponse Get(CancellationToken cancellationToke /// public override async Task> GetAsync(CancellationToken cancellationToken = default) { - return new PhArmResponse( + return new PhArmResponse( await SubscriptionsClient.GetAsync(Id.Name, cancellationToken).ConfigureAwait(false), Converter()); } - private Func Converter() + private Func Converter() { - return s => new Subscription(this, new SubscriptionData(s)); + return s => new Subscription(this, s); } } } From 20b08d5f666f828ba7d8b8692f903618de4745f8 Mon Sep 17 00:00:00 2001 From: Harvey Chen <30464227+HarveyLink@users.noreply.github.com> Date: Thu, 29 Apr 2021 18:05:37 +0800 Subject: [PATCH 02/16] Merge --- .../src/Generated/SubscriptionsOperations.cs | 205 ------------------ .../Generated/SubscriptionsRestOperations.cs | 2 +- .../src/Resources/LocationContainer.cs | 8 +- .../src/SubscriptionContainer.cs | 9 +- .../src/SubscriptionOperations.cs | 148 ++++++++++++- 5 files changed, 144 insertions(+), 228 deletions(-) delete mode 100644 sdk/resourcemanager/Azure.ResourceManager.Core/src/Generated/SubscriptionsOperations.cs diff --git a/sdk/resourcemanager/Azure.ResourceManager.Core/src/Generated/SubscriptionsOperations.cs b/sdk/resourcemanager/Azure.ResourceManager.Core/src/Generated/SubscriptionsOperations.cs deleted file mode 100644 index 883736453f8d..000000000000 --- a/sdk/resourcemanager/Azure.ResourceManager.Core/src/Generated/SubscriptionsOperations.cs +++ /dev/null @@ -1,205 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -using System; -using System.Collections.Generic; -using System.Text; -using System.Threading; -using System.Threading.Tasks; -using Azure.Core; -using Azure.Core.Pipeline; - -namespace Azure.ResourceManager.Core -{ - /// The Subscriptions service client. - public partial class SubscriptionsOperations - { - private readonly ClientDiagnostics _clientDiagnostics; - private readonly HttpPipeline _pipeline; - internal SubscriptionsRestOperations RestClient { get; } - - /// Initializes a new instance of SubscriptionsOperations for mocking. - protected SubscriptionsOperations() - { - } - - /// Initializes a new instance of SubscriptionsOperations. - /// The handler for diagnostic messaging in the client. - /// The HTTP pipeline for sending and receiving REST requests and responses. - /// server parameter. - internal SubscriptionsOperations(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, Uri endpoint = null) - { - RestClient = new SubscriptionsRestOperations(clientDiagnostics, pipeline, endpoint); - _clientDiagnostics = clientDiagnostics; - _pipeline = pipeline; - } - - /// Gets details about a specified subscription. - /// The ID of the target subscription. - /// The cancellation token to use. - public virtual async Task> GetAsync(string subscriptionId, CancellationToken cancellationToken = default) - { - using var scope = _clientDiagnostics.CreateScope("SubscriptionsOperations.Get"); - scope.Start(); - try - { - return await RestClient.GetAsync(subscriptionId, cancellationToken).ConfigureAwait(false); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// Gets details about a specified subscription. - /// The ID of the target subscription. - /// The cancellation token to use. - public virtual Response Get(string subscriptionId, CancellationToken cancellationToken = default) - { - using var scope = _clientDiagnostics.CreateScope("SubscriptionsOperations.Get"); - scope.Start(); - try - { - return RestClient.Get(subscriptionId, cancellationToken); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// This operation provides all the locations that are available for resource providers; however, each resource provider may support a subset of this list. - /// The ID of the target subscription. - /// The cancellation token to use. - /// is null. - public virtual AsyncPageable ListLocationsAsync(string subscriptionId, CancellationToken cancellationToken = default) - { - if (subscriptionId == null) - { - throw new ArgumentNullException(nameof(subscriptionId)); - } - - async Task> FirstPageFunc(int? pageSizeHint) - { - using var scope = _clientDiagnostics.CreateScope("SubscriptionsOperations.ListLocations"); - scope.Start(); - try - { - var response = await RestClient.ListLocationsAsync(subscriptionId, cancellationToken).ConfigureAwait(false); - return Page.FromValues(response.Value.Value, null, response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - return PageableHelpers.CreateAsyncEnumerable(FirstPageFunc, null); - } - - /// This operation provides all the locations that are available for resource providers; however, each resource provider may support a subset of this list. - /// The ID of the target subscription. - /// The cancellation token to use. - /// is null. - public virtual Pageable ListLocations(string subscriptionId, CancellationToken cancellationToken = default) - { - if (subscriptionId == null) - { - throw new ArgumentNullException(nameof(subscriptionId)); - } - - Page FirstPageFunc(int? pageSizeHint) - { - using var scope = _clientDiagnostics.CreateScope("SubscriptionsOperations.ListLocations"); - scope.Start(); - try - { - var response = RestClient.ListLocations(subscriptionId, cancellationToken); - return Page.FromValues(response.Value.Value, null, response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - return PageableHelpers.CreateEnumerable(FirstPageFunc, null); - } - - /// Gets all subscriptions for a tenant. - /// The cancellation token to use. - public virtual AsyncPageable ListAsync(CancellationToken cancellationToken = default) - { - async Task> FirstPageFunc(int? pageSizeHint) - { - using var scope = _clientDiagnostics.CreateScope("SubscriptionsOperations.List"); - scope.Start(); - try - { - var response = await RestClient.ListAsync(cancellationToken).ConfigureAwait(false); - return Page.FromValues(response.Value.Value, response.Value.NextLink, response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - async Task> NextPageFunc(string nextLink, int? pageSizeHint) - { - using var scope = _clientDiagnostics.CreateScope("SubscriptionsOperations.List"); - scope.Start(); - try - { - var response = await RestClient.ListNextPageAsync(nextLink, cancellationToken).ConfigureAwait(false); - return Page.FromValues(response.Value.Value, response.Value.NextLink, response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - return PageableHelpers.CreateAsyncEnumerable(FirstPageFunc, NextPageFunc); - } - - /// Gets all subscriptions for a tenant. - /// The cancellation token to use. - public virtual Pageable List(CancellationToken cancellationToken = default) - { - Page FirstPageFunc(int? pageSizeHint) - { - using var scope = _clientDiagnostics.CreateScope("SubscriptionsOperations.List"); - scope.Start(); - try - { - var response = RestClient.List(cancellationToken); - return Page.FromValues(response.Value.Value, response.Value.NextLink, response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - Page NextPageFunc(string nextLink, int? pageSizeHint) - { - using var scope = _clientDiagnostics.CreateScope("SubscriptionsOperations.List"); - scope.Start(); - try - { - var response = RestClient.ListNextPage(nextLink, cancellationToken); - return Page.FromValues(response.Value.Value, response.Value.NextLink, response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - return PageableHelpers.CreateEnumerable(FirstPageFunc, NextPageFunc); - } - } -} diff --git a/sdk/resourcemanager/Azure.ResourceManager.Core/src/Generated/SubscriptionsRestOperations.cs b/sdk/resourcemanager/Azure.ResourceManager.Core/src/Generated/SubscriptionsRestOperations.cs index 208de345af7f..5d030218e77c 100644 --- a/sdk/resourcemanager/Azure.ResourceManager.Core/src/Generated/SubscriptionsRestOperations.cs +++ b/sdk/resourcemanager/Azure.ResourceManager.Core/src/Generated/SubscriptionsRestOperations.cs @@ -10,7 +10,7 @@ namespace Azure.ResourceManager.Core { - internal partial class SubscriptionsRestOperations : SubscriptionOperations + internal partial class SubscriptionsRestOperations { private Uri endpoint; private ClientDiagnostics _clientDiagnostics; diff --git a/sdk/resourcemanager/Azure.ResourceManager.Core/src/Resources/LocationContainer.cs b/sdk/resourcemanager/Azure.ResourceManager.Core/src/Resources/LocationContainer.cs index ffe4c20d8d43..3397ee28f7f4 100644 --- a/sdk/resourcemanager/Azure.ResourceManager.Core/src/Resources/LocationContainer.cs +++ b/sdk/resourcemanager/Azure.ResourceManager.Core/src/Resources/LocationContainer.cs @@ -4,7 +4,6 @@ using System.Threading; using Azure.Core; using Azure.Core.Pipeline; -using Azure.ResourceManager.Resources; namespace Azure.ResourceManager.Core { @@ -21,10 +20,7 @@ internal LocationContainer(SubscriptionOperations subscriptionOperations) : base(new ClientContext(subscriptionOperations.ClientOptions, subscriptionOperations.Credential, subscriptionOperations.BaseUri, subscriptionOperations.Pipeline), subscriptionOperations.Id) { Id = subscriptionOperations.Id; - ResourceManager.Resources.ResourcesManagementClientOptions options = new(); - SubscriptionsClient = new SubscriptionsOperations(new ClientDiagnostics(options), - ManagementPipelineBuilder.Build(Credential, BaseUri, options), - BaseUri); + SubscriptionsClient = new SubscriptionOperations(new ClientContext(subscriptionOperations.ClientOptions, subscriptionOperations.Credential, subscriptionOperations.BaseUri, subscriptionOperations.Pipeline), subscriptionOperations.Id); } /// @@ -33,7 +29,7 @@ internal LocationContainer(SubscriptionOperations subscriptionOperations) /// /// Gets the subscription client. /// - private SubscriptionsOperations SubscriptionsClient; + private SubscriptionOperations SubscriptionsClient; /// /// The resource id diff --git a/sdk/resourcemanager/Azure.ResourceManager.Core/src/SubscriptionContainer.cs b/sdk/resourcemanager/Azure.ResourceManager.Core/src/SubscriptionContainer.cs index b0613d6daaa5..287b1271fe7f 100644 --- a/sdk/resourcemanager/Azure.ResourceManager.Core/src/SubscriptionContainer.cs +++ b/sdk/resourcemanager/Azure.ResourceManager.Core/src/SubscriptionContainer.cs @@ -4,8 +4,6 @@ using System; using System.Threading; using Azure.Core; -using Azure.Core.Pipeline; -using Azure.ResourceManager.Resources; namespace Azure.ResourceManager.Core { @@ -28,10 +26,7 @@ protected SubscriptionContainer() internal SubscriptionContainer(ClientContext clientContext) : base(clientContext, null) { - ResourceManager.Resources.ResourcesManagementClientOptions options = new(); - Operations = new SubscriptionsOperations(new ClientDiagnostics(options), - ManagementPipelineBuilder.Build(Credential, BaseUri, options), - BaseUri); + Operations = new SubscriptionOperations(clientContext, Id); } /// @@ -42,7 +37,7 @@ internal SubscriptionContainer(ClientContext clientContext) /// /// Gets the operations that can be performed on the container. /// - private SubscriptionsOperations Operations; + private SubscriptionOperations Operations; /// /// Lists all subscriptions in the current container. diff --git a/sdk/resourcemanager/Azure.ResourceManager.Core/src/SubscriptionOperations.cs b/sdk/resourcemanager/Azure.ResourceManager.Core/src/SubscriptionOperations.cs index ad7259cd5c23..0c492e3b9c49 100644 --- a/sdk/resourcemanager/Azure.ResourceManager.Core/src/SubscriptionOperations.cs +++ b/sdk/resourcemanager/Azure.ResourceManager.Core/src/SubscriptionOperations.cs @@ -34,9 +34,8 @@ protected SubscriptionOperations() internal SubscriptionOperations(ClientContext clientContext, string subscriptionGuid) : base(clientContext, new SubscriptionResourceIdentifier(subscriptionGuid)) { - ResourceManager.Resources.ResourcesManagementClientOptions options = new(); - SubscriptionsClient = new SubscriptionsOperations(new ClientDiagnostics(options), - ManagementPipelineBuilder.Build(Credential, BaseUri, options), + SubscriptionsRestOperations = new SubscriptionsRestOperations(new ClientDiagnostics(this.ClientOptions), + ManagementPipelineBuilder.Build(Credential, BaseUri, this.ClientOptions), BaseUri); } @@ -48,9 +47,8 @@ internal SubscriptionOperations(ClientContext clientContext, string subscription protected SubscriptionOperations(SubscriptionOperations subscription, SubscriptionResourceIdentifier id) : base(subscription, id) { - ResourceManager.Resources.ResourcesManagementClientOptions options = new(); - SubscriptionsClient = new SubscriptionsOperations(new ClientDiagnostics(options), - ManagementPipelineBuilder.Build(Credential, BaseUri, options), + SubscriptionsRestOperations = new SubscriptionsRestOperations(new ClientDiagnostics(this.ClientOptions), + ManagementPipelineBuilder.Build(Credential, BaseUri, this.ClientOptions), BaseUri); } @@ -81,7 +79,7 @@ public virtual AsyncPageable ListResourcesAsync(Func protected override ResourceType ValidResourceType => ResourceType; - private SubscriptionsOperations SubscriptionsClient; + private SubscriptionsRestOperations SubscriptionsRestOperations; /// /// Gets the resource group container under this subscription. @@ -105,7 +103,7 @@ public virtual LocationContainer GetLocations() public override ArmResponse Get(CancellationToken cancellationToken = default) { return new PhArmResponse( - SubscriptionsClient.Get(Id.Name, cancellationToken), + SubscriptionsRestOperations.Get(Id.Name, cancellationToken), Converter()); } @@ -113,10 +111,142 @@ public override ArmResponse Get(CancellationToken cancellationToke public override async Task> GetAsync(CancellationToken cancellationToken = default) { return new PhArmResponse( - await SubscriptionsClient.GetAsync(Id.Name, cancellationToken).ConfigureAwait(false), + await SubscriptionsRestOperations.GetAsync(Id.Name, cancellationToken).ConfigureAwait(false), Converter()); } + /// Gets all subscriptions for a tenant. + /// The cancellation token to use. + public virtual AsyncPageable ListAsync(CancellationToken cancellationToken = default) + { + async Task> FirstPageFunc(int? pageSizeHint) + { + using var scope = Diagnostics.CreateScope("SubscriptionsOperations.List"); + scope.Start(); + try + { + var response = await SubscriptionsRestOperations.ListAsync(cancellationToken).ConfigureAwait(false); + return Page.FromValues(response.Value.Value, response.Value.NextLink, response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + async Task> NextPageFunc(string nextLink, int? pageSizeHint) + { + using var scope = Diagnostics.CreateScope("SubscriptionsOperations.List"); + scope.Start(); + try + { + var response = await SubscriptionsRestOperations.ListNextPageAsync(nextLink, cancellationToken).ConfigureAwait(false); + return Page.FromValues(response.Value.Value, response.Value.NextLink, response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + return PageableHelpers.CreateAsyncEnumerable(FirstPageFunc, NextPageFunc); + } + + /// Gets all subscriptions for a tenant. + /// The cancellation token to use. + public virtual Pageable List(CancellationToken cancellationToken = default) + { + Page FirstPageFunc(int? pageSizeHint) + { + using var scope = Diagnostics.CreateScope("SubscriptionsOperations.List"); + scope.Start(); + try + { + var response = SubscriptionsRestOperations.List(cancellationToken); + return Page.FromValues(response.Value.Value, response.Value.NextLink, response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + Page NextPageFunc(string nextLink, int? pageSizeHint) + { + using var scope = Diagnostics.CreateScope("SubscriptionsOperations.List"); + scope.Start(); + try + { + var response = SubscriptionsRestOperations.ListNextPage(nextLink, cancellationToken); + return Page.FromValues(response.Value.Value, response.Value.NextLink, response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + return PageableHelpers.CreateEnumerable(FirstPageFunc, NextPageFunc); + } + + /// This operation provides all the locations that are available for resource providers; however, each resource provider may support a subset of this list. + /// The ID of the target subscription. + /// The cancellation token to use. + /// is null. + public virtual AsyncPageable ListLocationsAsync(string subscriptionId, CancellationToken cancellationToken = default) + { + if (subscriptionId == null) + { + throw new ArgumentNullException(nameof(subscriptionId)); + } + + async Task> FirstPageFunc(int? pageSizeHint) + { + using var scope = Diagnostics.CreateScope("SubscriptionsOperations.ListLocations"); + scope.Start(); + try + { + var response = await SubscriptionsRestOperations.ListLocationsAsync(subscriptionId, cancellationToken).ConfigureAwait(false); + return Page.FromValues(response.Value.Value, null, response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + return PageableHelpers.CreateAsyncEnumerable(FirstPageFunc, null); + } + + /// This operation provides all the locations that are available for resource providers; however, each resource provider may support a subset of this list. + /// The ID of the target subscription. + /// The cancellation token to use. + /// is null. + public virtual Pageable ListLocations(string subscriptionId, CancellationToken cancellationToken = default) + { + if (subscriptionId == null) + { + throw new ArgumentNullException(nameof(subscriptionId)); + } + + Page FirstPageFunc(int? pageSizeHint) + { + using var scope = Diagnostics.CreateScope("SubscriptionsOperations.ListLocations"); + scope.Start(); + try + { + var response = SubscriptionsRestOperations.ListLocations(subscriptionId, cancellationToken); + return Page.FromValues(response.Value.Value, null, response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + return PageableHelpers.CreateEnumerable(FirstPageFunc, null); + } + private Func Converter() { return s => new Subscription(this, s); From 9498156f98490c7fc108442b9bf2ef6d8645adda Mon Sep 17 00:00:00 2001 From: Minghao Chen <30464227+HarveyLink@users.noreply.github.com> Date: Thu, 29 Apr 2021 19:39:31 +0800 Subject: [PATCH 03/16] Update SubscriptionOperations.cs --- .../src/SubscriptionOperations.cs | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/sdk/resourcemanager/Azure.ResourceManager.Core/src/SubscriptionOperations.cs b/sdk/resourcemanager/Azure.ResourceManager.Core/src/SubscriptionOperations.cs index 0c492e3b9c49..0bcd9dd0dae4 100644 --- a/sdk/resourcemanager/Azure.ResourceManager.Core/src/SubscriptionOperations.cs +++ b/sdk/resourcemanager/Azure.ResourceManager.Core/src/SubscriptionOperations.cs @@ -34,9 +34,7 @@ protected SubscriptionOperations() internal SubscriptionOperations(ClientContext clientContext, string subscriptionGuid) : base(clientContext, new SubscriptionResourceIdentifier(subscriptionGuid)) { - SubscriptionsRestOperations = new SubscriptionsRestOperations(new ClientDiagnostics(this.ClientOptions), - ManagementPipelineBuilder.Build(Credential, BaseUri, this.ClientOptions), - BaseUri); + SubscriptionsRestOperations = new SubscriptionsRestOperations(new ClientDiagnostics(this.ClientOptions), this.Pipeline, BaseUri); } /// @@ -47,9 +45,7 @@ internal SubscriptionOperations(ClientContext clientContext, string subscription protected SubscriptionOperations(SubscriptionOperations subscription, SubscriptionResourceIdentifier id) : base(subscription, id) { - SubscriptionsRestOperations = new SubscriptionsRestOperations(new ClientDiagnostics(this.ClientOptions), - ManagementPipelineBuilder.Build(Credential, BaseUri, this.ClientOptions), - BaseUri); + SubscriptionsRestOperations = new SubscriptionsRestOperations(new ClientDiagnostics(this.ClientOptions), this.Pipeline, BaseUri); } /// From 974b066a8dc93651fa5ba7c0885aef907686bc5d Mon Sep 17 00:00:00 2001 From: Harvey Chen <30464227+HarveyLink@users.noreply.github.com> Date: Fri, 30 Apr 2021 08:23:10 +0800 Subject: [PATCH 04/16] Fix error --- .../Azure.ResourceManager.Core/src/SubscriptionContainer.cs | 2 +- .../Azure.ResourceManager.Core/src/SubscriptionOperations.cs | 4 +--- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/sdk/resourcemanager/Azure.ResourceManager.Core/src/SubscriptionContainer.cs b/sdk/resourcemanager/Azure.ResourceManager.Core/src/SubscriptionContainer.cs index 287b1271fe7f..ad0863849244 100644 --- a/sdk/resourcemanager/Azure.ResourceManager.Core/src/SubscriptionContainer.cs +++ b/sdk/resourcemanager/Azure.ResourceManager.Core/src/SubscriptionContainer.cs @@ -26,7 +26,7 @@ protected SubscriptionContainer() internal SubscriptionContainer(ClientContext clientContext) : base(clientContext, null) { - Operations = new SubscriptionOperations(clientContext, Id); + Operations = new SubscriptionOperations(clientContext, Guid.NewGuid().ToString()); } /// diff --git a/sdk/resourcemanager/Azure.ResourceManager.Core/src/SubscriptionOperations.cs b/sdk/resourcemanager/Azure.ResourceManager.Core/src/SubscriptionOperations.cs index 0bcd9dd0dae4..e783783e2ecf 100644 --- a/sdk/resourcemanager/Azure.ResourceManager.Core/src/SubscriptionOperations.cs +++ b/sdk/resourcemanager/Azure.ResourceManager.Core/src/SubscriptionOperations.cs @@ -34,7 +34,6 @@ protected SubscriptionOperations() internal SubscriptionOperations(ClientContext clientContext, string subscriptionGuid) : base(clientContext, new SubscriptionResourceIdentifier(subscriptionGuid)) { - SubscriptionsRestOperations = new SubscriptionsRestOperations(new ClientDiagnostics(this.ClientOptions), this.Pipeline, BaseUri); } /// @@ -45,7 +44,6 @@ internal SubscriptionOperations(ClientContext clientContext, string subscription protected SubscriptionOperations(SubscriptionOperations subscription, SubscriptionResourceIdentifier id) : base(subscription, id) { - SubscriptionsRestOperations = new SubscriptionsRestOperations(new ClientDiagnostics(this.ClientOptions), this.Pipeline, BaseUri); } /// @@ -75,7 +73,7 @@ public virtual AsyncPageable ListResourcesAsync(Func protected override ResourceType ValidResourceType => ResourceType; - private SubscriptionsRestOperations SubscriptionsRestOperations; + private SubscriptionsRestOperations SubscriptionsRestOperations => new SubscriptionsRestOperations(new ClientDiagnostics(this.ClientOptions), this.Pipeline, BaseUri); /// /// Gets the resource group container under this subscription. From c9549cb0159f090bcf7096ff87c57818a7d6f1d7 Mon Sep 17 00:00:00 2001 From: Harvey Chen <30464227+HarveyLink@users.noreply.github.com> Date: Fri, 30 Apr 2021 08:39:05 +0800 Subject: [PATCH 05/16] Update using --- .../src/Generated/ChangeTrackingList.cs | 1 - .../src/Generated/LocationListResult.Serialization.cs | 2 -- .../src/Generated/LocationListResult.cs | 2 -- .../src/Generated/SubscriptionData.Serialization.cs | 2 -- .../src/Generated/SubscriptionListResult.Serialization.cs | 2 -- .../src/Generated/SubscriptionListResult.cs | 1 - .../src/Generated/SubscriptionState.Serialization.cs | 2 -- 7 files changed, 12 deletions(-) diff --git a/sdk/resourcemanager/Azure.ResourceManager.Core/src/Generated/ChangeTrackingList.cs b/sdk/resourcemanager/Azure.ResourceManager.Core/src/Generated/ChangeTrackingList.cs index 13ff40b55a48..f176dcd9aa62 100644 --- a/sdk/resourcemanager/Azure.ResourceManager.Core/src/Generated/ChangeTrackingList.cs +++ b/sdk/resourcemanager/Azure.ResourceManager.Core/src/Generated/ChangeTrackingList.cs @@ -5,7 +5,6 @@ using System.Collections; using System.Collections.Generic; using System.Linq; -using System.Text; using Azure.Core; #nullable enable diff --git a/sdk/resourcemanager/Azure.ResourceManager.Core/src/Generated/LocationListResult.Serialization.cs b/sdk/resourcemanager/Azure.ResourceManager.Core/src/Generated/LocationListResult.Serialization.cs index 8bd803c25991..ace8caef4232 100644 --- a/sdk/resourcemanager/Azure.ResourceManager.Core/src/Generated/LocationListResult.Serialization.cs +++ b/sdk/resourcemanager/Azure.ResourceManager.Core/src/Generated/LocationListResult.Serialization.cs @@ -1,9 +1,7 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -using System; using System.Collections.Generic; -using System.Text; using System.Text.Json; using Azure.Core; diff --git a/sdk/resourcemanager/Azure.ResourceManager.Core/src/Generated/LocationListResult.cs b/sdk/resourcemanager/Azure.ResourceManager.Core/src/Generated/LocationListResult.cs index 1c6889f64070..e9aa64f8f59b 100644 --- a/sdk/resourcemanager/Azure.ResourceManager.Core/src/Generated/LocationListResult.cs +++ b/sdk/resourcemanager/Azure.ResourceManager.Core/src/Generated/LocationListResult.cs @@ -1,9 +1,7 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -using System; using System.Collections.Generic; -using System.Text; namespace Azure.ResourceManager.Core { diff --git a/sdk/resourcemanager/Azure.ResourceManager.Core/src/Generated/SubscriptionData.Serialization.cs b/sdk/resourcemanager/Azure.ResourceManager.Core/src/Generated/SubscriptionData.Serialization.cs index 3a6e1c4f0698..12b4b2cb5ee9 100644 --- a/sdk/resourcemanager/Azure.ResourceManager.Core/src/Generated/SubscriptionData.Serialization.cs +++ b/sdk/resourcemanager/Azure.ResourceManager.Core/src/Generated/SubscriptionData.Serialization.cs @@ -1,9 +1,7 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -using System; using System.Collections.Generic; -using System.Text; using System.Text.Json; using Azure.Core; diff --git a/sdk/resourcemanager/Azure.ResourceManager.Core/src/Generated/SubscriptionListResult.Serialization.cs b/sdk/resourcemanager/Azure.ResourceManager.Core/src/Generated/SubscriptionListResult.Serialization.cs index e0f94b280c3c..0eaab2d804b5 100644 --- a/sdk/resourcemanager/Azure.ResourceManager.Core/src/Generated/SubscriptionListResult.Serialization.cs +++ b/sdk/resourcemanager/Azure.ResourceManager.Core/src/Generated/SubscriptionListResult.Serialization.cs @@ -1,9 +1,7 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -using System; using System.Collections.Generic; -using System.Text; using System.Text.Json; using Azure.Core; diff --git a/sdk/resourcemanager/Azure.ResourceManager.Core/src/Generated/SubscriptionListResult.cs b/sdk/resourcemanager/Azure.ResourceManager.Core/src/Generated/SubscriptionListResult.cs index 2a15f7a43d67..e61ab11686e4 100644 --- a/sdk/resourcemanager/Azure.ResourceManager.Core/src/Generated/SubscriptionListResult.cs +++ b/sdk/resourcemanager/Azure.ResourceManager.Core/src/Generated/SubscriptionListResult.cs @@ -3,7 +3,6 @@ using System; using System.Collections.Generic; -using System.Text; namespace Azure.ResourceManager.Core { diff --git a/sdk/resourcemanager/Azure.ResourceManager.Core/src/Generated/SubscriptionState.Serialization.cs b/sdk/resourcemanager/Azure.ResourceManager.Core/src/Generated/SubscriptionState.Serialization.cs index bd584e0c9875..1d2235ba36a3 100644 --- a/sdk/resourcemanager/Azure.ResourceManager.Core/src/Generated/SubscriptionState.Serialization.cs +++ b/sdk/resourcemanager/Azure.ResourceManager.Core/src/Generated/SubscriptionState.Serialization.cs @@ -2,8 +2,6 @@ // Licensed under the MIT License. using System; -using System.Collections.Generic; -using System.Text; namespace Azure.ResourceManager.Core { From e97c649ac362a5c341f55bdf6b36f210b8270b44 Mon Sep 17 00:00:00 2001 From: Harvey Chen <30464227+HarveyLink@users.noreply.github.com> Date: Fri, 7 May 2021 14:06:01 +0800 Subject: [PATCH 06/16] Update test --- .../src/Resources/LocationData.cs | 5 +- .../src/SubscriptionOperations.cs | 12 +- .../Scenario/SubscriptionOperationsTests.cs | 16 + .../TestListLocation.json | 1314 +++++++++++++++++ .../TestListLocationAsync.json | 1314 +++++++++++++++++ 5 files changed, 2654 insertions(+), 7 deletions(-) create mode 100644 sdk/resourcemanager/Azure.ResourceManager.Core/tests/SessionRecords/SubscriptionOperationsTests/TestListLocation.json create mode 100644 sdk/resourcemanager/Azure.ResourceManager.Core/tests/SessionRecords/SubscriptionOperationsTests/TestListLocationAsync.json diff --git a/sdk/resourcemanager/Azure.ResourceManager.Core/src/Resources/LocationData.cs b/sdk/resourcemanager/Azure.ResourceManager.Core/src/Resources/LocationData.cs index db55f0eef8d2..a9770d8b24bd 100644 --- a/sdk/resourcemanager/Azure.ResourceManager.Core/src/Resources/LocationData.cs +++ b/sdk/resourcemanager/Azure.ResourceManager.Core/src/Resources/LocationData.cs @@ -266,7 +266,10 @@ public class LocationData : IEquatable, IComparable private const string RegexDash = @"-"; private const string RegexWhitespace = @" "; - private LocationData() + /// + /// Initializes a new instance of the class. + /// + protected LocationData() { } diff --git a/sdk/resourcemanager/Azure.ResourceManager.Core/src/SubscriptionOperations.cs b/sdk/resourcemanager/Azure.ResourceManager.Core/src/SubscriptionOperations.cs index e783783e2ecf..34d4272ebba9 100644 --- a/sdk/resourcemanager/Azure.ResourceManager.Core/src/SubscriptionOperations.cs +++ b/sdk/resourcemanager/Azure.ResourceManager.Core/src/SubscriptionOperations.cs @@ -115,7 +115,7 @@ public virtual AsyncPageable ListAsync(CancellationToken cance { async Task> FirstPageFunc(int? pageSizeHint) { - using var scope = Diagnostics.CreateScope("SubscriptionsOperations.List"); + using var scope = Diagnostics.CreateScope("SubscriptionOperations.List"); scope.Start(); try { @@ -130,7 +130,7 @@ async Task> FirstPageFunc(int? pageSizeHint) } async Task> NextPageFunc(string nextLink, int? pageSizeHint) { - using var scope = Diagnostics.CreateScope("SubscriptionsOperations.List"); + using var scope = Diagnostics.CreateScope("SubscriptionOperations.List"); scope.Start(); try { @@ -152,7 +152,7 @@ public virtual Pageable List(CancellationToken cancellationTok { Page FirstPageFunc(int? pageSizeHint) { - using var scope = Diagnostics.CreateScope("SubscriptionsOperations.List"); + using var scope = Diagnostics.CreateScope("SubscriptionOperations.List"); scope.Start(); try { @@ -167,7 +167,7 @@ Page FirstPageFunc(int? pageSizeHint) } Page NextPageFunc(string nextLink, int? pageSizeHint) { - using var scope = Diagnostics.CreateScope("SubscriptionsOperations.List"); + using var scope = Diagnostics.CreateScope("SubscriptionOperations.List"); scope.Start(); try { @@ -196,7 +196,7 @@ public virtual AsyncPageable ListLocationsAsync(string subscriptio async Task> FirstPageFunc(int? pageSizeHint) { - using var scope = Diagnostics.CreateScope("SubscriptionsOperations.ListLocations"); + using var scope = Diagnostics.CreateScope("SubscriptionOperations.ListLocations"); scope.Start(); try { @@ -225,7 +225,7 @@ public virtual Pageable ListLocations(string subscriptionId, Cance Page FirstPageFunc(int? pageSizeHint) { - using var scope = Diagnostics.CreateScope("SubscriptionsOperations.ListLocations"); + using var scope = Diagnostics.CreateScope("SubscriptionOperations.ListLocations"); scope.Start(); try { diff --git a/sdk/resourcemanager/Azure.ResourceManager.Core/tests/Scenario/SubscriptionOperationsTests.cs b/sdk/resourcemanager/Azure.ResourceManager.Core/tests/Scenario/SubscriptionOperationsTests.cs index 00aa02b949f8..649cedd3550d 100644 --- a/sdk/resourcemanager/Azure.ResourceManager.Core/tests/Scenario/SubscriptionOperationsTests.cs +++ b/sdk/resourcemanager/Azure.ResourceManager.Core/tests/Scenario/SubscriptionOperationsTests.cs @@ -124,6 +124,22 @@ public async Task TestGetResourceGroupOpsLong(int length) } } + [RecordedTest] + public async Task TestListSubscriptions() + { + var subOps = Client.DefaultSubscription; + var subscriptions = await subOps.ListAsync().ToEnumerableAsync(); + Assert.IsTrue(subscriptions.Count != 0); + } + + [RecordedTest] + public async Task TestListLocations() + { + var subOps = Client.DefaultSubscription; + var locations = await subOps.ListLocationsAsync(subOps.Id.SubscriptionId).ToEnumerableAsync(); + Assert.IsTrue(locations.Count != 0); + } + private string GetLongString(int length) { StringBuilder builder = new StringBuilder(); diff --git a/sdk/resourcemanager/Azure.ResourceManager.Core/tests/SessionRecords/SubscriptionOperationsTests/TestListLocation.json b/sdk/resourcemanager/Azure.ResourceManager.Core/tests/SessionRecords/SubscriptionOperationsTests/TestListLocation.json new file mode 100644 index 000000000000..2b74621a822f --- /dev/null +++ b/sdk/resourcemanager/Azure.ResourceManager.Core/tests/SessionRecords/SubscriptionOperationsTests/TestListLocation.json @@ -0,0 +1,1314 @@ +{ + "Entries": [ + { + "RequestUri": "https://management.azure.com/subscriptions/0accec26-d6de-4757-8e74-d080f38eaaab?api-version=2019-11-01", + "RequestMethod": "GET", + "RequestHeaders": { + "Accept": "application/json", + "Authorization": "Sanitized", + "User-Agent": [ + "azsdk-net-ResourceManager.Core/1.0.0-alpha.20210507.1", + "(.NET Core 4.6.29916.01; Microsoft Windows 10.0.19043 )" + ], + "x-ms-client-request-id": "ae5b25c1945283e579032211e2a24663", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "Cache-Control": "no-cache", + "Content-Length": "403", + "Content-Type": "application/json; charset=utf-8", + "Date": "Fri, 07 May 2021 03:08:22 GMT", + "Expires": "-1", + "Pragma": "no-cache", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains", + "X-Content-Type-Options": "nosniff", + "x-ms-correlation-request-id": "401700c9-1af9-45b2-9a33-76d6ad14d24e", + "x-ms-ratelimit-remaining-subscription-reads": "11998", + "x-ms-request-id": "401700c9-1af9-45b2-9a33-76d6ad14d24e", + "x-ms-routing-request-id": "SOUTHEASTASIA:20210507T030822Z:401700c9-1af9-45b2-9a33-76d6ad14d24e" + }, + "ResponseBody": { + "id": "/subscriptions/0accec26-d6de-4757-8e74-d080f38eaaab", + "authorizationSource": "RoleBased", + "managedByTenants": [], + "subscriptionId": "0accec26-d6de-4757-8e74-d080f38eaaab", + "tenantId": "72f988bf-86f1-41af-91ab-2d7cd011db47", + "displayName": "ACR - TEST - China Team", + "state": "Enabled", + "subscriptionPolicies": { + "locationPlacementId": "Internal_2014-09-01", + "quotaId": "Internal_2014-09-01", + "spendingLimit": "Off" + } + } + }, + { + "RequestUri": "https://management.azure.com/subscriptions/0accec26-d6de-4757-8e74-d080f38eaaab/locations?api-version=2019-11-01", + "RequestMethod": "GET", + "RequestHeaders": { + "Accept": "application/json", + "Authorization": "Sanitized", + "traceparent": "00-8db4c0810134dc4885c51ce665a15a82-a5bb14785c48a343-00", + "User-Agent": [ + "azsdk-net-ResourceManager.Core/1.0.0-alpha.20210507.1", + "(.NET Core 4.6.29916.01; Microsoft Windows 10.0.19043 )" + ], + "x-ms-client-request-id": "87efcab13cdf357e5132adee4dee3308", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "Cache-Control": "no-cache", + "Content-Length": "28874", + "Content-Type": "application/json; charset=utf-8", + "Date": "Fri, 07 May 2021 03:08:23 GMT", + "Expires": "-1", + "Pragma": "no-cache", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains", + "X-Content-Type-Options": "nosniff", + "x-ms-correlation-request-id": "2b6c2ba4-47ea-4ada-8c3e-3581985b7ea9", + "x-ms-ratelimit-remaining-subscription-reads": "11997", + "x-ms-request-id": "2b6c2ba4-47ea-4ada-8c3e-3581985b7ea9", + "x-ms-routing-request-id": "SOUTHEASTASIA:20210507T030823Z:2b6c2ba4-47ea-4ada-8c3e-3581985b7ea9" + }, + "ResponseBody": { + "value": [ + { + "id": "/subscriptions/0accec26-d6de-4757-8e74-d080f38eaaab/locations/eastus", + "name": "eastus", + "displayName": "East US", + "regionalDisplayName": "(US) East US", + "metadata": { + "regionType": "Physical", + "regionCategory": "Recommended", + "geographyGroup": "US", + "longitude": "-79.8164", + "latitude": "37.3719", + "physicalLocation": "Virginia", + "pairedRegion": [ + { + "name": "westus", + "id": "/subscriptions/0accec26-d6de-4757-8e74-d080f38eaaab/locations/westus" + } + ] + } + }, + { + "id": "/subscriptions/0accec26-d6de-4757-8e74-d080f38eaaab/locations/eastus2", + "name": "eastus2", + "displayName": "East US 2", + "regionalDisplayName": "(US) East US 2", + "metadata": { + "regionType": "Physical", + "regionCategory": "Recommended", + "geographyGroup": "US", + "longitude": "-78.3889", + "latitude": "36.6681", + "physicalLocation": "Virginia", + "pairedRegion": [ + { + "name": "centralus", + "id": "/subscriptions/0accec26-d6de-4757-8e74-d080f38eaaab/locations/centralus" + } + ] + } + }, + { + "id": "/subscriptions/0accec26-d6de-4757-8e74-d080f38eaaab/locations/eastusstg", + "name": "eastusstg", + "displayName": "East US STG", + "regionalDisplayName": "(US) East US STG", + "metadata": { + "regionType": "Physical", + "regionCategory": "Recommended", + "geographyGroup": "US", + "longitude": "-79.8164", + "latitude": "37.3719", + "physicalLocation": "Virginia", + "pairedRegion": [ + { + "name": "southcentralusstg", + "id": "/subscriptions/0accec26-d6de-4757-8e74-d080f38eaaab/locations/southcentralusstg" + } + ] + } + }, + { + "id": "/subscriptions/0accec26-d6de-4757-8e74-d080f38eaaab/locations/southcentralus", + "name": "southcentralus", + "displayName": "South Central US", + "regionalDisplayName": "(US) South Central US", + "metadata": { + "regionType": "Physical", + "regionCategory": "Recommended", + "geographyGroup": "US", + "longitude": "-98.5", + "latitude": "29.4167", + "physicalLocation": "Texas", + "pairedRegion": [ + { + "name": "northcentralus", + "id": "/subscriptions/0accec26-d6de-4757-8e74-d080f38eaaab/locations/northcentralus" + } + ] + } + }, + { + "id": "/subscriptions/0accec26-d6de-4757-8e74-d080f38eaaab/locations/southcentralusstg", + "name": "southcentralusstg", + "displayName": "South Central US STG", + "regionalDisplayName": "(US) South Central US STG", + "metadata": { + "regionType": "Physical", + "regionCategory": "Recommended", + "geographyGroup": "US", + "longitude": "-98.5", + "latitude": "29.4167", + "physicalLocation": "Texas", + "pairedRegion": [ + { + "name": "eastusstg", + "id": "/subscriptions/0accec26-d6de-4757-8e74-d080f38eaaab/locations/eastusstg" + } + ] + } + }, + { + "id": "/subscriptions/0accec26-d6de-4757-8e74-d080f38eaaab/locations/westus2", + "name": "westus2", + "displayName": "West US 2", + "regionalDisplayName": "(US) West US 2", + "metadata": { + "regionType": "Physical", + "regionCategory": "Recommended", + "geographyGroup": "US", + "longitude": "-119.852", + "latitude": "47.233", + "physicalLocation": "Washington", + "pairedRegion": [ + { + "name": "westcentralus", + "id": "/subscriptions/0accec26-d6de-4757-8e74-d080f38eaaab/locations/westcentralus" + } + ] + } + }, + { + "id": "/subscriptions/0accec26-d6de-4757-8e74-d080f38eaaab/locations/australiaeast", + "name": "australiaeast", + "displayName": "Australia East", + "regionalDisplayName": "(Asia Pacific) Australia East", + "metadata": { + "regionType": "Physical", + "regionCategory": "Recommended", + "geographyGroup": "Asia Pacific", + "longitude": "151.2094", + "latitude": "-33.86", + "physicalLocation": "New South Wales", + "pairedRegion": [ + { + "name": "australiasoutheast", + "id": "/subscriptions/0accec26-d6de-4757-8e74-d080f38eaaab/locations/australiasoutheast" + } + ] + } + }, + { + "id": "/subscriptions/0accec26-d6de-4757-8e74-d080f38eaaab/locations/southeastasia", + "name": "southeastasia", + "displayName": "Southeast Asia", + "regionalDisplayName": "(Asia Pacific) Southeast Asia", + "metadata": { + "regionType": "Physical", + "regionCategory": "Recommended", + "geographyGroup": "Asia Pacific", + "longitude": "103.833", + "latitude": "1.283", + "physicalLocation": "Singapore", + "pairedRegion": [ + { + "name": "eastasia", + "id": "/subscriptions/0accec26-d6de-4757-8e74-d080f38eaaab/locations/eastasia" + } + ] + } + }, + { + "id": "/subscriptions/0accec26-d6de-4757-8e74-d080f38eaaab/locations/northeurope", + "name": "northeurope", + "displayName": "North Europe", + "regionalDisplayName": "(Europe) North Europe", + "metadata": { + "regionType": "Physical", + "regionCategory": "Recommended", + "geographyGroup": "Europe", + "longitude": "-6.2597", + "latitude": "53.3478", + "physicalLocation": "Ireland", + "pairedRegion": [ + { + "name": "westeurope", + "id": "/subscriptions/0accec26-d6de-4757-8e74-d080f38eaaab/locations/westeurope" + } + ] + } + }, + { + "id": "/subscriptions/0accec26-d6de-4757-8e74-d080f38eaaab/locations/swedencentral", + "name": "swedencentral", + "displayName": "Sweden Central", + "regionalDisplayName": "(Europe) Sweden Central", + "metadata": { + "regionType": "Physical", + "regionCategory": "Recommended", + "geographyGroup": "Europe", + "longitude": "17.14127", + "latitude": "60.67488", + "physicalLocation": "G\u00E4vle", + "pairedRegion": [ + { + "name": "swedensouth", + "id": "/subscriptions/0accec26-d6de-4757-8e74-d080f38eaaab/locations/swedensouth" + } + ] + } + }, + { + "id": "/subscriptions/0accec26-d6de-4757-8e74-d080f38eaaab/locations/uksouth", + "name": "uksouth", + "displayName": "UK South", + "regionalDisplayName": "(Europe) UK South", + "metadata": { + "regionType": "Physical", + "regionCategory": "Recommended", + "geographyGroup": "Europe", + "longitude": "-0.799", + "latitude": "50.941", + "physicalLocation": "London", + "pairedRegion": [ + { + "name": "ukwest", + "id": "/subscriptions/0accec26-d6de-4757-8e74-d080f38eaaab/locations/ukwest" + } + ] + } + }, + { + "id": "/subscriptions/0accec26-d6de-4757-8e74-d080f38eaaab/locations/westeurope", + "name": "westeurope", + "displayName": "West Europe", + "regionalDisplayName": "(Europe) West Europe", + "metadata": { + "regionType": "Physical", + "regionCategory": "Recommended", + "geographyGroup": "Europe", + "longitude": "4.9", + "latitude": "52.3667", + "physicalLocation": "Netherlands", + "pairedRegion": [ + { + "name": "northeurope", + "id": "/subscriptions/0accec26-d6de-4757-8e74-d080f38eaaab/locations/northeurope" + } + ] + } + }, + { + "id": "/subscriptions/0accec26-d6de-4757-8e74-d080f38eaaab/locations/centralus", + "name": "centralus", + "displayName": "Central US", + "regionalDisplayName": "(US) Central US", + "metadata": { + "regionType": "Physical", + "regionCategory": "Recommended", + "geographyGroup": "US", + "longitude": "-93.6208", + "latitude": "41.5908", + "physicalLocation": "Iowa", + "pairedRegion": [ + { + "name": "eastus2", + "id": "/subscriptions/0accec26-d6de-4757-8e74-d080f38eaaab/locations/eastus2" + } + ] + } + }, + { + "id": "/subscriptions/0accec26-d6de-4757-8e74-d080f38eaaab/locations/northcentralus", + "name": "northcentralus", + "displayName": "North Central US", + "regionalDisplayName": "(US) North Central US", + "metadata": { + "regionType": "Physical", + "regionCategory": "Recommended", + "geographyGroup": "US", + "longitude": "-87.6278", + "latitude": "41.8819", + "physicalLocation": "Illinois", + "pairedRegion": [ + { + "name": "southcentralus", + "id": "/subscriptions/0accec26-d6de-4757-8e74-d080f38eaaab/locations/southcentralus" + } + ] + } + }, + { + "id": "/subscriptions/0accec26-d6de-4757-8e74-d080f38eaaab/locations/westus", + "name": "westus", + "displayName": "West US", + "regionalDisplayName": "(US) West US", + "metadata": { + "regionType": "Physical", + "regionCategory": "Recommended", + "geographyGroup": "US", + "longitude": "-122.417", + "latitude": "37.783", + "physicalLocation": "California", + "pairedRegion": [ + { + "name": "eastus", + "id": "/subscriptions/0accec26-d6de-4757-8e74-d080f38eaaab/locations/eastus" + } + ] + } + }, + { + "id": "/subscriptions/0accec26-d6de-4757-8e74-d080f38eaaab/locations/southafricanorth", + "name": "southafricanorth", + "displayName": "South Africa North", + "regionalDisplayName": "(Africa) South Africa North", + "metadata": { + "regionType": "Physical", + "regionCategory": "Recommended", + "geographyGroup": "Africa", + "longitude": "28.218370", + "latitude": "-25.731340", + "physicalLocation": "Johannesburg", + "pairedRegion": [ + { + "name": "southafricawest", + "id": "/subscriptions/0accec26-d6de-4757-8e74-d080f38eaaab/locations/southafricawest" + } + ] + } + }, + { + "id": "/subscriptions/0accec26-d6de-4757-8e74-d080f38eaaab/locations/centralindia", + "name": "centralindia", + "displayName": "Central India", + "regionalDisplayName": "(Asia Pacific) Central India", + "metadata": { + "regionType": "Physical", + "regionCategory": "Recommended", + "geographyGroup": "Asia Pacific", + "longitude": "73.9197", + "latitude": "18.5822", + "physicalLocation": "Pune", + "pairedRegion": [ + { + "name": "southindia", + "id": "/subscriptions/0accec26-d6de-4757-8e74-d080f38eaaab/locations/southindia" + } + ] + } + }, + { + "id": "/subscriptions/0accec26-d6de-4757-8e74-d080f38eaaab/locations/eastasia", + "name": "eastasia", + "displayName": "East Asia", + "regionalDisplayName": "(Asia Pacific) East Asia", + "metadata": { + "regionType": "Physical", + "regionCategory": "Recommended", + "geographyGroup": "Asia Pacific", + "longitude": "114.188", + "latitude": "22.267", + "physicalLocation": "Hong Kong", + "pairedRegion": [ + { + "name": "southeastasia", + "id": "/subscriptions/0accec26-d6de-4757-8e74-d080f38eaaab/locations/southeastasia" + } + ] + } + }, + { + "id": "/subscriptions/0accec26-d6de-4757-8e74-d080f38eaaab/locations/japaneast", + "name": "japaneast", + "displayName": "Japan East", + "regionalDisplayName": "(Asia Pacific) Japan East", + "metadata": { + "regionType": "Physical", + "regionCategory": "Recommended", + "geographyGroup": "Asia Pacific", + "longitude": "139.77", + "latitude": "35.68", + "physicalLocation": "Tokyo, Saitama", + "pairedRegion": [ + { + "name": "japanwest", + "id": "/subscriptions/0accec26-d6de-4757-8e74-d080f38eaaab/locations/japanwest" + } + ] + } + }, + { + "id": "/subscriptions/0accec26-d6de-4757-8e74-d080f38eaaab/locations/jioindiawest", + "name": "jioindiawest", + "displayName": "Jio India West", + "regionalDisplayName": "(Asia Pacific) Jio India West", + "metadata": { + "regionType": "Physical", + "regionCategory": "Recommended", + "geographyGroup": "Asia Pacific", + "longitude": "70.05773", + "latitude": "22.470701", + "physicalLocation": "Jamnagar", + "pairedRegion": [ + { + "name": "jioindiacentral", + "id": "/subscriptions/0accec26-d6de-4757-8e74-d080f38eaaab/locations/jioindiacentral" + } + ] + } + }, + { + "id": "/subscriptions/0accec26-d6de-4757-8e74-d080f38eaaab/locations/koreacentral", + "name": "koreacentral", + "displayName": "Korea Central", + "regionalDisplayName": "(Asia Pacific) Korea Central", + "metadata": { + "regionType": "Physical", + "regionCategory": "Recommended", + "geographyGroup": "Asia Pacific", + "longitude": "126.9780", + "latitude": "37.5665", + "physicalLocation": "Seoul", + "pairedRegion": [ + { + "name": "koreasouth", + "id": "/subscriptions/0accec26-d6de-4757-8e74-d080f38eaaab/locations/koreasouth" + } + ] + } + }, + { + "id": "/subscriptions/0accec26-d6de-4757-8e74-d080f38eaaab/locations/canadacentral", + "name": "canadacentral", + "displayName": "Canada Central", + "regionalDisplayName": "(Canada) Canada Central", + "metadata": { + "regionType": "Physical", + "regionCategory": "Recommended", + "geographyGroup": "Canada", + "longitude": "-79.383", + "latitude": "43.653", + "physicalLocation": "Toronto", + "pairedRegion": [ + { + "name": "canadaeast", + "id": "/subscriptions/0accec26-d6de-4757-8e74-d080f38eaaab/locations/canadaeast" + } + ] + } + }, + { + "id": "/subscriptions/0accec26-d6de-4757-8e74-d080f38eaaab/locations/francecentral", + "name": "francecentral", + "displayName": "France Central", + "regionalDisplayName": "(Europe) France Central", + "metadata": { + "regionType": "Physical", + "regionCategory": "Recommended", + "geographyGroup": "Europe", + "longitude": "2.3730", + "latitude": "46.3772", + "physicalLocation": "Paris", + "pairedRegion": [ + { + "name": "francesouth", + "id": "/subscriptions/0accec26-d6de-4757-8e74-d080f38eaaab/locations/francesouth" + } + ] + } + }, + { + "id": "/subscriptions/0accec26-d6de-4757-8e74-d080f38eaaab/locations/germanywestcentral", + "name": "germanywestcentral", + "displayName": "Germany West Central", + "regionalDisplayName": "(Europe) Germany West Central", + "metadata": { + "regionType": "Physical", + "regionCategory": "Recommended", + "geographyGroup": "Europe", + "longitude": "8.682127", + "latitude": "50.110924", + "physicalLocation": "Frankfurt", + "pairedRegion": [ + { + "name": "germanynorth", + "id": "/subscriptions/0accec26-d6de-4757-8e74-d080f38eaaab/locations/germanynorth" + } + ] + } + }, + { + "id": "/subscriptions/0accec26-d6de-4757-8e74-d080f38eaaab/locations/norwayeast", + "name": "norwayeast", + "displayName": "Norway East", + "regionalDisplayName": "(Europe) Norway East", + "metadata": { + "regionType": "Physical", + "regionCategory": "Recommended", + "geographyGroup": "Europe", + "longitude": "10.752245", + "latitude": "59.913868", + "physicalLocation": "Norway", + "pairedRegion": [ + { + "name": "norwaywest", + "id": "/subscriptions/0accec26-d6de-4757-8e74-d080f38eaaab/locations/norwaywest" + } + ] + } + }, + { + "id": "/subscriptions/0accec26-d6de-4757-8e74-d080f38eaaab/locations/switzerlandnorth", + "name": "switzerlandnorth", + "displayName": "Switzerland North", + "regionalDisplayName": "(Europe) Switzerland North", + "metadata": { + "regionType": "Physical", + "regionCategory": "Recommended", + "geographyGroup": "Europe", + "longitude": "8.564572", + "latitude": "47.451542", + "physicalLocation": "Zurich", + "pairedRegion": [ + { + "name": "switzerlandwest", + "id": "/subscriptions/0accec26-d6de-4757-8e74-d080f38eaaab/locations/switzerlandwest" + } + ] + } + }, + { + "id": "/subscriptions/0accec26-d6de-4757-8e74-d080f38eaaab/locations/uaenorth", + "name": "uaenorth", + "displayName": "UAE North", + "regionalDisplayName": "(Middle East) UAE North", + "metadata": { + "regionType": "Physical", + "regionCategory": "Recommended", + "geographyGroup": "Middle East", + "longitude": "55.316666", + "latitude": "25.266666", + "physicalLocation": "Dubai", + "pairedRegion": [ + { + "name": "uaecentral", + "id": "/subscriptions/0accec26-d6de-4757-8e74-d080f38eaaab/locations/uaecentral" + } + ] + } + }, + { + "id": "/subscriptions/0accec26-d6de-4757-8e74-d080f38eaaab/locations/brazilsouth", + "name": "brazilsouth", + "displayName": "Brazil South", + "regionalDisplayName": "(South America) Brazil South", + "metadata": { + "regionType": "Physical", + "regionCategory": "Recommended", + "geographyGroup": "South America", + "longitude": "-46.633", + "latitude": "-23.55", + "physicalLocation": "Sao Paulo State", + "pairedRegion": [ + { + "name": "southcentralus", + "id": "/subscriptions/0accec26-d6de-4757-8e74-d080f38eaaab/locations/southcentralus" + } + ] + } + }, + { + "id": "/subscriptions/0accec26-d6de-4757-8e74-d080f38eaaab/locations/centralusstage", + "name": "centralusstage", + "displayName": "Central US (Stage)", + "regionalDisplayName": "(US) Central US (Stage)", + "metadata": { + "regionType": "Logical", + "regionCategory": "Other", + "geographyGroup": "US" + } + }, + { + "id": "/subscriptions/0accec26-d6de-4757-8e74-d080f38eaaab/locations/eastusstage", + "name": "eastusstage", + "displayName": "East US (Stage)", + "regionalDisplayName": "(US) East US (Stage)", + "metadata": { + "regionType": "Logical", + "regionCategory": "Other", + "geographyGroup": "US" + } + }, + { + "id": "/subscriptions/0accec26-d6de-4757-8e74-d080f38eaaab/locations/eastus2stage", + "name": "eastus2stage", + "displayName": "East US 2 (Stage)", + "regionalDisplayName": "(US) East US 2 (Stage)", + "metadata": { + "regionType": "Logical", + "regionCategory": "Other", + "geographyGroup": "US" + } + }, + { + "id": "/subscriptions/0accec26-d6de-4757-8e74-d080f38eaaab/locations/northcentralusstage", + "name": "northcentralusstage", + "displayName": "North Central US (Stage)", + "regionalDisplayName": "(US) North Central US (Stage)", + "metadata": { + "regionType": "Logical", + "regionCategory": "Other", + "geographyGroup": "US" + } + }, + { + "id": "/subscriptions/0accec26-d6de-4757-8e74-d080f38eaaab/locations/southcentralusstage", + "name": "southcentralusstage", + "displayName": "South Central US (Stage)", + "regionalDisplayName": "(US) South Central US (Stage)", + "metadata": { + "regionType": "Logical", + "regionCategory": "Other", + "geographyGroup": "US" + } + }, + { + "id": "/subscriptions/0accec26-d6de-4757-8e74-d080f38eaaab/locations/westusstage", + "name": "westusstage", + "displayName": "West US (Stage)", + "regionalDisplayName": "(US) West US (Stage)", + "metadata": { + "regionType": "Logical", + "regionCategory": "Other", + "geographyGroup": "US" + } + }, + { + "id": "/subscriptions/0accec26-d6de-4757-8e74-d080f38eaaab/locations/westus2stage", + "name": "westus2stage", + "displayName": "West US 2 (Stage)", + "regionalDisplayName": "(US) West US 2 (Stage)", + "metadata": { + "regionType": "Logical", + "regionCategory": "Other", + "geographyGroup": "US" + } + }, + { + "id": "/subscriptions/0accec26-d6de-4757-8e74-d080f38eaaab/locations/asia", + "name": "asia", + "displayName": "Asia", + "regionalDisplayName": "Asia", + "metadata": { + "regionType": "Logical", + "regionCategory": "Other" + } + }, + { + "id": "/subscriptions/0accec26-d6de-4757-8e74-d080f38eaaab/locations/asiapacific", + "name": "asiapacific", + "displayName": "Asia Pacific", + "regionalDisplayName": "Asia Pacific", + "metadata": { + "regionType": "Logical", + "regionCategory": "Other" + } + }, + { + "id": "/subscriptions/0accec26-d6de-4757-8e74-d080f38eaaab/locations/australia", + "name": "australia", + "displayName": "Australia", + "regionalDisplayName": "Australia", + "metadata": { + "regionType": "Logical", + "regionCategory": "Other" + } + }, + { + "id": "/subscriptions/0accec26-d6de-4757-8e74-d080f38eaaab/locations/brazil", + "name": "brazil", + "displayName": "Brazil", + "regionalDisplayName": "Brazil", + "metadata": { + "regionType": "Logical", + "regionCategory": "Other" + } + }, + { + "id": "/subscriptions/0accec26-d6de-4757-8e74-d080f38eaaab/locations/canada", + "name": "canada", + "displayName": "Canada", + "regionalDisplayName": "Canada", + "metadata": { + "regionType": "Logical", + "regionCategory": "Other" + } + }, + { + "id": "/subscriptions/0accec26-d6de-4757-8e74-d080f38eaaab/locations/europe", + "name": "europe", + "displayName": "Europe", + "regionalDisplayName": "Europe", + "metadata": { + "regionType": "Logical", + "regionCategory": "Other" + } + }, + { + "id": "/subscriptions/0accec26-d6de-4757-8e74-d080f38eaaab/locations/global", + "name": "global", + "displayName": "Global", + "regionalDisplayName": "Global", + "metadata": { + "regionType": "Logical", + "regionCategory": "Other" + } + }, + { + "id": "/subscriptions/0accec26-d6de-4757-8e74-d080f38eaaab/locations/india", + "name": "india", + "displayName": "India", + "regionalDisplayName": "India", + "metadata": { + "regionType": "Logical", + "regionCategory": "Other" + } + }, + { + "id": "/subscriptions/0accec26-d6de-4757-8e74-d080f38eaaab/locations/japan", + "name": "japan", + "displayName": "Japan", + "regionalDisplayName": "Japan", + "metadata": { + "regionType": "Logical", + "regionCategory": "Other" + } + }, + { + "id": "/subscriptions/0accec26-d6de-4757-8e74-d080f38eaaab/locations/uk", + "name": "uk", + "displayName": "United Kingdom", + "regionalDisplayName": "United Kingdom", + "metadata": { + "regionType": "Logical", + "regionCategory": "Other" + } + }, + { + "id": "/subscriptions/0accec26-d6de-4757-8e74-d080f38eaaab/locations/unitedstates", + "name": "unitedstates", + "displayName": "United States", + "regionalDisplayName": "United States", + "metadata": { + "regionType": "Logical", + "regionCategory": "Other" + } + }, + { + "id": "/subscriptions/0accec26-d6de-4757-8e74-d080f38eaaab/locations/eastasiastage", + "name": "eastasiastage", + "displayName": "East Asia (Stage)", + "regionalDisplayName": "(Asia Pacific) East Asia (Stage)", + "metadata": { + "regionType": "Logical", + "regionCategory": "Other", + "geographyGroup": "Asia Pacific" + } + }, + { + "id": "/subscriptions/0accec26-d6de-4757-8e74-d080f38eaaab/locations/southeastasiastage", + "name": "southeastasiastage", + "displayName": "Southeast Asia (Stage)", + "regionalDisplayName": "(Asia Pacific) Southeast Asia (Stage)", + "metadata": { + "regionType": "Logical", + "regionCategory": "Other", + "geographyGroup": "Asia Pacific" + } + }, + { + "id": "/subscriptions/0accec26-d6de-4757-8e74-d080f38eaaab/locations/centraluseuap", + "name": "centraluseuap", + "displayName": "Central US EUAP", + "regionalDisplayName": "(US) Central US EUAP", + "metadata": { + "regionType": "Physical", + "regionCategory": "Other", + "geographyGroup": "US", + "longitude": "-93.6208", + "latitude": "41.5908", + "pairedRegion": [ + { + "name": "eastus2euap", + "id": "/subscriptions/0accec26-d6de-4757-8e74-d080f38eaaab/locations/eastus2euap" + } + ] + } + }, + { + "id": "/subscriptions/0accec26-d6de-4757-8e74-d080f38eaaab/locations/eastus2euap", + "name": "eastus2euap", + "displayName": "East US 2 EUAP", + "regionalDisplayName": "(US) East US 2 EUAP", + "metadata": { + "regionType": "Physical", + "regionCategory": "Other", + "geographyGroup": "US", + "longitude": "-78.3889", + "latitude": "36.6681", + "pairedRegion": [ + { + "name": "centraluseuap", + "id": "/subscriptions/0accec26-d6de-4757-8e74-d080f38eaaab/locations/centraluseuap" + } + ] + } + }, + { + "id": "/subscriptions/0accec26-d6de-4757-8e74-d080f38eaaab/locations/westcentralus", + "name": "westcentralus", + "displayName": "West Central US", + "regionalDisplayName": "(US) West Central US", + "metadata": { + "regionType": "Physical", + "regionCategory": "Other", + "geographyGroup": "US", + "longitude": "-110.234", + "latitude": "40.890", + "physicalLocation": "Wyoming", + "pairedRegion": [ + { + "name": "westus2", + "id": "/subscriptions/0accec26-d6de-4757-8e74-d080f38eaaab/locations/westus2" + } + ] + } + }, + { + "id": "/subscriptions/0accec26-d6de-4757-8e74-d080f38eaaab/locations/westus3", + "name": "westus3", + "displayName": "West US 3", + "regionalDisplayName": "(US) West US 3", + "metadata": { + "regionType": "Physical", + "regionCategory": "Other", + "geographyGroup": "US", + "longitude": "-112.074036", + "latitude": "33.448376", + "physicalLocation": "Phoenix", + "pairedRegion": [ + { + "name": "eastus", + "id": "/subscriptions/0accec26-d6de-4757-8e74-d080f38eaaab/locations/eastus" + } + ] + } + }, + { + "id": "/subscriptions/0accec26-d6de-4757-8e74-d080f38eaaab/locations/southafricawest", + "name": "southafricawest", + "displayName": "South Africa West", + "regionalDisplayName": "(Africa) South Africa West", + "metadata": { + "regionType": "Physical", + "regionCategory": "Other", + "geographyGroup": "Africa", + "longitude": "18.843266", + "latitude": "-34.075691", + "physicalLocation": "Cape Town", + "pairedRegion": [ + { + "name": "southafricanorth", + "id": "/subscriptions/0accec26-d6de-4757-8e74-d080f38eaaab/locations/southafricanorth" + } + ] + } + }, + { + "id": "/subscriptions/0accec26-d6de-4757-8e74-d080f38eaaab/locations/australiacentral", + "name": "australiacentral", + "displayName": "Australia Central", + "regionalDisplayName": "(Asia Pacific) Australia Central", + "metadata": { + "regionType": "Physical", + "regionCategory": "Other", + "geographyGroup": "Asia Pacific", + "longitude": "149.1244", + "latitude": "-35.3075", + "physicalLocation": "Canberra", + "pairedRegion": [ + { + "name": "australiacentral", + "id": "/subscriptions/0accec26-d6de-4757-8e74-d080f38eaaab/locations/australiacentral" + } + ] + } + }, + { + "id": "/subscriptions/0accec26-d6de-4757-8e74-d080f38eaaab/locations/australiacentral2", + "name": "australiacentral2", + "displayName": "Australia Central 2", + "regionalDisplayName": "(Asia Pacific) Australia Central 2", + "metadata": { + "regionType": "Physical", + "regionCategory": "Other", + "geographyGroup": "Asia Pacific", + "longitude": "149.1244", + "latitude": "-35.3075", + "physicalLocation": "Canberra", + "pairedRegion": [ + { + "name": "australiacentral2", + "id": "/subscriptions/0accec26-d6de-4757-8e74-d080f38eaaab/locations/australiacentral2" + } + ] + } + }, + { + "id": "/subscriptions/0accec26-d6de-4757-8e74-d080f38eaaab/locations/australiasoutheast", + "name": "australiasoutheast", + "displayName": "Australia Southeast", + "regionalDisplayName": "(Asia Pacific) Australia Southeast", + "metadata": { + "regionType": "Physical", + "regionCategory": "Other", + "geographyGroup": "Asia Pacific", + "longitude": "144.9631", + "latitude": "-37.8136", + "physicalLocation": "Victoria", + "pairedRegion": [ + { + "name": "australiaeast", + "id": "/subscriptions/0accec26-d6de-4757-8e74-d080f38eaaab/locations/australiaeast" + } + ] + } + }, + { + "id": "/subscriptions/0accec26-d6de-4757-8e74-d080f38eaaab/locations/japanwest", + "name": "japanwest", + "displayName": "Japan West", + "regionalDisplayName": "(Asia Pacific) Japan West", + "metadata": { + "regionType": "Physical", + "regionCategory": "Other", + "geographyGroup": "Asia Pacific", + "longitude": "135.5022", + "latitude": "34.6939", + "physicalLocation": "Osaka", + "pairedRegion": [ + { + "name": "japaneast", + "id": "/subscriptions/0accec26-d6de-4757-8e74-d080f38eaaab/locations/japaneast" + } + ] + } + }, + { + "id": "/subscriptions/0accec26-d6de-4757-8e74-d080f38eaaab/locations/jioindiacentral", + "name": "jioindiacentral", + "displayName": "Jio India Central", + "regionalDisplayName": "(Asia Pacific) Jio India Central", + "metadata": { + "regionType": "Physical", + "regionCategory": "Other", + "geographyGroup": "Asia Pacific", + "longitude": "79.08886", + "latitude": "21.146633", + "physicalLocation": "Nagpur", + "pairedRegion": [ + { + "name": "jioindiawest", + "id": "/subscriptions/0accec26-d6de-4757-8e74-d080f38eaaab/locations/jioindiawest" + } + ] + } + }, + { + "id": "/subscriptions/0accec26-d6de-4757-8e74-d080f38eaaab/locations/koreasouth", + "name": "koreasouth", + "displayName": "Korea South", + "regionalDisplayName": "(Asia Pacific) Korea South", + "metadata": { + "regionType": "Physical", + "regionCategory": "Other", + "geographyGroup": "Asia Pacific", + "longitude": "129.0756", + "latitude": "35.1796", + "physicalLocation": "Busan", + "pairedRegion": [ + { + "name": "koreacentral", + "id": "/subscriptions/0accec26-d6de-4757-8e74-d080f38eaaab/locations/koreacentral" + } + ] + } + }, + { + "id": "/subscriptions/0accec26-d6de-4757-8e74-d080f38eaaab/locations/southindia", + "name": "southindia", + "displayName": "South India", + "regionalDisplayName": "(Asia Pacific) South India", + "metadata": { + "regionType": "Physical", + "regionCategory": "Other", + "geographyGroup": "Asia Pacific", + "longitude": "80.1636", + "latitude": "12.9822", + "physicalLocation": "Chennai", + "pairedRegion": [ + { + "name": "centralindia", + "id": "/subscriptions/0accec26-d6de-4757-8e74-d080f38eaaab/locations/centralindia" + } + ] + } + }, + { + "id": "/subscriptions/0accec26-d6de-4757-8e74-d080f38eaaab/locations/westindia", + "name": "westindia", + "displayName": "West India", + "regionalDisplayName": "(Asia Pacific) West India", + "metadata": { + "regionType": "Physical", + "regionCategory": "Other", + "geographyGroup": "Asia Pacific", + "longitude": "72.868", + "latitude": "19.088", + "physicalLocation": "Mumbai", + "pairedRegion": [ + { + "name": "southindia", + "id": "/subscriptions/0accec26-d6de-4757-8e74-d080f38eaaab/locations/southindia" + } + ] + } + }, + { + "id": "/subscriptions/0accec26-d6de-4757-8e74-d080f38eaaab/locations/canadaeast", + "name": "canadaeast", + "displayName": "Canada East", + "regionalDisplayName": "(Canada) Canada East", + "metadata": { + "regionType": "Physical", + "regionCategory": "Other", + "geographyGroup": "Canada", + "longitude": "-71.217", + "latitude": "46.817", + "physicalLocation": "Quebec", + "pairedRegion": [ + { + "name": "canadacentral", + "id": "/subscriptions/0accec26-d6de-4757-8e74-d080f38eaaab/locations/canadacentral" + } + ] + } + }, + { + "id": "/subscriptions/0accec26-d6de-4757-8e74-d080f38eaaab/locations/francesouth", + "name": "francesouth", + "displayName": "France South", + "regionalDisplayName": "(Europe) France South", + "metadata": { + "regionType": "Physical", + "regionCategory": "Other", + "geographyGroup": "Europe", + "longitude": "2.1972", + "latitude": "43.8345", + "physicalLocation": "Marseille", + "pairedRegion": [ + { + "name": "francecentral", + "id": "/subscriptions/0accec26-d6de-4757-8e74-d080f38eaaab/locations/francecentral" + } + ] + } + }, + { + "id": "/subscriptions/0accec26-d6de-4757-8e74-d080f38eaaab/locations/germanynorth", + "name": "germanynorth", + "displayName": "Germany North", + "regionalDisplayName": "(Europe) Germany North", + "metadata": { + "regionType": "Physical", + "regionCategory": "Other", + "geographyGroup": "Europe", + "longitude": "8.806422", + "latitude": "53.073635", + "physicalLocation": "Berlin", + "pairedRegion": [ + { + "name": "germanywestcentral", + "id": "/subscriptions/0accec26-d6de-4757-8e74-d080f38eaaab/locations/germanywestcentral" + } + ] + } + }, + { + "id": "/subscriptions/0accec26-d6de-4757-8e74-d080f38eaaab/locations/norwaywest", + "name": "norwaywest", + "displayName": "Norway West", + "regionalDisplayName": "(Europe) Norway West", + "metadata": { + "regionType": "Physical", + "regionCategory": "Other", + "geographyGroup": "Europe", + "longitude": "5.733107", + "latitude": "58.969975", + "physicalLocation": "Norway", + "pairedRegion": [ + { + "name": "norwayeast", + "id": "/subscriptions/0accec26-d6de-4757-8e74-d080f38eaaab/locations/norwayeast" + } + ] + } + }, + { + "id": "/subscriptions/0accec26-d6de-4757-8e74-d080f38eaaab/locations/swedensouth", + "name": "swedensouth", + "displayName": "Sweden South", + "regionalDisplayName": "(Europe) Sweden South", + "metadata": { + "regionType": "Physical", + "regionCategory": "Other", + "geographyGroup": "Europe", + "longitude": "13.0007", + "latitude": "55.6059", + "physicalLocation": "Malmo", + "pairedRegion": [ + { + "name": "swedencentral", + "id": "/subscriptions/0accec26-d6de-4757-8e74-d080f38eaaab/locations/swedencentral" + } + ] + } + }, + { + "id": "/subscriptions/0accec26-d6de-4757-8e74-d080f38eaaab/locations/switzerlandwest", + "name": "switzerlandwest", + "displayName": "Switzerland West", + "regionalDisplayName": "(Europe) Switzerland West", + "metadata": { + "regionType": "Physical", + "regionCategory": "Other", + "geographyGroup": "Europe", + "longitude": "6.143158", + "latitude": "46.204391", + "physicalLocation": "Geneva", + "pairedRegion": [ + { + "name": "switzerlandnorth", + "id": "/subscriptions/0accec26-d6de-4757-8e74-d080f38eaaab/locations/switzerlandnorth" + } + ] + } + }, + { + "id": "/subscriptions/0accec26-d6de-4757-8e74-d080f38eaaab/locations/ukwest", + "name": "ukwest", + "displayName": "UK West", + "regionalDisplayName": "(Europe) UK West", + "metadata": { + "regionType": "Physical", + "regionCategory": "Other", + "geographyGroup": "Europe", + "longitude": "-3.084", + "latitude": "53.427", + "physicalLocation": "Cardiff", + "pairedRegion": [ + { + "name": "uksouth", + "id": "/subscriptions/0accec26-d6de-4757-8e74-d080f38eaaab/locations/uksouth" + } + ] + } + }, + { + "id": "/subscriptions/0accec26-d6de-4757-8e74-d080f38eaaab/locations/uaecentral", + "name": "uaecentral", + "displayName": "UAE Central", + "regionalDisplayName": "(Middle East) UAE Central", + "metadata": { + "regionType": "Physical", + "regionCategory": "Other", + "geographyGroup": "Middle East", + "longitude": "54.366669", + "latitude": "24.466667", + "physicalLocation": "Abu Dhabi", + "pairedRegion": [ + { + "name": "uaenorth", + "id": "/subscriptions/0accec26-d6de-4757-8e74-d080f38eaaab/locations/uaenorth" + } + ] + } + }, + { + "id": "/subscriptions/0accec26-d6de-4757-8e74-d080f38eaaab/locations/brazilsoutheast", + "name": "brazilsoutheast", + "displayName": "Brazil Southeast", + "regionalDisplayName": "(South America) Brazil Southeast", + "metadata": { + "regionType": "Physical", + "regionCategory": "Other", + "geographyGroup": "South America", + "longitude": "-43.2075", + "latitude": "-22.90278", + "physicalLocation": "Rio", + "pairedRegion": [ + { + "name": "brazilsouth", + "id": "/subscriptions/0accec26-d6de-4757-8e74-d080f38eaaab/locations/brazilsouth" + } + ] + } + }, + { + "id": "/subscriptions/0accec26-d6de-4757-8e74-d080f38eaaab/locations/eastusslv", + "name": "eastusslv", + "displayName": "East US SLV", + "regionalDisplayName": "(South America) East US SLV", + "metadata": { + "regionType": "Physical", + "regionCategory": "Other", + "geographyGroup": "South America", + "longitude": "-43.2075", + "latitude": "-22.90278", + "physicalLocation": "Silverstone", + "pairedRegion": [ + { + "name": "eastusslv", + "id": "/subscriptions/0accec26-d6de-4757-8e74-d080f38eaaab/locations/eastusslv" + } + ] + } + } + ] + } + } + ], + "Variables": { + "RandomSeed": "337699149", + "SUBSCRIPTION_ID": "0accec26-d6de-4757-8e74-d080f38eaaab" + } +} \ No newline at end of file diff --git a/sdk/resourcemanager/Azure.ResourceManager.Core/tests/SessionRecords/SubscriptionOperationsTests/TestListLocationAsync.json b/sdk/resourcemanager/Azure.ResourceManager.Core/tests/SessionRecords/SubscriptionOperationsTests/TestListLocationAsync.json new file mode 100644 index 000000000000..e6e3fab01515 --- /dev/null +++ b/sdk/resourcemanager/Azure.ResourceManager.Core/tests/SessionRecords/SubscriptionOperationsTests/TestListLocationAsync.json @@ -0,0 +1,1314 @@ +{ + "Entries": [ + { + "RequestUri": "https://management.azure.com/subscriptions/0accec26-d6de-4757-8e74-d080f38eaaab?api-version=2019-11-01", + "RequestMethod": "GET", + "RequestHeaders": { + "Accept": "application/json", + "Authorization": "Sanitized", + "User-Agent": [ + "azsdk-net-ResourceManager.Core/1.0.0-alpha.20210507.1", + "(.NET Core 4.6.29916.01; Microsoft Windows 10.0.19043 )" + ], + "x-ms-client-request-id": "412fa7d87e6ab8d9213fe4c9a770e626", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "Cache-Control": "no-cache", + "Content-Length": "403", + "Content-Type": "application/json; charset=utf-8", + "Date": "Fri, 07 May 2021 03:08:36 GMT", + "Expires": "-1", + "Pragma": "no-cache", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains", + "X-Content-Type-Options": "nosniff", + "x-ms-correlation-request-id": "5b9eb629-39f7-4cd1-9c69-e4269cf94db6", + "x-ms-ratelimit-remaining-subscription-reads": "11996", + "x-ms-request-id": "5b9eb629-39f7-4cd1-9c69-e4269cf94db6", + "x-ms-routing-request-id": "SOUTHEASTASIA:20210507T030837Z:5b9eb629-39f7-4cd1-9c69-e4269cf94db6" + }, + "ResponseBody": { + "id": "/subscriptions/0accec26-d6de-4757-8e74-d080f38eaaab", + "authorizationSource": "RoleBased", + "managedByTenants": [], + "subscriptionId": "0accec26-d6de-4757-8e74-d080f38eaaab", + "tenantId": "72f988bf-86f1-41af-91ab-2d7cd011db47", + "displayName": "ACR - TEST - China Team", + "state": "Enabled", + "subscriptionPolicies": { + "locationPlacementId": "Internal_2014-09-01", + "quotaId": "Internal_2014-09-01", + "spendingLimit": "Off" + } + } + }, + { + "RequestUri": "https://management.azure.com/subscriptions/0accec26-d6de-4757-8e74-d080f38eaaab/locations?api-version=2019-11-01", + "RequestMethod": "GET", + "RequestHeaders": { + "Accept": "application/json", + "Authorization": "Sanitized", + "traceparent": "00-90c8d609918ab243aff7a61b48ff57f5-eafed8d0095aef4d-00", + "User-Agent": [ + "azsdk-net-ResourceManager.Core/1.0.0-alpha.20210507.1", + "(.NET Core 4.6.29916.01; Microsoft Windows 10.0.19043 )" + ], + "x-ms-client-request-id": "9be7873f6695b8b38ba5da7282e5edfb", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "Cache-Control": "no-cache", + "Content-Length": "28874", + "Content-Type": "application/json; charset=utf-8", + "Date": "Fri, 07 May 2021 03:08:38 GMT", + "Expires": "-1", + "Pragma": "no-cache", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains", + "X-Content-Type-Options": "nosniff", + "x-ms-correlation-request-id": "7f9af9df-0f2c-4d9e-af44-90644d560c97", + "x-ms-ratelimit-remaining-subscription-reads": "11995", + "x-ms-request-id": "7f9af9df-0f2c-4d9e-af44-90644d560c97", + "x-ms-routing-request-id": "SOUTHEASTASIA:20210507T030839Z:7f9af9df-0f2c-4d9e-af44-90644d560c97" + }, + "ResponseBody": { + "value": [ + { + "id": "/subscriptions/0accec26-d6de-4757-8e74-d080f38eaaab/locations/eastus", + "name": "eastus", + "displayName": "East US", + "regionalDisplayName": "(US) East US", + "metadata": { + "regionType": "Physical", + "regionCategory": "Recommended", + "geographyGroup": "US", + "longitude": "-79.8164", + "latitude": "37.3719", + "physicalLocation": "Virginia", + "pairedRegion": [ + { + "name": "westus", + "id": "/subscriptions/0accec26-d6de-4757-8e74-d080f38eaaab/locations/westus" + } + ] + } + }, + { + "id": "/subscriptions/0accec26-d6de-4757-8e74-d080f38eaaab/locations/eastus2", + "name": "eastus2", + "displayName": "East US 2", + "regionalDisplayName": "(US) East US 2", + "metadata": { + "regionType": "Physical", + "regionCategory": "Recommended", + "geographyGroup": "US", + "longitude": "-78.3889", + "latitude": "36.6681", + "physicalLocation": "Virginia", + "pairedRegion": [ + { + "name": "centralus", + "id": "/subscriptions/0accec26-d6de-4757-8e74-d080f38eaaab/locations/centralus" + } + ] + } + }, + { + "id": "/subscriptions/0accec26-d6de-4757-8e74-d080f38eaaab/locations/eastusstg", + "name": "eastusstg", + "displayName": "East US STG", + "regionalDisplayName": "(US) East US STG", + "metadata": { + "regionType": "Physical", + "regionCategory": "Recommended", + "geographyGroup": "US", + "longitude": "-79.8164", + "latitude": "37.3719", + "physicalLocation": "Virginia", + "pairedRegion": [ + { + "name": "southcentralusstg", + "id": "/subscriptions/0accec26-d6de-4757-8e74-d080f38eaaab/locations/southcentralusstg" + } + ] + } + }, + { + "id": "/subscriptions/0accec26-d6de-4757-8e74-d080f38eaaab/locations/southcentralus", + "name": "southcentralus", + "displayName": "South Central US", + "regionalDisplayName": "(US) South Central US", + "metadata": { + "regionType": "Physical", + "regionCategory": "Recommended", + "geographyGroup": "US", + "longitude": "-98.5", + "latitude": "29.4167", + "physicalLocation": "Texas", + "pairedRegion": [ + { + "name": "northcentralus", + "id": "/subscriptions/0accec26-d6de-4757-8e74-d080f38eaaab/locations/northcentralus" + } + ] + } + }, + { + "id": "/subscriptions/0accec26-d6de-4757-8e74-d080f38eaaab/locations/southcentralusstg", + "name": "southcentralusstg", + "displayName": "South Central US STG", + "regionalDisplayName": "(US) South Central US STG", + "metadata": { + "regionType": "Physical", + "regionCategory": "Recommended", + "geographyGroup": "US", + "longitude": "-98.5", + "latitude": "29.4167", + "physicalLocation": "Texas", + "pairedRegion": [ + { + "name": "eastusstg", + "id": "/subscriptions/0accec26-d6de-4757-8e74-d080f38eaaab/locations/eastusstg" + } + ] + } + }, + { + "id": "/subscriptions/0accec26-d6de-4757-8e74-d080f38eaaab/locations/westus2", + "name": "westus2", + "displayName": "West US 2", + "regionalDisplayName": "(US) West US 2", + "metadata": { + "regionType": "Physical", + "regionCategory": "Recommended", + "geographyGroup": "US", + "longitude": "-119.852", + "latitude": "47.233", + "physicalLocation": "Washington", + "pairedRegion": [ + { + "name": "westcentralus", + "id": "/subscriptions/0accec26-d6de-4757-8e74-d080f38eaaab/locations/westcentralus" + } + ] + } + }, + { + "id": "/subscriptions/0accec26-d6de-4757-8e74-d080f38eaaab/locations/australiaeast", + "name": "australiaeast", + "displayName": "Australia East", + "regionalDisplayName": "(Asia Pacific) Australia East", + "metadata": { + "regionType": "Physical", + "regionCategory": "Recommended", + "geographyGroup": "Asia Pacific", + "longitude": "151.2094", + "latitude": "-33.86", + "physicalLocation": "New South Wales", + "pairedRegion": [ + { + "name": "australiasoutheast", + "id": "/subscriptions/0accec26-d6de-4757-8e74-d080f38eaaab/locations/australiasoutheast" + } + ] + } + }, + { + "id": "/subscriptions/0accec26-d6de-4757-8e74-d080f38eaaab/locations/southeastasia", + "name": "southeastasia", + "displayName": "Southeast Asia", + "regionalDisplayName": "(Asia Pacific) Southeast Asia", + "metadata": { + "regionType": "Physical", + "regionCategory": "Recommended", + "geographyGroup": "Asia Pacific", + "longitude": "103.833", + "latitude": "1.283", + "physicalLocation": "Singapore", + "pairedRegion": [ + { + "name": "eastasia", + "id": "/subscriptions/0accec26-d6de-4757-8e74-d080f38eaaab/locations/eastasia" + } + ] + } + }, + { + "id": "/subscriptions/0accec26-d6de-4757-8e74-d080f38eaaab/locations/northeurope", + "name": "northeurope", + "displayName": "North Europe", + "regionalDisplayName": "(Europe) North Europe", + "metadata": { + "regionType": "Physical", + "regionCategory": "Recommended", + "geographyGroup": "Europe", + "longitude": "-6.2597", + "latitude": "53.3478", + "physicalLocation": "Ireland", + "pairedRegion": [ + { + "name": "westeurope", + "id": "/subscriptions/0accec26-d6de-4757-8e74-d080f38eaaab/locations/westeurope" + } + ] + } + }, + { + "id": "/subscriptions/0accec26-d6de-4757-8e74-d080f38eaaab/locations/swedencentral", + "name": "swedencentral", + "displayName": "Sweden Central", + "regionalDisplayName": "(Europe) Sweden Central", + "metadata": { + "regionType": "Physical", + "regionCategory": "Recommended", + "geographyGroup": "Europe", + "longitude": "17.14127", + "latitude": "60.67488", + "physicalLocation": "G\u00E4vle", + "pairedRegion": [ + { + "name": "swedensouth", + "id": "/subscriptions/0accec26-d6de-4757-8e74-d080f38eaaab/locations/swedensouth" + } + ] + } + }, + { + "id": "/subscriptions/0accec26-d6de-4757-8e74-d080f38eaaab/locations/uksouth", + "name": "uksouth", + "displayName": "UK South", + "regionalDisplayName": "(Europe) UK South", + "metadata": { + "regionType": "Physical", + "regionCategory": "Recommended", + "geographyGroup": "Europe", + "longitude": "-0.799", + "latitude": "50.941", + "physicalLocation": "London", + "pairedRegion": [ + { + "name": "ukwest", + "id": "/subscriptions/0accec26-d6de-4757-8e74-d080f38eaaab/locations/ukwest" + } + ] + } + }, + { + "id": "/subscriptions/0accec26-d6de-4757-8e74-d080f38eaaab/locations/westeurope", + "name": "westeurope", + "displayName": "West Europe", + "regionalDisplayName": "(Europe) West Europe", + "metadata": { + "regionType": "Physical", + "regionCategory": "Recommended", + "geographyGroup": "Europe", + "longitude": "4.9", + "latitude": "52.3667", + "physicalLocation": "Netherlands", + "pairedRegion": [ + { + "name": "northeurope", + "id": "/subscriptions/0accec26-d6de-4757-8e74-d080f38eaaab/locations/northeurope" + } + ] + } + }, + { + "id": "/subscriptions/0accec26-d6de-4757-8e74-d080f38eaaab/locations/centralus", + "name": "centralus", + "displayName": "Central US", + "regionalDisplayName": "(US) Central US", + "metadata": { + "regionType": "Physical", + "regionCategory": "Recommended", + "geographyGroup": "US", + "longitude": "-93.6208", + "latitude": "41.5908", + "physicalLocation": "Iowa", + "pairedRegion": [ + { + "name": "eastus2", + "id": "/subscriptions/0accec26-d6de-4757-8e74-d080f38eaaab/locations/eastus2" + } + ] + } + }, + { + "id": "/subscriptions/0accec26-d6de-4757-8e74-d080f38eaaab/locations/northcentralus", + "name": "northcentralus", + "displayName": "North Central US", + "regionalDisplayName": "(US) North Central US", + "metadata": { + "regionType": "Physical", + "regionCategory": "Recommended", + "geographyGroup": "US", + "longitude": "-87.6278", + "latitude": "41.8819", + "physicalLocation": "Illinois", + "pairedRegion": [ + { + "name": "southcentralus", + "id": "/subscriptions/0accec26-d6de-4757-8e74-d080f38eaaab/locations/southcentralus" + } + ] + } + }, + { + "id": "/subscriptions/0accec26-d6de-4757-8e74-d080f38eaaab/locations/westus", + "name": "westus", + "displayName": "West US", + "regionalDisplayName": "(US) West US", + "metadata": { + "regionType": "Physical", + "regionCategory": "Recommended", + "geographyGroup": "US", + "longitude": "-122.417", + "latitude": "37.783", + "physicalLocation": "California", + "pairedRegion": [ + { + "name": "eastus", + "id": "/subscriptions/0accec26-d6de-4757-8e74-d080f38eaaab/locations/eastus" + } + ] + } + }, + { + "id": "/subscriptions/0accec26-d6de-4757-8e74-d080f38eaaab/locations/southafricanorth", + "name": "southafricanorth", + "displayName": "South Africa North", + "regionalDisplayName": "(Africa) South Africa North", + "metadata": { + "regionType": "Physical", + "regionCategory": "Recommended", + "geographyGroup": "Africa", + "longitude": "28.218370", + "latitude": "-25.731340", + "physicalLocation": "Johannesburg", + "pairedRegion": [ + { + "name": "southafricawest", + "id": "/subscriptions/0accec26-d6de-4757-8e74-d080f38eaaab/locations/southafricawest" + } + ] + } + }, + { + "id": "/subscriptions/0accec26-d6de-4757-8e74-d080f38eaaab/locations/centralindia", + "name": "centralindia", + "displayName": "Central India", + "regionalDisplayName": "(Asia Pacific) Central India", + "metadata": { + "regionType": "Physical", + "regionCategory": "Recommended", + "geographyGroup": "Asia Pacific", + "longitude": "73.9197", + "latitude": "18.5822", + "physicalLocation": "Pune", + "pairedRegion": [ + { + "name": "southindia", + "id": "/subscriptions/0accec26-d6de-4757-8e74-d080f38eaaab/locations/southindia" + } + ] + } + }, + { + "id": "/subscriptions/0accec26-d6de-4757-8e74-d080f38eaaab/locations/eastasia", + "name": "eastasia", + "displayName": "East Asia", + "regionalDisplayName": "(Asia Pacific) East Asia", + "metadata": { + "regionType": "Physical", + "regionCategory": "Recommended", + "geographyGroup": "Asia Pacific", + "longitude": "114.188", + "latitude": "22.267", + "physicalLocation": "Hong Kong", + "pairedRegion": [ + { + "name": "southeastasia", + "id": "/subscriptions/0accec26-d6de-4757-8e74-d080f38eaaab/locations/southeastasia" + } + ] + } + }, + { + "id": "/subscriptions/0accec26-d6de-4757-8e74-d080f38eaaab/locations/japaneast", + "name": "japaneast", + "displayName": "Japan East", + "regionalDisplayName": "(Asia Pacific) Japan East", + "metadata": { + "regionType": "Physical", + "regionCategory": "Recommended", + "geographyGroup": "Asia Pacific", + "longitude": "139.77", + "latitude": "35.68", + "physicalLocation": "Tokyo, Saitama", + "pairedRegion": [ + { + "name": "japanwest", + "id": "/subscriptions/0accec26-d6de-4757-8e74-d080f38eaaab/locations/japanwest" + } + ] + } + }, + { + "id": "/subscriptions/0accec26-d6de-4757-8e74-d080f38eaaab/locations/jioindiawest", + "name": "jioindiawest", + "displayName": "Jio India West", + "regionalDisplayName": "(Asia Pacific) Jio India West", + "metadata": { + "regionType": "Physical", + "regionCategory": "Recommended", + "geographyGroup": "Asia Pacific", + "longitude": "70.05773", + "latitude": "22.470701", + "physicalLocation": "Jamnagar", + "pairedRegion": [ + { + "name": "jioindiacentral", + "id": "/subscriptions/0accec26-d6de-4757-8e74-d080f38eaaab/locations/jioindiacentral" + } + ] + } + }, + { + "id": "/subscriptions/0accec26-d6de-4757-8e74-d080f38eaaab/locations/koreacentral", + "name": "koreacentral", + "displayName": "Korea Central", + "regionalDisplayName": "(Asia Pacific) Korea Central", + "metadata": { + "regionType": "Physical", + "regionCategory": "Recommended", + "geographyGroup": "Asia Pacific", + "longitude": "126.9780", + "latitude": "37.5665", + "physicalLocation": "Seoul", + "pairedRegion": [ + { + "name": "koreasouth", + "id": "/subscriptions/0accec26-d6de-4757-8e74-d080f38eaaab/locations/koreasouth" + } + ] + } + }, + { + "id": "/subscriptions/0accec26-d6de-4757-8e74-d080f38eaaab/locations/canadacentral", + "name": "canadacentral", + "displayName": "Canada Central", + "regionalDisplayName": "(Canada) Canada Central", + "metadata": { + "regionType": "Physical", + "regionCategory": "Recommended", + "geographyGroup": "Canada", + "longitude": "-79.383", + "latitude": "43.653", + "physicalLocation": "Toronto", + "pairedRegion": [ + { + "name": "canadaeast", + "id": "/subscriptions/0accec26-d6de-4757-8e74-d080f38eaaab/locations/canadaeast" + } + ] + } + }, + { + "id": "/subscriptions/0accec26-d6de-4757-8e74-d080f38eaaab/locations/francecentral", + "name": "francecentral", + "displayName": "France Central", + "regionalDisplayName": "(Europe) France Central", + "metadata": { + "regionType": "Physical", + "regionCategory": "Recommended", + "geographyGroup": "Europe", + "longitude": "2.3730", + "latitude": "46.3772", + "physicalLocation": "Paris", + "pairedRegion": [ + { + "name": "francesouth", + "id": "/subscriptions/0accec26-d6de-4757-8e74-d080f38eaaab/locations/francesouth" + } + ] + } + }, + { + "id": "/subscriptions/0accec26-d6de-4757-8e74-d080f38eaaab/locations/germanywestcentral", + "name": "germanywestcentral", + "displayName": "Germany West Central", + "regionalDisplayName": "(Europe) Germany West Central", + "metadata": { + "regionType": "Physical", + "regionCategory": "Recommended", + "geographyGroup": "Europe", + "longitude": "8.682127", + "latitude": "50.110924", + "physicalLocation": "Frankfurt", + "pairedRegion": [ + { + "name": "germanynorth", + "id": "/subscriptions/0accec26-d6de-4757-8e74-d080f38eaaab/locations/germanynorth" + } + ] + } + }, + { + "id": "/subscriptions/0accec26-d6de-4757-8e74-d080f38eaaab/locations/norwayeast", + "name": "norwayeast", + "displayName": "Norway East", + "regionalDisplayName": "(Europe) Norway East", + "metadata": { + "regionType": "Physical", + "regionCategory": "Recommended", + "geographyGroup": "Europe", + "longitude": "10.752245", + "latitude": "59.913868", + "physicalLocation": "Norway", + "pairedRegion": [ + { + "name": "norwaywest", + "id": "/subscriptions/0accec26-d6de-4757-8e74-d080f38eaaab/locations/norwaywest" + } + ] + } + }, + { + "id": "/subscriptions/0accec26-d6de-4757-8e74-d080f38eaaab/locations/switzerlandnorth", + "name": "switzerlandnorth", + "displayName": "Switzerland North", + "regionalDisplayName": "(Europe) Switzerland North", + "metadata": { + "regionType": "Physical", + "regionCategory": "Recommended", + "geographyGroup": "Europe", + "longitude": "8.564572", + "latitude": "47.451542", + "physicalLocation": "Zurich", + "pairedRegion": [ + { + "name": "switzerlandwest", + "id": "/subscriptions/0accec26-d6de-4757-8e74-d080f38eaaab/locations/switzerlandwest" + } + ] + } + }, + { + "id": "/subscriptions/0accec26-d6de-4757-8e74-d080f38eaaab/locations/uaenorth", + "name": "uaenorth", + "displayName": "UAE North", + "regionalDisplayName": "(Middle East) UAE North", + "metadata": { + "regionType": "Physical", + "regionCategory": "Recommended", + "geographyGroup": "Middle East", + "longitude": "55.316666", + "latitude": "25.266666", + "physicalLocation": "Dubai", + "pairedRegion": [ + { + "name": "uaecentral", + "id": "/subscriptions/0accec26-d6de-4757-8e74-d080f38eaaab/locations/uaecentral" + } + ] + } + }, + { + "id": "/subscriptions/0accec26-d6de-4757-8e74-d080f38eaaab/locations/brazilsouth", + "name": "brazilsouth", + "displayName": "Brazil South", + "regionalDisplayName": "(South America) Brazil South", + "metadata": { + "regionType": "Physical", + "regionCategory": "Recommended", + "geographyGroup": "South America", + "longitude": "-46.633", + "latitude": "-23.55", + "physicalLocation": "Sao Paulo State", + "pairedRegion": [ + { + "name": "southcentralus", + "id": "/subscriptions/0accec26-d6de-4757-8e74-d080f38eaaab/locations/southcentralus" + } + ] + } + }, + { + "id": "/subscriptions/0accec26-d6de-4757-8e74-d080f38eaaab/locations/centralusstage", + "name": "centralusstage", + "displayName": "Central US (Stage)", + "regionalDisplayName": "(US) Central US (Stage)", + "metadata": { + "regionType": "Logical", + "regionCategory": "Other", + "geographyGroup": "US" + } + }, + { + "id": "/subscriptions/0accec26-d6de-4757-8e74-d080f38eaaab/locations/eastusstage", + "name": "eastusstage", + "displayName": "East US (Stage)", + "regionalDisplayName": "(US) East US (Stage)", + "metadata": { + "regionType": "Logical", + "regionCategory": "Other", + "geographyGroup": "US" + } + }, + { + "id": "/subscriptions/0accec26-d6de-4757-8e74-d080f38eaaab/locations/eastus2stage", + "name": "eastus2stage", + "displayName": "East US 2 (Stage)", + "regionalDisplayName": "(US) East US 2 (Stage)", + "metadata": { + "regionType": "Logical", + "regionCategory": "Other", + "geographyGroup": "US" + } + }, + { + "id": "/subscriptions/0accec26-d6de-4757-8e74-d080f38eaaab/locations/northcentralusstage", + "name": "northcentralusstage", + "displayName": "North Central US (Stage)", + "regionalDisplayName": "(US) North Central US (Stage)", + "metadata": { + "regionType": "Logical", + "regionCategory": "Other", + "geographyGroup": "US" + } + }, + { + "id": "/subscriptions/0accec26-d6de-4757-8e74-d080f38eaaab/locations/southcentralusstage", + "name": "southcentralusstage", + "displayName": "South Central US (Stage)", + "regionalDisplayName": "(US) South Central US (Stage)", + "metadata": { + "regionType": "Logical", + "regionCategory": "Other", + "geographyGroup": "US" + } + }, + { + "id": "/subscriptions/0accec26-d6de-4757-8e74-d080f38eaaab/locations/westusstage", + "name": "westusstage", + "displayName": "West US (Stage)", + "regionalDisplayName": "(US) West US (Stage)", + "metadata": { + "regionType": "Logical", + "regionCategory": "Other", + "geographyGroup": "US" + } + }, + { + "id": "/subscriptions/0accec26-d6de-4757-8e74-d080f38eaaab/locations/westus2stage", + "name": "westus2stage", + "displayName": "West US 2 (Stage)", + "regionalDisplayName": "(US) West US 2 (Stage)", + "metadata": { + "regionType": "Logical", + "regionCategory": "Other", + "geographyGroup": "US" + } + }, + { + "id": "/subscriptions/0accec26-d6de-4757-8e74-d080f38eaaab/locations/asia", + "name": "asia", + "displayName": "Asia", + "regionalDisplayName": "Asia", + "metadata": { + "regionType": "Logical", + "regionCategory": "Other" + } + }, + { + "id": "/subscriptions/0accec26-d6de-4757-8e74-d080f38eaaab/locations/asiapacific", + "name": "asiapacific", + "displayName": "Asia Pacific", + "regionalDisplayName": "Asia Pacific", + "metadata": { + "regionType": "Logical", + "regionCategory": "Other" + } + }, + { + "id": "/subscriptions/0accec26-d6de-4757-8e74-d080f38eaaab/locations/australia", + "name": "australia", + "displayName": "Australia", + "regionalDisplayName": "Australia", + "metadata": { + "regionType": "Logical", + "regionCategory": "Other" + } + }, + { + "id": "/subscriptions/0accec26-d6de-4757-8e74-d080f38eaaab/locations/brazil", + "name": "brazil", + "displayName": "Brazil", + "regionalDisplayName": "Brazil", + "metadata": { + "regionType": "Logical", + "regionCategory": "Other" + } + }, + { + "id": "/subscriptions/0accec26-d6de-4757-8e74-d080f38eaaab/locations/canada", + "name": "canada", + "displayName": "Canada", + "regionalDisplayName": "Canada", + "metadata": { + "regionType": "Logical", + "regionCategory": "Other" + } + }, + { + "id": "/subscriptions/0accec26-d6de-4757-8e74-d080f38eaaab/locations/europe", + "name": "europe", + "displayName": "Europe", + "regionalDisplayName": "Europe", + "metadata": { + "regionType": "Logical", + "regionCategory": "Other" + } + }, + { + "id": "/subscriptions/0accec26-d6de-4757-8e74-d080f38eaaab/locations/global", + "name": "global", + "displayName": "Global", + "regionalDisplayName": "Global", + "metadata": { + "regionType": "Logical", + "regionCategory": "Other" + } + }, + { + "id": "/subscriptions/0accec26-d6de-4757-8e74-d080f38eaaab/locations/india", + "name": "india", + "displayName": "India", + "regionalDisplayName": "India", + "metadata": { + "regionType": "Logical", + "regionCategory": "Other" + } + }, + { + "id": "/subscriptions/0accec26-d6de-4757-8e74-d080f38eaaab/locations/japan", + "name": "japan", + "displayName": "Japan", + "regionalDisplayName": "Japan", + "metadata": { + "regionType": "Logical", + "regionCategory": "Other" + } + }, + { + "id": "/subscriptions/0accec26-d6de-4757-8e74-d080f38eaaab/locations/uk", + "name": "uk", + "displayName": "United Kingdom", + "regionalDisplayName": "United Kingdom", + "metadata": { + "regionType": "Logical", + "regionCategory": "Other" + } + }, + { + "id": "/subscriptions/0accec26-d6de-4757-8e74-d080f38eaaab/locations/unitedstates", + "name": "unitedstates", + "displayName": "United States", + "regionalDisplayName": "United States", + "metadata": { + "regionType": "Logical", + "regionCategory": "Other" + } + }, + { + "id": "/subscriptions/0accec26-d6de-4757-8e74-d080f38eaaab/locations/eastasiastage", + "name": "eastasiastage", + "displayName": "East Asia (Stage)", + "regionalDisplayName": "(Asia Pacific) East Asia (Stage)", + "metadata": { + "regionType": "Logical", + "regionCategory": "Other", + "geographyGroup": "Asia Pacific" + } + }, + { + "id": "/subscriptions/0accec26-d6de-4757-8e74-d080f38eaaab/locations/southeastasiastage", + "name": "southeastasiastage", + "displayName": "Southeast Asia (Stage)", + "regionalDisplayName": "(Asia Pacific) Southeast Asia (Stage)", + "metadata": { + "regionType": "Logical", + "regionCategory": "Other", + "geographyGroup": "Asia Pacific" + } + }, + { + "id": "/subscriptions/0accec26-d6de-4757-8e74-d080f38eaaab/locations/centraluseuap", + "name": "centraluseuap", + "displayName": "Central US EUAP", + "regionalDisplayName": "(US) Central US EUAP", + "metadata": { + "regionType": "Physical", + "regionCategory": "Other", + "geographyGroup": "US", + "longitude": "-93.6208", + "latitude": "41.5908", + "pairedRegion": [ + { + "name": "eastus2euap", + "id": "/subscriptions/0accec26-d6de-4757-8e74-d080f38eaaab/locations/eastus2euap" + } + ] + } + }, + { + "id": "/subscriptions/0accec26-d6de-4757-8e74-d080f38eaaab/locations/eastus2euap", + "name": "eastus2euap", + "displayName": "East US 2 EUAP", + "regionalDisplayName": "(US) East US 2 EUAP", + "metadata": { + "regionType": "Physical", + "regionCategory": "Other", + "geographyGroup": "US", + "longitude": "-78.3889", + "latitude": "36.6681", + "pairedRegion": [ + { + "name": "centraluseuap", + "id": "/subscriptions/0accec26-d6de-4757-8e74-d080f38eaaab/locations/centraluseuap" + } + ] + } + }, + { + "id": "/subscriptions/0accec26-d6de-4757-8e74-d080f38eaaab/locations/westcentralus", + "name": "westcentralus", + "displayName": "West Central US", + "regionalDisplayName": "(US) West Central US", + "metadata": { + "regionType": "Physical", + "regionCategory": "Other", + "geographyGroup": "US", + "longitude": "-110.234", + "latitude": "40.890", + "physicalLocation": "Wyoming", + "pairedRegion": [ + { + "name": "westus2", + "id": "/subscriptions/0accec26-d6de-4757-8e74-d080f38eaaab/locations/westus2" + } + ] + } + }, + { + "id": "/subscriptions/0accec26-d6de-4757-8e74-d080f38eaaab/locations/westus3", + "name": "westus3", + "displayName": "West US 3", + "regionalDisplayName": "(US) West US 3", + "metadata": { + "regionType": "Physical", + "regionCategory": "Other", + "geographyGroup": "US", + "longitude": "-112.074036", + "latitude": "33.448376", + "physicalLocation": "Phoenix", + "pairedRegion": [ + { + "name": "eastus", + "id": "/subscriptions/0accec26-d6de-4757-8e74-d080f38eaaab/locations/eastus" + } + ] + } + }, + { + "id": "/subscriptions/0accec26-d6de-4757-8e74-d080f38eaaab/locations/southafricawest", + "name": "southafricawest", + "displayName": "South Africa West", + "regionalDisplayName": "(Africa) South Africa West", + "metadata": { + "regionType": "Physical", + "regionCategory": "Other", + "geographyGroup": "Africa", + "longitude": "18.843266", + "latitude": "-34.075691", + "physicalLocation": "Cape Town", + "pairedRegion": [ + { + "name": "southafricanorth", + "id": "/subscriptions/0accec26-d6de-4757-8e74-d080f38eaaab/locations/southafricanorth" + } + ] + } + }, + { + "id": "/subscriptions/0accec26-d6de-4757-8e74-d080f38eaaab/locations/australiacentral", + "name": "australiacentral", + "displayName": "Australia Central", + "regionalDisplayName": "(Asia Pacific) Australia Central", + "metadata": { + "regionType": "Physical", + "regionCategory": "Other", + "geographyGroup": "Asia Pacific", + "longitude": "149.1244", + "latitude": "-35.3075", + "physicalLocation": "Canberra", + "pairedRegion": [ + { + "name": "australiacentral", + "id": "/subscriptions/0accec26-d6de-4757-8e74-d080f38eaaab/locations/australiacentral" + } + ] + } + }, + { + "id": "/subscriptions/0accec26-d6de-4757-8e74-d080f38eaaab/locations/australiacentral2", + "name": "australiacentral2", + "displayName": "Australia Central 2", + "regionalDisplayName": "(Asia Pacific) Australia Central 2", + "metadata": { + "regionType": "Physical", + "regionCategory": "Other", + "geographyGroup": "Asia Pacific", + "longitude": "149.1244", + "latitude": "-35.3075", + "physicalLocation": "Canberra", + "pairedRegion": [ + { + "name": "australiacentral2", + "id": "/subscriptions/0accec26-d6de-4757-8e74-d080f38eaaab/locations/australiacentral2" + } + ] + } + }, + { + "id": "/subscriptions/0accec26-d6de-4757-8e74-d080f38eaaab/locations/australiasoutheast", + "name": "australiasoutheast", + "displayName": "Australia Southeast", + "regionalDisplayName": "(Asia Pacific) Australia Southeast", + "metadata": { + "regionType": "Physical", + "regionCategory": "Other", + "geographyGroup": "Asia Pacific", + "longitude": "144.9631", + "latitude": "-37.8136", + "physicalLocation": "Victoria", + "pairedRegion": [ + { + "name": "australiaeast", + "id": "/subscriptions/0accec26-d6de-4757-8e74-d080f38eaaab/locations/australiaeast" + } + ] + } + }, + { + "id": "/subscriptions/0accec26-d6de-4757-8e74-d080f38eaaab/locations/japanwest", + "name": "japanwest", + "displayName": "Japan West", + "regionalDisplayName": "(Asia Pacific) Japan West", + "metadata": { + "regionType": "Physical", + "regionCategory": "Other", + "geographyGroup": "Asia Pacific", + "longitude": "135.5022", + "latitude": "34.6939", + "physicalLocation": "Osaka", + "pairedRegion": [ + { + "name": "japaneast", + "id": "/subscriptions/0accec26-d6de-4757-8e74-d080f38eaaab/locations/japaneast" + } + ] + } + }, + { + "id": "/subscriptions/0accec26-d6de-4757-8e74-d080f38eaaab/locations/jioindiacentral", + "name": "jioindiacentral", + "displayName": "Jio India Central", + "regionalDisplayName": "(Asia Pacific) Jio India Central", + "metadata": { + "regionType": "Physical", + "regionCategory": "Other", + "geographyGroup": "Asia Pacific", + "longitude": "79.08886", + "latitude": "21.146633", + "physicalLocation": "Nagpur", + "pairedRegion": [ + { + "name": "jioindiawest", + "id": "/subscriptions/0accec26-d6de-4757-8e74-d080f38eaaab/locations/jioindiawest" + } + ] + } + }, + { + "id": "/subscriptions/0accec26-d6de-4757-8e74-d080f38eaaab/locations/koreasouth", + "name": "koreasouth", + "displayName": "Korea South", + "regionalDisplayName": "(Asia Pacific) Korea South", + "metadata": { + "regionType": "Physical", + "regionCategory": "Other", + "geographyGroup": "Asia Pacific", + "longitude": "129.0756", + "latitude": "35.1796", + "physicalLocation": "Busan", + "pairedRegion": [ + { + "name": "koreacentral", + "id": "/subscriptions/0accec26-d6de-4757-8e74-d080f38eaaab/locations/koreacentral" + } + ] + } + }, + { + "id": "/subscriptions/0accec26-d6de-4757-8e74-d080f38eaaab/locations/southindia", + "name": "southindia", + "displayName": "South India", + "regionalDisplayName": "(Asia Pacific) South India", + "metadata": { + "regionType": "Physical", + "regionCategory": "Other", + "geographyGroup": "Asia Pacific", + "longitude": "80.1636", + "latitude": "12.9822", + "physicalLocation": "Chennai", + "pairedRegion": [ + { + "name": "centralindia", + "id": "/subscriptions/0accec26-d6de-4757-8e74-d080f38eaaab/locations/centralindia" + } + ] + } + }, + { + "id": "/subscriptions/0accec26-d6de-4757-8e74-d080f38eaaab/locations/westindia", + "name": "westindia", + "displayName": "West India", + "regionalDisplayName": "(Asia Pacific) West India", + "metadata": { + "regionType": "Physical", + "regionCategory": "Other", + "geographyGroup": "Asia Pacific", + "longitude": "72.868", + "latitude": "19.088", + "physicalLocation": "Mumbai", + "pairedRegion": [ + { + "name": "southindia", + "id": "/subscriptions/0accec26-d6de-4757-8e74-d080f38eaaab/locations/southindia" + } + ] + } + }, + { + "id": "/subscriptions/0accec26-d6de-4757-8e74-d080f38eaaab/locations/canadaeast", + "name": "canadaeast", + "displayName": "Canada East", + "regionalDisplayName": "(Canada) Canada East", + "metadata": { + "regionType": "Physical", + "regionCategory": "Other", + "geographyGroup": "Canada", + "longitude": "-71.217", + "latitude": "46.817", + "physicalLocation": "Quebec", + "pairedRegion": [ + { + "name": "canadacentral", + "id": "/subscriptions/0accec26-d6de-4757-8e74-d080f38eaaab/locations/canadacentral" + } + ] + } + }, + { + "id": "/subscriptions/0accec26-d6de-4757-8e74-d080f38eaaab/locations/francesouth", + "name": "francesouth", + "displayName": "France South", + "regionalDisplayName": "(Europe) France South", + "metadata": { + "regionType": "Physical", + "regionCategory": "Other", + "geographyGroup": "Europe", + "longitude": "2.1972", + "latitude": "43.8345", + "physicalLocation": "Marseille", + "pairedRegion": [ + { + "name": "francecentral", + "id": "/subscriptions/0accec26-d6de-4757-8e74-d080f38eaaab/locations/francecentral" + } + ] + } + }, + { + "id": "/subscriptions/0accec26-d6de-4757-8e74-d080f38eaaab/locations/germanynorth", + "name": "germanynorth", + "displayName": "Germany North", + "regionalDisplayName": "(Europe) Germany North", + "metadata": { + "regionType": "Physical", + "regionCategory": "Other", + "geographyGroup": "Europe", + "longitude": "8.806422", + "latitude": "53.073635", + "physicalLocation": "Berlin", + "pairedRegion": [ + { + "name": "germanywestcentral", + "id": "/subscriptions/0accec26-d6de-4757-8e74-d080f38eaaab/locations/germanywestcentral" + } + ] + } + }, + { + "id": "/subscriptions/0accec26-d6de-4757-8e74-d080f38eaaab/locations/norwaywest", + "name": "norwaywest", + "displayName": "Norway West", + "regionalDisplayName": "(Europe) Norway West", + "metadata": { + "regionType": "Physical", + "regionCategory": "Other", + "geographyGroup": "Europe", + "longitude": "5.733107", + "latitude": "58.969975", + "physicalLocation": "Norway", + "pairedRegion": [ + { + "name": "norwayeast", + "id": "/subscriptions/0accec26-d6de-4757-8e74-d080f38eaaab/locations/norwayeast" + } + ] + } + }, + { + "id": "/subscriptions/0accec26-d6de-4757-8e74-d080f38eaaab/locations/swedensouth", + "name": "swedensouth", + "displayName": "Sweden South", + "regionalDisplayName": "(Europe) Sweden South", + "metadata": { + "regionType": "Physical", + "regionCategory": "Other", + "geographyGroup": "Europe", + "longitude": "13.0007", + "latitude": "55.6059", + "physicalLocation": "Malmo", + "pairedRegion": [ + { + "name": "swedencentral", + "id": "/subscriptions/0accec26-d6de-4757-8e74-d080f38eaaab/locations/swedencentral" + } + ] + } + }, + { + "id": "/subscriptions/0accec26-d6de-4757-8e74-d080f38eaaab/locations/switzerlandwest", + "name": "switzerlandwest", + "displayName": "Switzerland West", + "regionalDisplayName": "(Europe) Switzerland West", + "metadata": { + "regionType": "Physical", + "regionCategory": "Other", + "geographyGroup": "Europe", + "longitude": "6.143158", + "latitude": "46.204391", + "physicalLocation": "Geneva", + "pairedRegion": [ + { + "name": "switzerlandnorth", + "id": "/subscriptions/0accec26-d6de-4757-8e74-d080f38eaaab/locations/switzerlandnorth" + } + ] + } + }, + { + "id": "/subscriptions/0accec26-d6de-4757-8e74-d080f38eaaab/locations/ukwest", + "name": "ukwest", + "displayName": "UK West", + "regionalDisplayName": "(Europe) UK West", + "metadata": { + "regionType": "Physical", + "regionCategory": "Other", + "geographyGroup": "Europe", + "longitude": "-3.084", + "latitude": "53.427", + "physicalLocation": "Cardiff", + "pairedRegion": [ + { + "name": "uksouth", + "id": "/subscriptions/0accec26-d6de-4757-8e74-d080f38eaaab/locations/uksouth" + } + ] + } + }, + { + "id": "/subscriptions/0accec26-d6de-4757-8e74-d080f38eaaab/locations/uaecentral", + "name": "uaecentral", + "displayName": "UAE Central", + "regionalDisplayName": "(Middle East) UAE Central", + "metadata": { + "regionType": "Physical", + "regionCategory": "Other", + "geographyGroup": "Middle East", + "longitude": "54.366669", + "latitude": "24.466667", + "physicalLocation": "Abu Dhabi", + "pairedRegion": [ + { + "name": "uaenorth", + "id": "/subscriptions/0accec26-d6de-4757-8e74-d080f38eaaab/locations/uaenorth" + } + ] + } + }, + { + "id": "/subscriptions/0accec26-d6de-4757-8e74-d080f38eaaab/locations/brazilsoutheast", + "name": "brazilsoutheast", + "displayName": "Brazil Southeast", + "regionalDisplayName": "(South America) Brazil Southeast", + "metadata": { + "regionType": "Physical", + "regionCategory": "Other", + "geographyGroup": "South America", + "longitude": "-43.2075", + "latitude": "-22.90278", + "physicalLocation": "Rio", + "pairedRegion": [ + { + "name": "brazilsouth", + "id": "/subscriptions/0accec26-d6de-4757-8e74-d080f38eaaab/locations/brazilsouth" + } + ] + } + }, + { + "id": "/subscriptions/0accec26-d6de-4757-8e74-d080f38eaaab/locations/eastusslv", + "name": "eastusslv", + "displayName": "East US SLV", + "regionalDisplayName": "(South America) East US SLV", + "metadata": { + "regionType": "Physical", + "regionCategory": "Other", + "geographyGroup": "South America", + "longitude": "-43.2075", + "latitude": "-22.90278", + "physicalLocation": "Silverstone", + "pairedRegion": [ + { + "name": "eastusslv", + "id": "/subscriptions/0accec26-d6de-4757-8e74-d080f38eaaab/locations/eastusslv" + } + ] + } + } + ] + } + } + ], + "Variables": { + "RandomSeed": "986246248", + "SUBSCRIPTION_ID": "0accec26-d6de-4757-8e74-d080f38eaaab" + } +} \ No newline at end of file From 69501505e4c48a614a84f608b62d48a746477894 Mon Sep 17 00:00:00 2001 From: Harvey Chen <30464227+HarveyLink@users.noreply.github.com> Date: Sat, 8 May 2021 10:13:46 +0800 Subject: [PATCH 07/16] Fix tests --- .../src/SubscriptionContainer.cs | 8 +- .../src/SubscriptionOperations.cs | 21 ++-- .../TestListSubscriptions.json | 105 ++++++++++++++++++ .../TestListSubscriptionsAsync.json | 105 ++++++++++++++++++ 4 files changed, 223 insertions(+), 16 deletions(-) create mode 100644 sdk/resourcemanager/Azure.ResourceManager.Core/tests/SessionRecords/SubscriptionOperationsTests/TestListSubscriptions.json create mode 100644 sdk/resourcemanager/Azure.ResourceManager.Core/tests/SessionRecords/SubscriptionOperationsTests/TestListSubscriptionsAsync.json diff --git a/sdk/resourcemanager/Azure.ResourceManager.Core/src/SubscriptionContainer.cs b/sdk/resourcemanager/Azure.ResourceManager.Core/src/SubscriptionContainer.cs index ad0863849244..7f5b0af82efe 100644 --- a/sdk/resourcemanager/Azure.ResourceManager.Core/src/SubscriptionContainer.cs +++ b/sdk/resourcemanager/Azure.ResourceManager.Core/src/SubscriptionContainer.cs @@ -53,9 +53,7 @@ public virtual Pageable List(CancellationToken cancellationToken = try { - return new PhWrappingPageable( - Operations.List(cancellationToken), - Converter()); + return Operations.List(cancellationToken); } catch (Exception e) { @@ -78,9 +76,7 @@ public virtual AsyncPageable ListAsync(CancellationToken cancellat try { - return new PhWrappingAsyncPageable( - Operations.ListAsync(cancellationToken), - Converter()); + return Operations.ListAsync(cancellationToken); } catch (Exception e) { diff --git a/sdk/resourcemanager/Azure.ResourceManager.Core/src/SubscriptionOperations.cs b/sdk/resourcemanager/Azure.ResourceManager.Core/src/SubscriptionOperations.cs index 34d4272ebba9..e93187f910ee 100644 --- a/sdk/resourcemanager/Azure.ResourceManager.Core/src/SubscriptionOperations.cs +++ b/sdk/resourcemanager/Azure.ResourceManager.Core/src/SubscriptionOperations.cs @@ -2,6 +2,7 @@ // Licensed under the MIT License. using System; +using System.Linq; using System.Threading; using System.Threading.Tasks; using Azure.Core; @@ -111,16 +112,16 @@ await SubscriptionsRestOperations.GetAsync(Id.Name, cancellationToken).Configure /// Gets all subscriptions for a tenant. /// The cancellation token to use. - public virtual AsyncPageable ListAsync(CancellationToken cancellationToken = default) + public virtual AsyncPageable ListAsync(CancellationToken cancellationToken = default) { - async Task> FirstPageFunc(int? pageSizeHint) + async Task> FirstPageFunc(int? pageSizeHint) { using var scope = Diagnostics.CreateScope("SubscriptionOperations.List"); scope.Start(); try { var response = await SubscriptionsRestOperations.ListAsync(cancellationToken).ConfigureAwait(false); - return Page.FromValues(response.Value.Value, response.Value.NextLink, response.GetRawResponse()); + return Page.FromValues(response.Value.Value.Select(data => new Subscription(this, data)).ToList(), response.Value.NextLink, response.GetRawResponse()); } catch (Exception e) { @@ -128,14 +129,14 @@ async Task> FirstPageFunc(int? pageSizeHint) throw; } } - async Task> NextPageFunc(string nextLink, int? pageSizeHint) + async Task> NextPageFunc(string nextLink, int? pageSizeHint) { using var scope = Diagnostics.CreateScope("SubscriptionOperations.List"); scope.Start(); try { var response = await SubscriptionsRestOperations.ListNextPageAsync(nextLink, cancellationToken).ConfigureAwait(false); - return Page.FromValues(response.Value.Value, response.Value.NextLink, response.GetRawResponse()); + return Page.FromValues(response.Value.Value.Select(data => new Subscription(this, data)).ToList(), response.Value.NextLink, response.GetRawResponse()); } catch (Exception e) { @@ -148,16 +149,16 @@ async Task> NextPageFunc(string nextLink, int? pageSizeHi /// Gets all subscriptions for a tenant. /// The cancellation token to use. - public virtual Pageable List(CancellationToken cancellationToken = default) + public virtual Pageable List(CancellationToken cancellationToken = default) { - Page FirstPageFunc(int? pageSizeHint) + Page FirstPageFunc(int? pageSizeHint) { using var scope = Diagnostics.CreateScope("SubscriptionOperations.List"); scope.Start(); try { var response = SubscriptionsRestOperations.List(cancellationToken); - return Page.FromValues(response.Value.Value, response.Value.NextLink, response.GetRawResponse()); + return Page.FromValues(response.Value.Value.Select(data => new Subscription(this, data)).ToList(), response.Value.NextLink, response.GetRawResponse()); } catch (Exception e) { @@ -165,14 +166,14 @@ Page FirstPageFunc(int? pageSizeHint) throw; } } - Page NextPageFunc(string nextLink, int? pageSizeHint) + Page NextPageFunc(string nextLink, int? pageSizeHint) { using var scope = Diagnostics.CreateScope("SubscriptionOperations.List"); scope.Start(); try { var response = SubscriptionsRestOperations.ListNextPage(nextLink, cancellationToken); - return Page.FromValues(response.Value.Value, response.Value.NextLink, response.GetRawResponse()); + return Page.FromValues(response.Value.Value.Select(data => new Subscription(this, data)).ToList(), response.Value.NextLink, response.GetRawResponse()); } catch (Exception e) { diff --git a/sdk/resourcemanager/Azure.ResourceManager.Core/tests/SessionRecords/SubscriptionOperationsTests/TestListSubscriptions.json b/sdk/resourcemanager/Azure.ResourceManager.Core/tests/SessionRecords/SubscriptionOperationsTests/TestListSubscriptions.json new file mode 100644 index 000000000000..77e59a2d67fb --- /dev/null +++ b/sdk/resourcemanager/Azure.ResourceManager.Core/tests/SessionRecords/SubscriptionOperationsTests/TestListSubscriptions.json @@ -0,0 +1,105 @@ +{ + "Entries": [ + { + "RequestUri": "https://management.azure.com/subscriptions/0accec26-d6de-4757-8e74-d080f38eaaab?api-version=2019-11-01", + "RequestMethod": "GET", + "RequestHeaders": { + "Accept": "application/json", + "Authorization": "Sanitized", + "User-Agent": [ + "azsdk-net-ResourceManager.Core/1.0.0-alpha.20210508.1", + "(.NET Core 4.6.29916.01; Microsoft Windows 10.0.19043 )" + ], + "x-ms-client-request-id": "a2e7506d2e76ddb7095a7da07324507b", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "Cache-Control": "no-cache", + "Content-Length": "403", + "Content-Type": "application/json; charset=utf-8", + "Date": "Sat, 08 May 2021 02:12:41 GMT", + "Expires": "-1", + "Pragma": "no-cache", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains", + "X-Content-Type-Options": "nosniff", + "x-ms-correlation-request-id": "1a9a0ed3-041e-43da-baa1-eb46a601411e", + "x-ms-ratelimit-remaining-subscription-reads": "11998", + "x-ms-request-id": "1a9a0ed3-041e-43da-baa1-eb46a601411e", + "x-ms-routing-request-id": "SOUTHEASTASIA:20210508T021242Z:1a9a0ed3-041e-43da-baa1-eb46a601411e" + }, + "ResponseBody": { + "id": "/subscriptions/0accec26-d6de-4757-8e74-d080f38eaaab", + "authorizationSource": "RoleBased", + "managedByTenants": [], + "subscriptionId": "0accec26-d6de-4757-8e74-d080f38eaaab", + "tenantId": "72f988bf-86f1-41af-91ab-2d7cd011db47", + "displayName": "ACR - TEST - China Team", + "state": "Enabled", + "subscriptionPolicies": { + "locationPlacementId": "Internal_2014-09-01", + "quotaId": "Internal_2014-09-01", + "spendingLimit": "Off" + } + } + }, + { + "RequestUri": "https://management.azure.com/subscriptions?api-version=2019-11-01", + "RequestMethod": "GET", + "RequestHeaders": { + "Accept": "application/json", + "Authorization": "Sanitized", + "traceparent": "00-a7879a5e94ef3d47adcad6112c73633a-7733c28345217847-00", + "User-Agent": [ + "azsdk-net-ResourceManager.Core/1.0.0-alpha.20210508.1", + "(.NET Core 4.6.29916.01; Microsoft Windows 10.0.19043 )" + ], + "x-ms-client-request-id": "7ddd285b88f8079a19bd90bc4b76ae23", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "Cache-Control": "no-cache", + "Content-Length": "450", + "Content-Type": "application/json; charset=utf-8", + "Date": "Sat, 08 May 2021 02:12:42 GMT", + "Expires": "-1", + "Pragma": "no-cache", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains", + "X-Content-Type-Options": "nosniff", + "x-ms-correlation-request-id": "cae81e3c-1b4e-4c0d-aab5-2f828d03ba9b", + "x-ms-ratelimit-remaining-tenant-reads": "11999", + "x-ms-request-id": "cae81e3c-1b4e-4c0d-aab5-2f828d03ba9b", + "x-ms-routing-request-id": "SOUTHEASTASIA:20210508T021242Z:cae81e3c-1b4e-4c0d-aab5-2f828d03ba9b" + }, + "ResponseBody": { + "value": [ + { + "id": "/subscriptions/0accec26-d6de-4757-8e74-d080f38eaaab", + "authorizationSource": "RoleBased", + "managedByTenants": [], + "subscriptionId": "0accec26-d6de-4757-8e74-d080f38eaaab", + "tenantId": "72f988bf-86f1-41af-91ab-2d7cd011db47", + "displayName": "ACR - TEST - China Team", + "state": "Enabled", + "subscriptionPolicies": { + "locationPlacementId": "Internal_2014-09-01", + "quotaId": "Internal_2014-09-01", + "spendingLimit": "Off" + } + } + ], + "count": { + "type": "Total", + "value": 1 + } + } + } + ], + "Variables": { + "RandomSeed": "1053419355", + "SUBSCRIPTION_ID": "0accec26-d6de-4757-8e74-d080f38eaaab" + } +} \ No newline at end of file diff --git a/sdk/resourcemanager/Azure.ResourceManager.Core/tests/SessionRecords/SubscriptionOperationsTests/TestListSubscriptionsAsync.json b/sdk/resourcemanager/Azure.ResourceManager.Core/tests/SessionRecords/SubscriptionOperationsTests/TestListSubscriptionsAsync.json new file mode 100644 index 000000000000..b07fa1457390 --- /dev/null +++ b/sdk/resourcemanager/Azure.ResourceManager.Core/tests/SessionRecords/SubscriptionOperationsTests/TestListSubscriptionsAsync.json @@ -0,0 +1,105 @@ +{ + "Entries": [ + { + "RequestUri": "https://management.azure.com/subscriptions/0accec26-d6de-4757-8e74-d080f38eaaab?api-version=2019-11-01", + "RequestMethod": "GET", + "RequestHeaders": { + "Accept": "application/json", + "Authorization": "Sanitized", + "User-Agent": [ + "azsdk-net-ResourceManager.Core/1.0.0-alpha.20210508.1", + "(.NET Core 4.6.29916.01; Microsoft Windows 10.0.19043 )" + ], + "x-ms-client-request-id": "3c89aef95e32ca6f4739553e1b9453ab", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "Cache-Control": "no-cache", + "Content-Length": "403", + "Content-Type": "application/json; charset=utf-8", + "Date": "Sat, 08 May 2021 02:12:58 GMT", + "Expires": "-1", + "Pragma": "no-cache", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains", + "X-Content-Type-Options": "nosniff", + "x-ms-correlation-request-id": "ba9f708a-bcfe-48ef-b6e2-2f583f824b25", + "x-ms-ratelimit-remaining-subscription-reads": "11998", + "x-ms-request-id": "ba9f708a-bcfe-48ef-b6e2-2f583f824b25", + "x-ms-routing-request-id": "SOUTHEASTASIA:20210508T021258Z:ba9f708a-bcfe-48ef-b6e2-2f583f824b25" + }, + "ResponseBody": { + "id": "/subscriptions/0accec26-d6de-4757-8e74-d080f38eaaab", + "authorizationSource": "RoleBased", + "managedByTenants": [], + "subscriptionId": "0accec26-d6de-4757-8e74-d080f38eaaab", + "tenantId": "72f988bf-86f1-41af-91ab-2d7cd011db47", + "displayName": "ACR - TEST - China Team", + "state": "Enabled", + "subscriptionPolicies": { + "locationPlacementId": "Internal_2014-09-01", + "quotaId": "Internal_2014-09-01", + "spendingLimit": "Off" + } + } + }, + { + "RequestUri": "https://management.azure.com/subscriptions?api-version=2019-11-01", + "RequestMethod": "GET", + "RequestHeaders": { + "Accept": "application/json", + "Authorization": "Sanitized", + "traceparent": "00-884f7f9cfa2e4342b554f1727b9b32a8-5050e214aa33264f-00", + "User-Agent": [ + "azsdk-net-ResourceManager.Core/1.0.0-alpha.20210508.1", + "(.NET Core 4.6.29916.01; Microsoft Windows 10.0.19043 )" + ], + "x-ms-client-request-id": "c71ca39f5f5ccb4111a183f4be867dc3", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "Cache-Control": "no-cache", + "Content-Length": "450", + "Content-Type": "application/json; charset=utf-8", + "Date": "Sat, 08 May 2021 02:12:58 GMT", + "Expires": "-1", + "Pragma": "no-cache", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains", + "X-Content-Type-Options": "nosniff", + "x-ms-correlation-request-id": "a7e98457-d836-4a48-bbe3-185c9aa4a144", + "x-ms-ratelimit-remaining-tenant-reads": "11999", + "x-ms-request-id": "a7e98457-d836-4a48-bbe3-185c9aa4a144", + "x-ms-routing-request-id": "SOUTHEASTASIA:20210508T021258Z:a7e98457-d836-4a48-bbe3-185c9aa4a144" + }, + "ResponseBody": { + "value": [ + { + "id": "/subscriptions/0accec26-d6de-4757-8e74-d080f38eaaab", + "authorizationSource": "RoleBased", + "managedByTenants": [], + "subscriptionId": "0accec26-d6de-4757-8e74-d080f38eaaab", + "tenantId": "72f988bf-86f1-41af-91ab-2d7cd011db47", + "displayName": "ACR - TEST - China Team", + "state": "Enabled", + "subscriptionPolicies": { + "locationPlacementId": "Internal_2014-09-01", + "quotaId": "Internal_2014-09-01", + "spendingLimit": "Off" + } + } + ], + "count": { + "type": "Total", + "value": 1 + } + } + } + ], + "Variables": { + "RandomSeed": "1172696664", + "SUBSCRIPTION_ID": "0accec26-d6de-4757-8e74-d080f38eaaab" + } +} \ No newline at end of file From c5495e7e16181a1fac6c989526789672a971222a Mon Sep 17 00:00:00 2001 From: Harvey Chen <30464227+HarveyLink@users.noreply.github.com> Date: Sat, 8 May 2021 10:34:04 +0800 Subject: [PATCH 08/16] Update json --- .../TestListLocations.json | 1314 +++++++++++++++++ .../TestListLocationsAsync.json | 1314 +++++++++++++++++ 2 files changed, 2628 insertions(+) create mode 100644 sdk/resourcemanager/Azure.ResourceManager.Core/tests/SessionRecords/SubscriptionOperationsTests/TestListLocations.json create mode 100644 sdk/resourcemanager/Azure.ResourceManager.Core/tests/SessionRecords/SubscriptionOperationsTests/TestListLocationsAsync.json diff --git a/sdk/resourcemanager/Azure.ResourceManager.Core/tests/SessionRecords/SubscriptionOperationsTests/TestListLocations.json b/sdk/resourcemanager/Azure.ResourceManager.Core/tests/SessionRecords/SubscriptionOperationsTests/TestListLocations.json new file mode 100644 index 000000000000..3a3e189741bb --- /dev/null +++ b/sdk/resourcemanager/Azure.ResourceManager.Core/tests/SessionRecords/SubscriptionOperationsTests/TestListLocations.json @@ -0,0 +1,1314 @@ +{ + "Entries": [ + { + "RequestUri": "https://management.azure.com/subscriptions/0accec26-d6de-4757-8e74-d080f38eaaab?api-version=2019-11-01", + "RequestMethod": "GET", + "RequestHeaders": { + "Accept": "application/json", + "Authorization": "Sanitized", + "User-Agent": [ + "azsdk-net-ResourceManager.Core/1.0.0-alpha.20210508.1", + "(.NET Core 4.6.29916.01; Microsoft Windows 10.0.19043 )" + ], + "x-ms-client-request-id": "39a31d144c928d87b0b326451e6e37ad", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "Cache-Control": "no-cache", + "Content-Length": "403", + "Content-Type": "application/json; charset=utf-8", + "Date": "Sat, 08 May 2021 02:33:32 GMT", + "Expires": "-1", + "Pragma": "no-cache", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains", + "X-Content-Type-Options": "nosniff", + "x-ms-correlation-request-id": "7a6a419f-6d4f-40e5-ac56-fbb49dc2b272", + "x-ms-ratelimit-remaining-subscription-reads": "11998", + "x-ms-request-id": "7a6a419f-6d4f-40e5-ac56-fbb49dc2b272", + "x-ms-routing-request-id": "SOUTHEASTASIA:20210508T023333Z:7a6a419f-6d4f-40e5-ac56-fbb49dc2b272" + }, + "ResponseBody": { + "id": "/subscriptions/0accec26-d6de-4757-8e74-d080f38eaaab", + "authorizationSource": "RoleBased", + "managedByTenants": [], + "subscriptionId": "0accec26-d6de-4757-8e74-d080f38eaaab", + "tenantId": "72f988bf-86f1-41af-91ab-2d7cd011db47", + "displayName": "ACR - TEST - China Team", + "state": "Enabled", + "subscriptionPolicies": { + "locationPlacementId": "Internal_2014-09-01", + "quotaId": "Internal_2014-09-01", + "spendingLimit": "Off" + } + } + }, + { + "RequestUri": "https://management.azure.com/subscriptions/0accec26-d6de-4757-8e74-d080f38eaaab/locations?api-version=2019-11-01", + "RequestMethod": "GET", + "RequestHeaders": { + "Accept": "application/json", + "Authorization": "Sanitized", + "traceparent": "00-16c51b167e33e144a88b9aff66e87b40-cca2d649da2d354b-00", + "User-Agent": [ + "azsdk-net-ResourceManager.Core/1.0.0-alpha.20210508.1", + "(.NET Core 4.6.29916.01; Microsoft Windows 10.0.19043 )" + ], + "x-ms-client-request-id": "fbf93b0507793b3f1fee91b91b669c5d", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "Cache-Control": "no-cache", + "Content-Length": "28880", + "Content-Type": "application/json; charset=utf-8", + "Date": "Sat, 08 May 2021 02:33:33 GMT", + "Expires": "-1", + "Pragma": "no-cache", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains", + "X-Content-Type-Options": "nosniff", + "x-ms-correlation-request-id": "54dbac0e-fc43-45f9-a211-338146e93d85", + "x-ms-ratelimit-remaining-subscription-reads": "11997", + "x-ms-request-id": "54dbac0e-fc43-45f9-a211-338146e93d85", + "x-ms-routing-request-id": "SOUTHEASTASIA:20210508T023334Z:54dbac0e-fc43-45f9-a211-338146e93d85" + }, + "ResponseBody": { + "value": [ + { + "id": "/subscriptions/0accec26-d6de-4757-8e74-d080f38eaaab/locations/eastus", + "name": "eastus", + "displayName": "East US", + "regionalDisplayName": "(US) East US", + "metadata": { + "regionType": "Physical", + "regionCategory": "Recommended", + "geographyGroup": "US", + "longitude": "-79.8164", + "latitude": "37.3719", + "physicalLocation": "Virginia", + "pairedRegion": [ + { + "name": "westus", + "id": "/subscriptions/0accec26-d6de-4757-8e74-d080f38eaaab/locations/westus" + } + ] + } + }, + { + "id": "/subscriptions/0accec26-d6de-4757-8e74-d080f38eaaab/locations/eastus2", + "name": "eastus2", + "displayName": "East US 2", + "regionalDisplayName": "(US) East US 2", + "metadata": { + "regionType": "Physical", + "regionCategory": "Recommended", + "geographyGroup": "US", + "longitude": "-78.3889", + "latitude": "36.6681", + "physicalLocation": "Virginia", + "pairedRegion": [ + { + "name": "centralus", + "id": "/subscriptions/0accec26-d6de-4757-8e74-d080f38eaaab/locations/centralus" + } + ] + } + }, + { + "id": "/subscriptions/0accec26-d6de-4757-8e74-d080f38eaaab/locations/eastusstg", + "name": "eastusstg", + "displayName": "East US STG", + "regionalDisplayName": "(US) East US STG", + "metadata": { + "regionType": "Physical", + "regionCategory": "Recommended", + "geographyGroup": "US", + "longitude": "-79.8164", + "latitude": "37.3719", + "physicalLocation": "Virginia", + "pairedRegion": [ + { + "name": "southcentralusstg", + "id": "/subscriptions/0accec26-d6de-4757-8e74-d080f38eaaab/locations/southcentralusstg" + } + ] + } + }, + { + "id": "/subscriptions/0accec26-d6de-4757-8e74-d080f38eaaab/locations/southcentralus", + "name": "southcentralus", + "displayName": "South Central US", + "regionalDisplayName": "(US) South Central US", + "metadata": { + "regionType": "Physical", + "regionCategory": "Recommended", + "geographyGroup": "US", + "longitude": "-98.5", + "latitude": "29.4167", + "physicalLocation": "Texas", + "pairedRegion": [ + { + "name": "northcentralus", + "id": "/subscriptions/0accec26-d6de-4757-8e74-d080f38eaaab/locations/northcentralus" + } + ] + } + }, + { + "id": "/subscriptions/0accec26-d6de-4757-8e74-d080f38eaaab/locations/southcentralusstg", + "name": "southcentralusstg", + "displayName": "South Central US STG", + "regionalDisplayName": "(US) South Central US STG", + "metadata": { + "regionType": "Physical", + "regionCategory": "Recommended", + "geographyGroup": "US", + "longitude": "-98.5", + "latitude": "29.4167", + "physicalLocation": "Texas", + "pairedRegion": [ + { + "name": "eastusstg", + "id": "/subscriptions/0accec26-d6de-4757-8e74-d080f38eaaab/locations/eastusstg" + } + ] + } + }, + { + "id": "/subscriptions/0accec26-d6de-4757-8e74-d080f38eaaab/locations/westus2", + "name": "westus2", + "displayName": "West US 2", + "regionalDisplayName": "(US) West US 2", + "metadata": { + "regionType": "Physical", + "regionCategory": "Recommended", + "geographyGroup": "US", + "longitude": "-119.852", + "latitude": "47.233", + "physicalLocation": "Washington", + "pairedRegion": [ + { + "name": "westcentralus", + "id": "/subscriptions/0accec26-d6de-4757-8e74-d080f38eaaab/locations/westcentralus" + } + ] + } + }, + { + "id": "/subscriptions/0accec26-d6de-4757-8e74-d080f38eaaab/locations/westus3", + "name": "westus3", + "displayName": "West US 3", + "regionalDisplayName": "(US) West US 3", + "metadata": { + "regionType": "Physical", + "regionCategory": "Recommended", + "geographyGroup": "US", + "longitude": "-112.074036", + "latitude": "33.448376", + "physicalLocation": "Phoenix", + "pairedRegion": [ + { + "name": "eastus", + "id": "/subscriptions/0accec26-d6de-4757-8e74-d080f38eaaab/locations/eastus" + } + ] + } + }, + { + "id": "/subscriptions/0accec26-d6de-4757-8e74-d080f38eaaab/locations/australiaeast", + "name": "australiaeast", + "displayName": "Australia East", + "regionalDisplayName": "(Asia Pacific) Australia East", + "metadata": { + "regionType": "Physical", + "regionCategory": "Recommended", + "geographyGroup": "Asia Pacific", + "longitude": "151.2094", + "latitude": "-33.86", + "physicalLocation": "New South Wales", + "pairedRegion": [ + { + "name": "australiasoutheast", + "id": "/subscriptions/0accec26-d6de-4757-8e74-d080f38eaaab/locations/australiasoutheast" + } + ] + } + }, + { + "id": "/subscriptions/0accec26-d6de-4757-8e74-d080f38eaaab/locations/southeastasia", + "name": "southeastasia", + "displayName": "Southeast Asia", + "regionalDisplayName": "(Asia Pacific) Southeast Asia", + "metadata": { + "regionType": "Physical", + "regionCategory": "Recommended", + "geographyGroup": "Asia Pacific", + "longitude": "103.833", + "latitude": "1.283", + "physicalLocation": "Singapore", + "pairedRegion": [ + { + "name": "eastasia", + "id": "/subscriptions/0accec26-d6de-4757-8e74-d080f38eaaab/locations/eastasia" + } + ] + } + }, + { + "id": "/subscriptions/0accec26-d6de-4757-8e74-d080f38eaaab/locations/northeurope", + "name": "northeurope", + "displayName": "North Europe", + "regionalDisplayName": "(Europe) North Europe", + "metadata": { + "regionType": "Physical", + "regionCategory": "Recommended", + "geographyGroup": "Europe", + "longitude": "-6.2597", + "latitude": "53.3478", + "physicalLocation": "Ireland", + "pairedRegion": [ + { + "name": "westeurope", + "id": "/subscriptions/0accec26-d6de-4757-8e74-d080f38eaaab/locations/westeurope" + } + ] + } + }, + { + "id": "/subscriptions/0accec26-d6de-4757-8e74-d080f38eaaab/locations/swedencentral", + "name": "swedencentral", + "displayName": "Sweden Central", + "regionalDisplayName": "(Europe) Sweden Central", + "metadata": { + "regionType": "Physical", + "regionCategory": "Recommended", + "geographyGroup": "Europe", + "longitude": "17.14127", + "latitude": "60.67488", + "physicalLocation": "G\u00E4vle", + "pairedRegion": [ + { + "name": "swedensouth", + "id": "/subscriptions/0accec26-d6de-4757-8e74-d080f38eaaab/locations/swedensouth" + } + ] + } + }, + { + "id": "/subscriptions/0accec26-d6de-4757-8e74-d080f38eaaab/locations/uksouth", + "name": "uksouth", + "displayName": "UK South", + "regionalDisplayName": "(Europe) UK South", + "metadata": { + "regionType": "Physical", + "regionCategory": "Recommended", + "geographyGroup": "Europe", + "longitude": "-0.799", + "latitude": "50.941", + "physicalLocation": "London", + "pairedRegion": [ + { + "name": "ukwest", + "id": "/subscriptions/0accec26-d6de-4757-8e74-d080f38eaaab/locations/ukwest" + } + ] + } + }, + { + "id": "/subscriptions/0accec26-d6de-4757-8e74-d080f38eaaab/locations/westeurope", + "name": "westeurope", + "displayName": "West Europe", + "regionalDisplayName": "(Europe) West Europe", + "metadata": { + "regionType": "Physical", + "regionCategory": "Recommended", + "geographyGroup": "Europe", + "longitude": "4.9", + "latitude": "52.3667", + "physicalLocation": "Netherlands", + "pairedRegion": [ + { + "name": "northeurope", + "id": "/subscriptions/0accec26-d6de-4757-8e74-d080f38eaaab/locations/northeurope" + } + ] + } + }, + { + "id": "/subscriptions/0accec26-d6de-4757-8e74-d080f38eaaab/locations/centralus", + "name": "centralus", + "displayName": "Central US", + "regionalDisplayName": "(US) Central US", + "metadata": { + "regionType": "Physical", + "regionCategory": "Recommended", + "geographyGroup": "US", + "longitude": "-93.6208", + "latitude": "41.5908", + "physicalLocation": "Iowa", + "pairedRegion": [ + { + "name": "eastus2", + "id": "/subscriptions/0accec26-d6de-4757-8e74-d080f38eaaab/locations/eastus2" + } + ] + } + }, + { + "id": "/subscriptions/0accec26-d6de-4757-8e74-d080f38eaaab/locations/northcentralus", + "name": "northcentralus", + "displayName": "North Central US", + "regionalDisplayName": "(US) North Central US", + "metadata": { + "regionType": "Physical", + "regionCategory": "Recommended", + "geographyGroup": "US", + "longitude": "-87.6278", + "latitude": "41.8819", + "physicalLocation": "Illinois", + "pairedRegion": [ + { + "name": "southcentralus", + "id": "/subscriptions/0accec26-d6de-4757-8e74-d080f38eaaab/locations/southcentralus" + } + ] + } + }, + { + "id": "/subscriptions/0accec26-d6de-4757-8e74-d080f38eaaab/locations/westus", + "name": "westus", + "displayName": "West US", + "regionalDisplayName": "(US) West US", + "metadata": { + "regionType": "Physical", + "regionCategory": "Recommended", + "geographyGroup": "US", + "longitude": "-122.417", + "latitude": "37.783", + "physicalLocation": "California", + "pairedRegion": [ + { + "name": "eastus", + "id": "/subscriptions/0accec26-d6de-4757-8e74-d080f38eaaab/locations/eastus" + } + ] + } + }, + { + "id": "/subscriptions/0accec26-d6de-4757-8e74-d080f38eaaab/locations/southafricanorth", + "name": "southafricanorth", + "displayName": "South Africa North", + "regionalDisplayName": "(Africa) South Africa North", + "metadata": { + "regionType": "Physical", + "regionCategory": "Recommended", + "geographyGroup": "Africa", + "longitude": "28.218370", + "latitude": "-25.731340", + "physicalLocation": "Johannesburg", + "pairedRegion": [ + { + "name": "southafricawest", + "id": "/subscriptions/0accec26-d6de-4757-8e74-d080f38eaaab/locations/southafricawest" + } + ] + } + }, + { + "id": "/subscriptions/0accec26-d6de-4757-8e74-d080f38eaaab/locations/centralindia", + "name": "centralindia", + "displayName": "Central India", + "regionalDisplayName": "(Asia Pacific) Central India", + "metadata": { + "regionType": "Physical", + "regionCategory": "Recommended", + "geographyGroup": "Asia Pacific", + "longitude": "73.9197", + "latitude": "18.5822", + "physicalLocation": "Pune", + "pairedRegion": [ + { + "name": "southindia", + "id": "/subscriptions/0accec26-d6de-4757-8e74-d080f38eaaab/locations/southindia" + } + ] + } + }, + { + "id": "/subscriptions/0accec26-d6de-4757-8e74-d080f38eaaab/locations/eastasia", + "name": "eastasia", + "displayName": "East Asia", + "regionalDisplayName": "(Asia Pacific) East Asia", + "metadata": { + "regionType": "Physical", + "regionCategory": "Recommended", + "geographyGroup": "Asia Pacific", + "longitude": "114.188", + "latitude": "22.267", + "physicalLocation": "Hong Kong", + "pairedRegion": [ + { + "name": "southeastasia", + "id": "/subscriptions/0accec26-d6de-4757-8e74-d080f38eaaab/locations/southeastasia" + } + ] + } + }, + { + "id": "/subscriptions/0accec26-d6de-4757-8e74-d080f38eaaab/locations/japaneast", + "name": "japaneast", + "displayName": "Japan East", + "regionalDisplayName": "(Asia Pacific) Japan East", + "metadata": { + "regionType": "Physical", + "regionCategory": "Recommended", + "geographyGroup": "Asia Pacific", + "longitude": "139.77", + "latitude": "35.68", + "physicalLocation": "Tokyo, Saitama", + "pairedRegion": [ + { + "name": "japanwest", + "id": "/subscriptions/0accec26-d6de-4757-8e74-d080f38eaaab/locations/japanwest" + } + ] + } + }, + { + "id": "/subscriptions/0accec26-d6de-4757-8e74-d080f38eaaab/locations/jioindiawest", + "name": "jioindiawest", + "displayName": "Jio India West", + "regionalDisplayName": "(Asia Pacific) Jio India West", + "metadata": { + "regionType": "Physical", + "regionCategory": "Recommended", + "geographyGroup": "Asia Pacific", + "longitude": "70.05773", + "latitude": "22.470701", + "physicalLocation": "Jamnagar", + "pairedRegion": [ + { + "name": "jioindiacentral", + "id": "/subscriptions/0accec26-d6de-4757-8e74-d080f38eaaab/locations/jioindiacentral" + } + ] + } + }, + { + "id": "/subscriptions/0accec26-d6de-4757-8e74-d080f38eaaab/locations/koreacentral", + "name": "koreacentral", + "displayName": "Korea Central", + "regionalDisplayName": "(Asia Pacific) Korea Central", + "metadata": { + "regionType": "Physical", + "regionCategory": "Recommended", + "geographyGroup": "Asia Pacific", + "longitude": "126.9780", + "latitude": "37.5665", + "physicalLocation": "Seoul", + "pairedRegion": [ + { + "name": "koreasouth", + "id": "/subscriptions/0accec26-d6de-4757-8e74-d080f38eaaab/locations/koreasouth" + } + ] + } + }, + { + "id": "/subscriptions/0accec26-d6de-4757-8e74-d080f38eaaab/locations/canadacentral", + "name": "canadacentral", + "displayName": "Canada Central", + "regionalDisplayName": "(Canada) Canada Central", + "metadata": { + "regionType": "Physical", + "regionCategory": "Recommended", + "geographyGroup": "Canada", + "longitude": "-79.383", + "latitude": "43.653", + "physicalLocation": "Toronto", + "pairedRegion": [ + { + "name": "canadaeast", + "id": "/subscriptions/0accec26-d6de-4757-8e74-d080f38eaaab/locations/canadaeast" + } + ] + } + }, + { + "id": "/subscriptions/0accec26-d6de-4757-8e74-d080f38eaaab/locations/francecentral", + "name": "francecentral", + "displayName": "France Central", + "regionalDisplayName": "(Europe) France Central", + "metadata": { + "regionType": "Physical", + "regionCategory": "Recommended", + "geographyGroup": "Europe", + "longitude": "2.3730", + "latitude": "46.3772", + "physicalLocation": "Paris", + "pairedRegion": [ + { + "name": "francesouth", + "id": "/subscriptions/0accec26-d6de-4757-8e74-d080f38eaaab/locations/francesouth" + } + ] + } + }, + { + "id": "/subscriptions/0accec26-d6de-4757-8e74-d080f38eaaab/locations/germanywestcentral", + "name": "germanywestcentral", + "displayName": "Germany West Central", + "regionalDisplayName": "(Europe) Germany West Central", + "metadata": { + "regionType": "Physical", + "regionCategory": "Recommended", + "geographyGroup": "Europe", + "longitude": "8.682127", + "latitude": "50.110924", + "physicalLocation": "Frankfurt", + "pairedRegion": [ + { + "name": "germanynorth", + "id": "/subscriptions/0accec26-d6de-4757-8e74-d080f38eaaab/locations/germanynorth" + } + ] + } + }, + { + "id": "/subscriptions/0accec26-d6de-4757-8e74-d080f38eaaab/locations/norwayeast", + "name": "norwayeast", + "displayName": "Norway East", + "regionalDisplayName": "(Europe) Norway East", + "metadata": { + "regionType": "Physical", + "regionCategory": "Recommended", + "geographyGroup": "Europe", + "longitude": "10.752245", + "latitude": "59.913868", + "physicalLocation": "Norway", + "pairedRegion": [ + { + "name": "norwaywest", + "id": "/subscriptions/0accec26-d6de-4757-8e74-d080f38eaaab/locations/norwaywest" + } + ] + } + }, + { + "id": "/subscriptions/0accec26-d6de-4757-8e74-d080f38eaaab/locations/switzerlandnorth", + "name": "switzerlandnorth", + "displayName": "Switzerland North", + "regionalDisplayName": "(Europe) Switzerland North", + "metadata": { + "regionType": "Physical", + "regionCategory": "Recommended", + "geographyGroup": "Europe", + "longitude": "8.564572", + "latitude": "47.451542", + "physicalLocation": "Zurich", + "pairedRegion": [ + { + "name": "switzerlandwest", + "id": "/subscriptions/0accec26-d6de-4757-8e74-d080f38eaaab/locations/switzerlandwest" + } + ] + } + }, + { + "id": "/subscriptions/0accec26-d6de-4757-8e74-d080f38eaaab/locations/uaenorth", + "name": "uaenorth", + "displayName": "UAE North", + "regionalDisplayName": "(Middle East) UAE North", + "metadata": { + "regionType": "Physical", + "regionCategory": "Recommended", + "geographyGroup": "Middle East", + "longitude": "55.316666", + "latitude": "25.266666", + "physicalLocation": "Dubai", + "pairedRegion": [ + { + "name": "uaecentral", + "id": "/subscriptions/0accec26-d6de-4757-8e74-d080f38eaaab/locations/uaecentral" + } + ] + } + }, + { + "id": "/subscriptions/0accec26-d6de-4757-8e74-d080f38eaaab/locations/brazilsouth", + "name": "brazilsouth", + "displayName": "Brazil South", + "regionalDisplayName": "(South America) Brazil South", + "metadata": { + "regionType": "Physical", + "regionCategory": "Recommended", + "geographyGroup": "South America", + "longitude": "-46.633", + "latitude": "-23.55", + "physicalLocation": "Sao Paulo State", + "pairedRegion": [ + { + "name": "southcentralus", + "id": "/subscriptions/0accec26-d6de-4757-8e74-d080f38eaaab/locations/southcentralus" + } + ] + } + }, + { + "id": "/subscriptions/0accec26-d6de-4757-8e74-d080f38eaaab/locations/centralusstage", + "name": "centralusstage", + "displayName": "Central US (Stage)", + "regionalDisplayName": "(US) Central US (Stage)", + "metadata": { + "regionType": "Logical", + "regionCategory": "Other", + "geographyGroup": "US" + } + }, + { + "id": "/subscriptions/0accec26-d6de-4757-8e74-d080f38eaaab/locations/eastusstage", + "name": "eastusstage", + "displayName": "East US (Stage)", + "regionalDisplayName": "(US) East US (Stage)", + "metadata": { + "regionType": "Logical", + "regionCategory": "Other", + "geographyGroup": "US" + } + }, + { + "id": "/subscriptions/0accec26-d6de-4757-8e74-d080f38eaaab/locations/eastus2stage", + "name": "eastus2stage", + "displayName": "East US 2 (Stage)", + "regionalDisplayName": "(US) East US 2 (Stage)", + "metadata": { + "regionType": "Logical", + "regionCategory": "Other", + "geographyGroup": "US" + } + }, + { + "id": "/subscriptions/0accec26-d6de-4757-8e74-d080f38eaaab/locations/northcentralusstage", + "name": "northcentralusstage", + "displayName": "North Central US (Stage)", + "regionalDisplayName": "(US) North Central US (Stage)", + "metadata": { + "regionType": "Logical", + "regionCategory": "Other", + "geographyGroup": "US" + } + }, + { + "id": "/subscriptions/0accec26-d6de-4757-8e74-d080f38eaaab/locations/southcentralusstage", + "name": "southcentralusstage", + "displayName": "South Central US (Stage)", + "regionalDisplayName": "(US) South Central US (Stage)", + "metadata": { + "regionType": "Logical", + "regionCategory": "Other", + "geographyGroup": "US" + } + }, + { + "id": "/subscriptions/0accec26-d6de-4757-8e74-d080f38eaaab/locations/westusstage", + "name": "westusstage", + "displayName": "West US (Stage)", + "regionalDisplayName": "(US) West US (Stage)", + "metadata": { + "regionType": "Logical", + "regionCategory": "Other", + "geographyGroup": "US" + } + }, + { + "id": "/subscriptions/0accec26-d6de-4757-8e74-d080f38eaaab/locations/westus2stage", + "name": "westus2stage", + "displayName": "West US 2 (Stage)", + "regionalDisplayName": "(US) West US 2 (Stage)", + "metadata": { + "regionType": "Logical", + "regionCategory": "Other", + "geographyGroup": "US" + } + }, + { + "id": "/subscriptions/0accec26-d6de-4757-8e74-d080f38eaaab/locations/asia", + "name": "asia", + "displayName": "Asia", + "regionalDisplayName": "Asia", + "metadata": { + "regionType": "Logical", + "regionCategory": "Other" + } + }, + { + "id": "/subscriptions/0accec26-d6de-4757-8e74-d080f38eaaab/locations/asiapacific", + "name": "asiapacific", + "displayName": "Asia Pacific", + "regionalDisplayName": "Asia Pacific", + "metadata": { + "regionType": "Logical", + "regionCategory": "Other" + } + }, + { + "id": "/subscriptions/0accec26-d6de-4757-8e74-d080f38eaaab/locations/australia", + "name": "australia", + "displayName": "Australia", + "regionalDisplayName": "Australia", + "metadata": { + "regionType": "Logical", + "regionCategory": "Other" + } + }, + { + "id": "/subscriptions/0accec26-d6de-4757-8e74-d080f38eaaab/locations/brazil", + "name": "brazil", + "displayName": "Brazil", + "regionalDisplayName": "Brazil", + "metadata": { + "regionType": "Logical", + "regionCategory": "Other" + } + }, + { + "id": "/subscriptions/0accec26-d6de-4757-8e74-d080f38eaaab/locations/canada", + "name": "canada", + "displayName": "Canada", + "regionalDisplayName": "Canada", + "metadata": { + "regionType": "Logical", + "regionCategory": "Other" + } + }, + { + "id": "/subscriptions/0accec26-d6de-4757-8e74-d080f38eaaab/locations/europe", + "name": "europe", + "displayName": "Europe", + "regionalDisplayName": "Europe", + "metadata": { + "regionType": "Logical", + "regionCategory": "Other" + } + }, + { + "id": "/subscriptions/0accec26-d6de-4757-8e74-d080f38eaaab/locations/global", + "name": "global", + "displayName": "Global", + "regionalDisplayName": "Global", + "metadata": { + "regionType": "Logical", + "regionCategory": "Other" + } + }, + { + "id": "/subscriptions/0accec26-d6de-4757-8e74-d080f38eaaab/locations/india", + "name": "india", + "displayName": "India", + "regionalDisplayName": "India", + "metadata": { + "regionType": "Logical", + "regionCategory": "Other" + } + }, + { + "id": "/subscriptions/0accec26-d6de-4757-8e74-d080f38eaaab/locations/japan", + "name": "japan", + "displayName": "Japan", + "regionalDisplayName": "Japan", + "metadata": { + "regionType": "Logical", + "regionCategory": "Other" + } + }, + { + "id": "/subscriptions/0accec26-d6de-4757-8e74-d080f38eaaab/locations/uk", + "name": "uk", + "displayName": "United Kingdom", + "regionalDisplayName": "United Kingdom", + "metadata": { + "regionType": "Logical", + "regionCategory": "Other" + } + }, + { + "id": "/subscriptions/0accec26-d6de-4757-8e74-d080f38eaaab/locations/unitedstates", + "name": "unitedstates", + "displayName": "United States", + "regionalDisplayName": "United States", + "metadata": { + "regionType": "Logical", + "regionCategory": "Other" + } + }, + { + "id": "/subscriptions/0accec26-d6de-4757-8e74-d080f38eaaab/locations/eastasiastage", + "name": "eastasiastage", + "displayName": "East Asia (Stage)", + "regionalDisplayName": "(Asia Pacific) East Asia (Stage)", + "metadata": { + "regionType": "Logical", + "regionCategory": "Other", + "geographyGroup": "Asia Pacific" + } + }, + { + "id": "/subscriptions/0accec26-d6de-4757-8e74-d080f38eaaab/locations/southeastasiastage", + "name": "southeastasiastage", + "displayName": "Southeast Asia (Stage)", + "regionalDisplayName": "(Asia Pacific) Southeast Asia (Stage)", + "metadata": { + "regionType": "Logical", + "regionCategory": "Other", + "geographyGroup": "Asia Pacific" + } + }, + { + "id": "/subscriptions/0accec26-d6de-4757-8e74-d080f38eaaab/locations/centraluseuap", + "name": "centraluseuap", + "displayName": "Central US EUAP", + "regionalDisplayName": "(US) Central US EUAP", + "metadata": { + "regionType": "Physical", + "regionCategory": "Other", + "geographyGroup": "US", + "longitude": "-93.6208", + "latitude": "41.5908", + "pairedRegion": [ + { + "name": "eastus2euap", + "id": "/subscriptions/0accec26-d6de-4757-8e74-d080f38eaaab/locations/eastus2euap" + } + ] + } + }, + { + "id": "/subscriptions/0accec26-d6de-4757-8e74-d080f38eaaab/locations/eastus2euap", + "name": "eastus2euap", + "displayName": "East US 2 EUAP", + "regionalDisplayName": "(US) East US 2 EUAP", + "metadata": { + "regionType": "Physical", + "regionCategory": "Other", + "geographyGroup": "US", + "longitude": "-78.3889", + "latitude": "36.6681", + "pairedRegion": [ + { + "name": "centraluseuap", + "id": "/subscriptions/0accec26-d6de-4757-8e74-d080f38eaaab/locations/centraluseuap" + } + ] + } + }, + { + "id": "/subscriptions/0accec26-d6de-4757-8e74-d080f38eaaab/locations/westcentralus", + "name": "westcentralus", + "displayName": "West Central US", + "regionalDisplayName": "(US) West Central US", + "metadata": { + "regionType": "Physical", + "regionCategory": "Other", + "geographyGroup": "US", + "longitude": "-110.234", + "latitude": "40.890", + "physicalLocation": "Wyoming", + "pairedRegion": [ + { + "name": "westus2", + "id": "/subscriptions/0accec26-d6de-4757-8e74-d080f38eaaab/locations/westus2" + } + ] + } + }, + { + "id": "/subscriptions/0accec26-d6de-4757-8e74-d080f38eaaab/locations/southafricawest", + "name": "southafricawest", + "displayName": "South Africa West", + "regionalDisplayName": "(Africa) South Africa West", + "metadata": { + "regionType": "Physical", + "regionCategory": "Other", + "geographyGroup": "Africa", + "longitude": "18.843266", + "latitude": "-34.075691", + "physicalLocation": "Cape Town", + "pairedRegion": [ + { + "name": "southafricanorth", + "id": "/subscriptions/0accec26-d6de-4757-8e74-d080f38eaaab/locations/southafricanorth" + } + ] + } + }, + { + "id": "/subscriptions/0accec26-d6de-4757-8e74-d080f38eaaab/locations/australiacentral", + "name": "australiacentral", + "displayName": "Australia Central", + "regionalDisplayName": "(Asia Pacific) Australia Central", + "metadata": { + "regionType": "Physical", + "regionCategory": "Other", + "geographyGroup": "Asia Pacific", + "longitude": "149.1244", + "latitude": "-35.3075", + "physicalLocation": "Canberra", + "pairedRegion": [ + { + "name": "australiacentral", + "id": "/subscriptions/0accec26-d6de-4757-8e74-d080f38eaaab/locations/australiacentral" + } + ] + } + }, + { + "id": "/subscriptions/0accec26-d6de-4757-8e74-d080f38eaaab/locations/australiacentral2", + "name": "australiacentral2", + "displayName": "Australia Central 2", + "regionalDisplayName": "(Asia Pacific) Australia Central 2", + "metadata": { + "regionType": "Physical", + "regionCategory": "Other", + "geographyGroup": "Asia Pacific", + "longitude": "149.1244", + "latitude": "-35.3075", + "physicalLocation": "Canberra", + "pairedRegion": [ + { + "name": "australiacentral2", + "id": "/subscriptions/0accec26-d6de-4757-8e74-d080f38eaaab/locations/australiacentral2" + } + ] + } + }, + { + "id": "/subscriptions/0accec26-d6de-4757-8e74-d080f38eaaab/locations/australiasoutheast", + "name": "australiasoutheast", + "displayName": "Australia Southeast", + "regionalDisplayName": "(Asia Pacific) Australia Southeast", + "metadata": { + "regionType": "Physical", + "regionCategory": "Other", + "geographyGroup": "Asia Pacific", + "longitude": "144.9631", + "latitude": "-37.8136", + "physicalLocation": "Victoria", + "pairedRegion": [ + { + "name": "australiaeast", + "id": "/subscriptions/0accec26-d6de-4757-8e74-d080f38eaaab/locations/australiaeast" + } + ] + } + }, + { + "id": "/subscriptions/0accec26-d6de-4757-8e74-d080f38eaaab/locations/japanwest", + "name": "japanwest", + "displayName": "Japan West", + "regionalDisplayName": "(Asia Pacific) Japan West", + "metadata": { + "regionType": "Physical", + "regionCategory": "Other", + "geographyGroup": "Asia Pacific", + "longitude": "135.5022", + "latitude": "34.6939", + "physicalLocation": "Osaka", + "pairedRegion": [ + { + "name": "japaneast", + "id": "/subscriptions/0accec26-d6de-4757-8e74-d080f38eaaab/locations/japaneast" + } + ] + } + }, + { + "id": "/subscriptions/0accec26-d6de-4757-8e74-d080f38eaaab/locations/jioindiacentral", + "name": "jioindiacentral", + "displayName": "Jio India Central", + "regionalDisplayName": "(Asia Pacific) Jio India Central", + "metadata": { + "regionType": "Physical", + "regionCategory": "Other", + "geographyGroup": "Asia Pacific", + "longitude": "79.08886", + "latitude": "21.146633", + "physicalLocation": "Nagpur", + "pairedRegion": [ + { + "name": "jioindiawest", + "id": "/subscriptions/0accec26-d6de-4757-8e74-d080f38eaaab/locations/jioindiawest" + } + ] + } + }, + { + "id": "/subscriptions/0accec26-d6de-4757-8e74-d080f38eaaab/locations/koreasouth", + "name": "koreasouth", + "displayName": "Korea South", + "regionalDisplayName": "(Asia Pacific) Korea South", + "metadata": { + "regionType": "Physical", + "regionCategory": "Other", + "geographyGroup": "Asia Pacific", + "longitude": "129.0756", + "latitude": "35.1796", + "physicalLocation": "Busan", + "pairedRegion": [ + { + "name": "koreacentral", + "id": "/subscriptions/0accec26-d6de-4757-8e74-d080f38eaaab/locations/koreacentral" + } + ] + } + }, + { + "id": "/subscriptions/0accec26-d6de-4757-8e74-d080f38eaaab/locations/southindia", + "name": "southindia", + "displayName": "South India", + "regionalDisplayName": "(Asia Pacific) South India", + "metadata": { + "regionType": "Physical", + "regionCategory": "Other", + "geographyGroup": "Asia Pacific", + "longitude": "80.1636", + "latitude": "12.9822", + "physicalLocation": "Chennai", + "pairedRegion": [ + { + "name": "centralindia", + "id": "/subscriptions/0accec26-d6de-4757-8e74-d080f38eaaab/locations/centralindia" + } + ] + } + }, + { + "id": "/subscriptions/0accec26-d6de-4757-8e74-d080f38eaaab/locations/westindia", + "name": "westindia", + "displayName": "West India", + "regionalDisplayName": "(Asia Pacific) West India", + "metadata": { + "regionType": "Physical", + "regionCategory": "Other", + "geographyGroup": "Asia Pacific", + "longitude": "72.868", + "latitude": "19.088", + "physicalLocation": "Mumbai", + "pairedRegion": [ + { + "name": "southindia", + "id": "/subscriptions/0accec26-d6de-4757-8e74-d080f38eaaab/locations/southindia" + } + ] + } + }, + { + "id": "/subscriptions/0accec26-d6de-4757-8e74-d080f38eaaab/locations/canadaeast", + "name": "canadaeast", + "displayName": "Canada East", + "regionalDisplayName": "(Canada) Canada East", + "metadata": { + "regionType": "Physical", + "regionCategory": "Other", + "geographyGroup": "Canada", + "longitude": "-71.217", + "latitude": "46.817", + "physicalLocation": "Quebec", + "pairedRegion": [ + { + "name": "canadacentral", + "id": "/subscriptions/0accec26-d6de-4757-8e74-d080f38eaaab/locations/canadacentral" + } + ] + } + }, + { + "id": "/subscriptions/0accec26-d6de-4757-8e74-d080f38eaaab/locations/francesouth", + "name": "francesouth", + "displayName": "France South", + "regionalDisplayName": "(Europe) France South", + "metadata": { + "regionType": "Physical", + "regionCategory": "Other", + "geographyGroup": "Europe", + "longitude": "2.1972", + "latitude": "43.8345", + "physicalLocation": "Marseille", + "pairedRegion": [ + { + "name": "francecentral", + "id": "/subscriptions/0accec26-d6de-4757-8e74-d080f38eaaab/locations/francecentral" + } + ] + } + }, + { + "id": "/subscriptions/0accec26-d6de-4757-8e74-d080f38eaaab/locations/germanynorth", + "name": "germanynorth", + "displayName": "Germany North", + "regionalDisplayName": "(Europe) Germany North", + "metadata": { + "regionType": "Physical", + "regionCategory": "Other", + "geographyGroup": "Europe", + "longitude": "8.806422", + "latitude": "53.073635", + "physicalLocation": "Berlin", + "pairedRegion": [ + { + "name": "germanywestcentral", + "id": "/subscriptions/0accec26-d6de-4757-8e74-d080f38eaaab/locations/germanywestcentral" + } + ] + } + }, + { + "id": "/subscriptions/0accec26-d6de-4757-8e74-d080f38eaaab/locations/norwaywest", + "name": "norwaywest", + "displayName": "Norway West", + "regionalDisplayName": "(Europe) Norway West", + "metadata": { + "regionType": "Physical", + "regionCategory": "Other", + "geographyGroup": "Europe", + "longitude": "5.733107", + "latitude": "58.969975", + "physicalLocation": "Norway", + "pairedRegion": [ + { + "name": "norwayeast", + "id": "/subscriptions/0accec26-d6de-4757-8e74-d080f38eaaab/locations/norwayeast" + } + ] + } + }, + { + "id": "/subscriptions/0accec26-d6de-4757-8e74-d080f38eaaab/locations/swedensouth", + "name": "swedensouth", + "displayName": "Sweden South", + "regionalDisplayName": "(Europe) Sweden South", + "metadata": { + "regionType": "Physical", + "regionCategory": "Other", + "geographyGroup": "Europe", + "longitude": "13.0007", + "latitude": "55.6059", + "physicalLocation": "Malmo", + "pairedRegion": [ + { + "name": "swedencentral", + "id": "/subscriptions/0accec26-d6de-4757-8e74-d080f38eaaab/locations/swedencentral" + } + ] + } + }, + { + "id": "/subscriptions/0accec26-d6de-4757-8e74-d080f38eaaab/locations/switzerlandwest", + "name": "switzerlandwest", + "displayName": "Switzerland West", + "regionalDisplayName": "(Europe) Switzerland West", + "metadata": { + "regionType": "Physical", + "regionCategory": "Other", + "geographyGroup": "Europe", + "longitude": "6.143158", + "latitude": "46.204391", + "physicalLocation": "Geneva", + "pairedRegion": [ + { + "name": "switzerlandnorth", + "id": "/subscriptions/0accec26-d6de-4757-8e74-d080f38eaaab/locations/switzerlandnorth" + } + ] + } + }, + { + "id": "/subscriptions/0accec26-d6de-4757-8e74-d080f38eaaab/locations/ukwest", + "name": "ukwest", + "displayName": "UK West", + "regionalDisplayName": "(Europe) UK West", + "metadata": { + "regionType": "Physical", + "regionCategory": "Other", + "geographyGroup": "Europe", + "longitude": "-3.084", + "latitude": "53.427", + "physicalLocation": "Cardiff", + "pairedRegion": [ + { + "name": "uksouth", + "id": "/subscriptions/0accec26-d6de-4757-8e74-d080f38eaaab/locations/uksouth" + } + ] + } + }, + { + "id": "/subscriptions/0accec26-d6de-4757-8e74-d080f38eaaab/locations/uaecentral", + "name": "uaecentral", + "displayName": "UAE Central", + "regionalDisplayName": "(Middle East) UAE Central", + "metadata": { + "regionType": "Physical", + "regionCategory": "Other", + "geographyGroup": "Middle East", + "longitude": "54.366669", + "latitude": "24.466667", + "physicalLocation": "Abu Dhabi", + "pairedRegion": [ + { + "name": "uaenorth", + "id": "/subscriptions/0accec26-d6de-4757-8e74-d080f38eaaab/locations/uaenorth" + } + ] + } + }, + { + "id": "/subscriptions/0accec26-d6de-4757-8e74-d080f38eaaab/locations/brazilsoutheast", + "name": "brazilsoutheast", + "displayName": "Brazil Southeast", + "regionalDisplayName": "(South America) Brazil Southeast", + "metadata": { + "regionType": "Physical", + "regionCategory": "Other", + "geographyGroup": "South America", + "longitude": "-43.2075", + "latitude": "-22.90278", + "physicalLocation": "Rio", + "pairedRegion": [ + { + "name": "brazilsouth", + "id": "/subscriptions/0accec26-d6de-4757-8e74-d080f38eaaab/locations/brazilsouth" + } + ] + } + }, + { + "id": "/subscriptions/0accec26-d6de-4757-8e74-d080f38eaaab/locations/eastusslv", + "name": "eastusslv", + "displayName": "East US SLV", + "regionalDisplayName": "(South America) East US SLV", + "metadata": { + "regionType": "Physical", + "regionCategory": "Other", + "geographyGroup": "South America", + "longitude": "-43.2075", + "latitude": "-22.90278", + "physicalLocation": "Silverstone", + "pairedRegion": [ + { + "name": "eastusslv", + "id": "/subscriptions/0accec26-d6de-4757-8e74-d080f38eaaab/locations/eastusslv" + } + ] + } + } + ] + } + } + ], + "Variables": { + "RandomSeed": "447860200", + "SUBSCRIPTION_ID": "0accec26-d6de-4757-8e74-d080f38eaaab" + } +} \ No newline at end of file diff --git a/sdk/resourcemanager/Azure.ResourceManager.Core/tests/SessionRecords/SubscriptionOperationsTests/TestListLocationsAsync.json b/sdk/resourcemanager/Azure.ResourceManager.Core/tests/SessionRecords/SubscriptionOperationsTests/TestListLocationsAsync.json new file mode 100644 index 000000000000..e0d681960e30 --- /dev/null +++ b/sdk/resourcemanager/Azure.ResourceManager.Core/tests/SessionRecords/SubscriptionOperationsTests/TestListLocationsAsync.json @@ -0,0 +1,1314 @@ +{ + "Entries": [ + { + "RequestUri": "https://management.azure.com/subscriptions/0accec26-d6de-4757-8e74-d080f38eaaab?api-version=2019-11-01", + "RequestMethod": "GET", + "RequestHeaders": { + "Accept": "application/json", + "Authorization": "Sanitized", + "User-Agent": [ + "azsdk-net-ResourceManager.Core/1.0.0-alpha.20210508.1", + "(.NET Core 4.6.29916.01; Microsoft Windows 10.0.19043 )" + ], + "x-ms-client-request-id": "d5297965a35fe87594fd2910c880af86", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "Cache-Control": "no-cache", + "Content-Length": "403", + "Content-Type": "application/json; charset=utf-8", + "Date": "Sat, 08 May 2021 02:33:42 GMT", + "Expires": "-1", + "Pragma": "no-cache", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains", + "X-Content-Type-Options": "nosniff", + "x-ms-correlation-request-id": "aef6cb66-3ba6-485f-bfae-1f8523fd8ff6", + "x-ms-ratelimit-remaining-subscription-reads": "11998", + "x-ms-request-id": "aef6cb66-3ba6-485f-bfae-1f8523fd8ff6", + "x-ms-routing-request-id": "SOUTHEASTASIA:20210508T023343Z:aef6cb66-3ba6-485f-bfae-1f8523fd8ff6" + }, + "ResponseBody": { + "id": "/subscriptions/0accec26-d6de-4757-8e74-d080f38eaaab", + "authorizationSource": "RoleBased", + "managedByTenants": [], + "subscriptionId": "0accec26-d6de-4757-8e74-d080f38eaaab", + "tenantId": "72f988bf-86f1-41af-91ab-2d7cd011db47", + "displayName": "ACR - TEST - China Team", + "state": "Enabled", + "subscriptionPolicies": { + "locationPlacementId": "Internal_2014-09-01", + "quotaId": "Internal_2014-09-01", + "spendingLimit": "Off" + } + } + }, + { + "RequestUri": "https://management.azure.com/subscriptions/0accec26-d6de-4757-8e74-d080f38eaaab/locations?api-version=2019-11-01", + "RequestMethod": "GET", + "RequestHeaders": { + "Accept": "application/json", + "Authorization": "Sanitized", + "traceparent": "00-0c54c2946a87d64aa2b073c9ca6e8804-a82aaf9c07165f4c-00", + "User-Agent": [ + "azsdk-net-ResourceManager.Core/1.0.0-alpha.20210508.1", + "(.NET Core 4.6.29916.01; Microsoft Windows 10.0.19043 )" + ], + "x-ms-client-request-id": "637cbc33382c6672f24277800d57d7cd", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "Cache-Control": "no-cache", + "Content-Length": "28880", + "Content-Type": "application/json; charset=utf-8", + "Date": "Sat, 08 May 2021 02:33:44 GMT", + "Expires": "-1", + "Pragma": "no-cache", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains", + "X-Content-Type-Options": "nosniff", + "x-ms-correlation-request-id": "99b07d3c-5a02-4b72-8bc4-0e01d89eceab", + "x-ms-ratelimit-remaining-subscription-reads": "11997", + "x-ms-request-id": "99b07d3c-5a02-4b72-8bc4-0e01d89eceab", + "x-ms-routing-request-id": "SOUTHEASTASIA:20210508T023344Z:99b07d3c-5a02-4b72-8bc4-0e01d89eceab" + }, + "ResponseBody": { + "value": [ + { + "id": "/subscriptions/0accec26-d6de-4757-8e74-d080f38eaaab/locations/eastus", + "name": "eastus", + "displayName": "East US", + "regionalDisplayName": "(US) East US", + "metadata": { + "regionType": "Physical", + "regionCategory": "Recommended", + "geographyGroup": "US", + "longitude": "-79.8164", + "latitude": "37.3719", + "physicalLocation": "Virginia", + "pairedRegion": [ + { + "name": "westus", + "id": "/subscriptions/0accec26-d6de-4757-8e74-d080f38eaaab/locations/westus" + } + ] + } + }, + { + "id": "/subscriptions/0accec26-d6de-4757-8e74-d080f38eaaab/locations/eastus2", + "name": "eastus2", + "displayName": "East US 2", + "regionalDisplayName": "(US) East US 2", + "metadata": { + "regionType": "Physical", + "regionCategory": "Recommended", + "geographyGroup": "US", + "longitude": "-78.3889", + "latitude": "36.6681", + "physicalLocation": "Virginia", + "pairedRegion": [ + { + "name": "centralus", + "id": "/subscriptions/0accec26-d6de-4757-8e74-d080f38eaaab/locations/centralus" + } + ] + } + }, + { + "id": "/subscriptions/0accec26-d6de-4757-8e74-d080f38eaaab/locations/eastusstg", + "name": "eastusstg", + "displayName": "East US STG", + "regionalDisplayName": "(US) East US STG", + "metadata": { + "regionType": "Physical", + "regionCategory": "Recommended", + "geographyGroup": "US", + "longitude": "-79.8164", + "latitude": "37.3719", + "physicalLocation": "Virginia", + "pairedRegion": [ + { + "name": "southcentralusstg", + "id": "/subscriptions/0accec26-d6de-4757-8e74-d080f38eaaab/locations/southcentralusstg" + } + ] + } + }, + { + "id": "/subscriptions/0accec26-d6de-4757-8e74-d080f38eaaab/locations/southcentralus", + "name": "southcentralus", + "displayName": "South Central US", + "regionalDisplayName": "(US) South Central US", + "metadata": { + "regionType": "Physical", + "regionCategory": "Recommended", + "geographyGroup": "US", + "longitude": "-98.5", + "latitude": "29.4167", + "physicalLocation": "Texas", + "pairedRegion": [ + { + "name": "northcentralus", + "id": "/subscriptions/0accec26-d6de-4757-8e74-d080f38eaaab/locations/northcentralus" + } + ] + } + }, + { + "id": "/subscriptions/0accec26-d6de-4757-8e74-d080f38eaaab/locations/southcentralusstg", + "name": "southcentralusstg", + "displayName": "South Central US STG", + "regionalDisplayName": "(US) South Central US STG", + "metadata": { + "regionType": "Physical", + "regionCategory": "Recommended", + "geographyGroup": "US", + "longitude": "-98.5", + "latitude": "29.4167", + "physicalLocation": "Texas", + "pairedRegion": [ + { + "name": "eastusstg", + "id": "/subscriptions/0accec26-d6de-4757-8e74-d080f38eaaab/locations/eastusstg" + } + ] + } + }, + { + "id": "/subscriptions/0accec26-d6de-4757-8e74-d080f38eaaab/locations/westus2", + "name": "westus2", + "displayName": "West US 2", + "regionalDisplayName": "(US) West US 2", + "metadata": { + "regionType": "Physical", + "regionCategory": "Recommended", + "geographyGroup": "US", + "longitude": "-119.852", + "latitude": "47.233", + "physicalLocation": "Washington", + "pairedRegion": [ + { + "name": "westcentralus", + "id": "/subscriptions/0accec26-d6de-4757-8e74-d080f38eaaab/locations/westcentralus" + } + ] + } + }, + { + "id": "/subscriptions/0accec26-d6de-4757-8e74-d080f38eaaab/locations/westus3", + "name": "westus3", + "displayName": "West US 3", + "regionalDisplayName": "(US) West US 3", + "metadata": { + "regionType": "Physical", + "regionCategory": "Recommended", + "geographyGroup": "US", + "longitude": "-112.074036", + "latitude": "33.448376", + "physicalLocation": "Phoenix", + "pairedRegion": [ + { + "name": "eastus", + "id": "/subscriptions/0accec26-d6de-4757-8e74-d080f38eaaab/locations/eastus" + } + ] + } + }, + { + "id": "/subscriptions/0accec26-d6de-4757-8e74-d080f38eaaab/locations/australiaeast", + "name": "australiaeast", + "displayName": "Australia East", + "regionalDisplayName": "(Asia Pacific) Australia East", + "metadata": { + "regionType": "Physical", + "regionCategory": "Recommended", + "geographyGroup": "Asia Pacific", + "longitude": "151.2094", + "latitude": "-33.86", + "physicalLocation": "New South Wales", + "pairedRegion": [ + { + "name": "australiasoutheast", + "id": "/subscriptions/0accec26-d6de-4757-8e74-d080f38eaaab/locations/australiasoutheast" + } + ] + } + }, + { + "id": "/subscriptions/0accec26-d6de-4757-8e74-d080f38eaaab/locations/southeastasia", + "name": "southeastasia", + "displayName": "Southeast Asia", + "regionalDisplayName": "(Asia Pacific) Southeast Asia", + "metadata": { + "regionType": "Physical", + "regionCategory": "Recommended", + "geographyGroup": "Asia Pacific", + "longitude": "103.833", + "latitude": "1.283", + "physicalLocation": "Singapore", + "pairedRegion": [ + { + "name": "eastasia", + "id": "/subscriptions/0accec26-d6de-4757-8e74-d080f38eaaab/locations/eastasia" + } + ] + } + }, + { + "id": "/subscriptions/0accec26-d6de-4757-8e74-d080f38eaaab/locations/northeurope", + "name": "northeurope", + "displayName": "North Europe", + "regionalDisplayName": "(Europe) North Europe", + "metadata": { + "regionType": "Physical", + "regionCategory": "Recommended", + "geographyGroup": "Europe", + "longitude": "-6.2597", + "latitude": "53.3478", + "physicalLocation": "Ireland", + "pairedRegion": [ + { + "name": "westeurope", + "id": "/subscriptions/0accec26-d6de-4757-8e74-d080f38eaaab/locations/westeurope" + } + ] + } + }, + { + "id": "/subscriptions/0accec26-d6de-4757-8e74-d080f38eaaab/locations/swedencentral", + "name": "swedencentral", + "displayName": "Sweden Central", + "regionalDisplayName": "(Europe) Sweden Central", + "metadata": { + "regionType": "Physical", + "regionCategory": "Recommended", + "geographyGroup": "Europe", + "longitude": "17.14127", + "latitude": "60.67488", + "physicalLocation": "G\u00E4vle", + "pairedRegion": [ + { + "name": "swedensouth", + "id": "/subscriptions/0accec26-d6de-4757-8e74-d080f38eaaab/locations/swedensouth" + } + ] + } + }, + { + "id": "/subscriptions/0accec26-d6de-4757-8e74-d080f38eaaab/locations/uksouth", + "name": "uksouth", + "displayName": "UK South", + "regionalDisplayName": "(Europe) UK South", + "metadata": { + "regionType": "Physical", + "regionCategory": "Recommended", + "geographyGroup": "Europe", + "longitude": "-0.799", + "latitude": "50.941", + "physicalLocation": "London", + "pairedRegion": [ + { + "name": "ukwest", + "id": "/subscriptions/0accec26-d6de-4757-8e74-d080f38eaaab/locations/ukwest" + } + ] + } + }, + { + "id": "/subscriptions/0accec26-d6de-4757-8e74-d080f38eaaab/locations/westeurope", + "name": "westeurope", + "displayName": "West Europe", + "regionalDisplayName": "(Europe) West Europe", + "metadata": { + "regionType": "Physical", + "regionCategory": "Recommended", + "geographyGroup": "Europe", + "longitude": "4.9", + "latitude": "52.3667", + "physicalLocation": "Netherlands", + "pairedRegion": [ + { + "name": "northeurope", + "id": "/subscriptions/0accec26-d6de-4757-8e74-d080f38eaaab/locations/northeurope" + } + ] + } + }, + { + "id": "/subscriptions/0accec26-d6de-4757-8e74-d080f38eaaab/locations/centralus", + "name": "centralus", + "displayName": "Central US", + "regionalDisplayName": "(US) Central US", + "metadata": { + "regionType": "Physical", + "regionCategory": "Recommended", + "geographyGroup": "US", + "longitude": "-93.6208", + "latitude": "41.5908", + "physicalLocation": "Iowa", + "pairedRegion": [ + { + "name": "eastus2", + "id": "/subscriptions/0accec26-d6de-4757-8e74-d080f38eaaab/locations/eastus2" + } + ] + } + }, + { + "id": "/subscriptions/0accec26-d6de-4757-8e74-d080f38eaaab/locations/northcentralus", + "name": "northcentralus", + "displayName": "North Central US", + "regionalDisplayName": "(US) North Central US", + "metadata": { + "regionType": "Physical", + "regionCategory": "Recommended", + "geographyGroup": "US", + "longitude": "-87.6278", + "latitude": "41.8819", + "physicalLocation": "Illinois", + "pairedRegion": [ + { + "name": "southcentralus", + "id": "/subscriptions/0accec26-d6de-4757-8e74-d080f38eaaab/locations/southcentralus" + } + ] + } + }, + { + "id": "/subscriptions/0accec26-d6de-4757-8e74-d080f38eaaab/locations/westus", + "name": "westus", + "displayName": "West US", + "regionalDisplayName": "(US) West US", + "metadata": { + "regionType": "Physical", + "regionCategory": "Recommended", + "geographyGroup": "US", + "longitude": "-122.417", + "latitude": "37.783", + "physicalLocation": "California", + "pairedRegion": [ + { + "name": "eastus", + "id": "/subscriptions/0accec26-d6de-4757-8e74-d080f38eaaab/locations/eastus" + } + ] + } + }, + { + "id": "/subscriptions/0accec26-d6de-4757-8e74-d080f38eaaab/locations/southafricanorth", + "name": "southafricanorth", + "displayName": "South Africa North", + "regionalDisplayName": "(Africa) South Africa North", + "metadata": { + "regionType": "Physical", + "regionCategory": "Recommended", + "geographyGroup": "Africa", + "longitude": "28.218370", + "latitude": "-25.731340", + "physicalLocation": "Johannesburg", + "pairedRegion": [ + { + "name": "southafricawest", + "id": "/subscriptions/0accec26-d6de-4757-8e74-d080f38eaaab/locations/southafricawest" + } + ] + } + }, + { + "id": "/subscriptions/0accec26-d6de-4757-8e74-d080f38eaaab/locations/centralindia", + "name": "centralindia", + "displayName": "Central India", + "regionalDisplayName": "(Asia Pacific) Central India", + "metadata": { + "regionType": "Physical", + "regionCategory": "Recommended", + "geographyGroup": "Asia Pacific", + "longitude": "73.9197", + "latitude": "18.5822", + "physicalLocation": "Pune", + "pairedRegion": [ + { + "name": "southindia", + "id": "/subscriptions/0accec26-d6de-4757-8e74-d080f38eaaab/locations/southindia" + } + ] + } + }, + { + "id": "/subscriptions/0accec26-d6de-4757-8e74-d080f38eaaab/locations/eastasia", + "name": "eastasia", + "displayName": "East Asia", + "regionalDisplayName": "(Asia Pacific) East Asia", + "metadata": { + "regionType": "Physical", + "regionCategory": "Recommended", + "geographyGroup": "Asia Pacific", + "longitude": "114.188", + "latitude": "22.267", + "physicalLocation": "Hong Kong", + "pairedRegion": [ + { + "name": "southeastasia", + "id": "/subscriptions/0accec26-d6de-4757-8e74-d080f38eaaab/locations/southeastasia" + } + ] + } + }, + { + "id": "/subscriptions/0accec26-d6de-4757-8e74-d080f38eaaab/locations/japaneast", + "name": "japaneast", + "displayName": "Japan East", + "regionalDisplayName": "(Asia Pacific) Japan East", + "metadata": { + "regionType": "Physical", + "regionCategory": "Recommended", + "geographyGroup": "Asia Pacific", + "longitude": "139.77", + "latitude": "35.68", + "physicalLocation": "Tokyo, Saitama", + "pairedRegion": [ + { + "name": "japanwest", + "id": "/subscriptions/0accec26-d6de-4757-8e74-d080f38eaaab/locations/japanwest" + } + ] + } + }, + { + "id": "/subscriptions/0accec26-d6de-4757-8e74-d080f38eaaab/locations/jioindiawest", + "name": "jioindiawest", + "displayName": "Jio India West", + "regionalDisplayName": "(Asia Pacific) Jio India West", + "metadata": { + "regionType": "Physical", + "regionCategory": "Recommended", + "geographyGroup": "Asia Pacific", + "longitude": "70.05773", + "latitude": "22.470701", + "physicalLocation": "Jamnagar", + "pairedRegion": [ + { + "name": "jioindiacentral", + "id": "/subscriptions/0accec26-d6de-4757-8e74-d080f38eaaab/locations/jioindiacentral" + } + ] + } + }, + { + "id": "/subscriptions/0accec26-d6de-4757-8e74-d080f38eaaab/locations/koreacentral", + "name": "koreacentral", + "displayName": "Korea Central", + "regionalDisplayName": "(Asia Pacific) Korea Central", + "metadata": { + "regionType": "Physical", + "regionCategory": "Recommended", + "geographyGroup": "Asia Pacific", + "longitude": "126.9780", + "latitude": "37.5665", + "physicalLocation": "Seoul", + "pairedRegion": [ + { + "name": "koreasouth", + "id": "/subscriptions/0accec26-d6de-4757-8e74-d080f38eaaab/locations/koreasouth" + } + ] + } + }, + { + "id": "/subscriptions/0accec26-d6de-4757-8e74-d080f38eaaab/locations/canadacentral", + "name": "canadacentral", + "displayName": "Canada Central", + "regionalDisplayName": "(Canada) Canada Central", + "metadata": { + "regionType": "Physical", + "regionCategory": "Recommended", + "geographyGroup": "Canada", + "longitude": "-79.383", + "latitude": "43.653", + "physicalLocation": "Toronto", + "pairedRegion": [ + { + "name": "canadaeast", + "id": "/subscriptions/0accec26-d6de-4757-8e74-d080f38eaaab/locations/canadaeast" + } + ] + } + }, + { + "id": "/subscriptions/0accec26-d6de-4757-8e74-d080f38eaaab/locations/francecentral", + "name": "francecentral", + "displayName": "France Central", + "regionalDisplayName": "(Europe) France Central", + "metadata": { + "regionType": "Physical", + "regionCategory": "Recommended", + "geographyGroup": "Europe", + "longitude": "2.3730", + "latitude": "46.3772", + "physicalLocation": "Paris", + "pairedRegion": [ + { + "name": "francesouth", + "id": "/subscriptions/0accec26-d6de-4757-8e74-d080f38eaaab/locations/francesouth" + } + ] + } + }, + { + "id": "/subscriptions/0accec26-d6de-4757-8e74-d080f38eaaab/locations/germanywestcentral", + "name": "germanywestcentral", + "displayName": "Germany West Central", + "regionalDisplayName": "(Europe) Germany West Central", + "metadata": { + "regionType": "Physical", + "regionCategory": "Recommended", + "geographyGroup": "Europe", + "longitude": "8.682127", + "latitude": "50.110924", + "physicalLocation": "Frankfurt", + "pairedRegion": [ + { + "name": "germanynorth", + "id": "/subscriptions/0accec26-d6de-4757-8e74-d080f38eaaab/locations/germanynorth" + } + ] + } + }, + { + "id": "/subscriptions/0accec26-d6de-4757-8e74-d080f38eaaab/locations/norwayeast", + "name": "norwayeast", + "displayName": "Norway East", + "regionalDisplayName": "(Europe) Norway East", + "metadata": { + "regionType": "Physical", + "regionCategory": "Recommended", + "geographyGroup": "Europe", + "longitude": "10.752245", + "latitude": "59.913868", + "physicalLocation": "Norway", + "pairedRegion": [ + { + "name": "norwaywest", + "id": "/subscriptions/0accec26-d6de-4757-8e74-d080f38eaaab/locations/norwaywest" + } + ] + } + }, + { + "id": "/subscriptions/0accec26-d6de-4757-8e74-d080f38eaaab/locations/switzerlandnorth", + "name": "switzerlandnorth", + "displayName": "Switzerland North", + "regionalDisplayName": "(Europe) Switzerland North", + "metadata": { + "regionType": "Physical", + "regionCategory": "Recommended", + "geographyGroup": "Europe", + "longitude": "8.564572", + "latitude": "47.451542", + "physicalLocation": "Zurich", + "pairedRegion": [ + { + "name": "switzerlandwest", + "id": "/subscriptions/0accec26-d6de-4757-8e74-d080f38eaaab/locations/switzerlandwest" + } + ] + } + }, + { + "id": "/subscriptions/0accec26-d6de-4757-8e74-d080f38eaaab/locations/uaenorth", + "name": "uaenorth", + "displayName": "UAE North", + "regionalDisplayName": "(Middle East) UAE North", + "metadata": { + "regionType": "Physical", + "regionCategory": "Recommended", + "geographyGroup": "Middle East", + "longitude": "55.316666", + "latitude": "25.266666", + "physicalLocation": "Dubai", + "pairedRegion": [ + { + "name": "uaecentral", + "id": "/subscriptions/0accec26-d6de-4757-8e74-d080f38eaaab/locations/uaecentral" + } + ] + } + }, + { + "id": "/subscriptions/0accec26-d6de-4757-8e74-d080f38eaaab/locations/brazilsouth", + "name": "brazilsouth", + "displayName": "Brazil South", + "regionalDisplayName": "(South America) Brazil South", + "metadata": { + "regionType": "Physical", + "regionCategory": "Recommended", + "geographyGroup": "South America", + "longitude": "-46.633", + "latitude": "-23.55", + "physicalLocation": "Sao Paulo State", + "pairedRegion": [ + { + "name": "southcentralus", + "id": "/subscriptions/0accec26-d6de-4757-8e74-d080f38eaaab/locations/southcentralus" + } + ] + } + }, + { + "id": "/subscriptions/0accec26-d6de-4757-8e74-d080f38eaaab/locations/centralusstage", + "name": "centralusstage", + "displayName": "Central US (Stage)", + "regionalDisplayName": "(US) Central US (Stage)", + "metadata": { + "regionType": "Logical", + "regionCategory": "Other", + "geographyGroup": "US" + } + }, + { + "id": "/subscriptions/0accec26-d6de-4757-8e74-d080f38eaaab/locations/eastusstage", + "name": "eastusstage", + "displayName": "East US (Stage)", + "regionalDisplayName": "(US) East US (Stage)", + "metadata": { + "regionType": "Logical", + "regionCategory": "Other", + "geographyGroup": "US" + } + }, + { + "id": "/subscriptions/0accec26-d6de-4757-8e74-d080f38eaaab/locations/eastus2stage", + "name": "eastus2stage", + "displayName": "East US 2 (Stage)", + "regionalDisplayName": "(US) East US 2 (Stage)", + "metadata": { + "regionType": "Logical", + "regionCategory": "Other", + "geographyGroup": "US" + } + }, + { + "id": "/subscriptions/0accec26-d6de-4757-8e74-d080f38eaaab/locations/northcentralusstage", + "name": "northcentralusstage", + "displayName": "North Central US (Stage)", + "regionalDisplayName": "(US) North Central US (Stage)", + "metadata": { + "regionType": "Logical", + "regionCategory": "Other", + "geographyGroup": "US" + } + }, + { + "id": "/subscriptions/0accec26-d6de-4757-8e74-d080f38eaaab/locations/southcentralusstage", + "name": "southcentralusstage", + "displayName": "South Central US (Stage)", + "regionalDisplayName": "(US) South Central US (Stage)", + "metadata": { + "regionType": "Logical", + "regionCategory": "Other", + "geographyGroup": "US" + } + }, + { + "id": "/subscriptions/0accec26-d6de-4757-8e74-d080f38eaaab/locations/westusstage", + "name": "westusstage", + "displayName": "West US (Stage)", + "regionalDisplayName": "(US) West US (Stage)", + "metadata": { + "regionType": "Logical", + "regionCategory": "Other", + "geographyGroup": "US" + } + }, + { + "id": "/subscriptions/0accec26-d6de-4757-8e74-d080f38eaaab/locations/westus2stage", + "name": "westus2stage", + "displayName": "West US 2 (Stage)", + "regionalDisplayName": "(US) West US 2 (Stage)", + "metadata": { + "regionType": "Logical", + "regionCategory": "Other", + "geographyGroup": "US" + } + }, + { + "id": "/subscriptions/0accec26-d6de-4757-8e74-d080f38eaaab/locations/asia", + "name": "asia", + "displayName": "Asia", + "regionalDisplayName": "Asia", + "metadata": { + "regionType": "Logical", + "regionCategory": "Other" + } + }, + { + "id": "/subscriptions/0accec26-d6de-4757-8e74-d080f38eaaab/locations/asiapacific", + "name": "asiapacific", + "displayName": "Asia Pacific", + "regionalDisplayName": "Asia Pacific", + "metadata": { + "regionType": "Logical", + "regionCategory": "Other" + } + }, + { + "id": "/subscriptions/0accec26-d6de-4757-8e74-d080f38eaaab/locations/australia", + "name": "australia", + "displayName": "Australia", + "regionalDisplayName": "Australia", + "metadata": { + "regionType": "Logical", + "regionCategory": "Other" + } + }, + { + "id": "/subscriptions/0accec26-d6de-4757-8e74-d080f38eaaab/locations/brazil", + "name": "brazil", + "displayName": "Brazil", + "regionalDisplayName": "Brazil", + "metadata": { + "regionType": "Logical", + "regionCategory": "Other" + } + }, + { + "id": "/subscriptions/0accec26-d6de-4757-8e74-d080f38eaaab/locations/canada", + "name": "canada", + "displayName": "Canada", + "regionalDisplayName": "Canada", + "metadata": { + "regionType": "Logical", + "regionCategory": "Other" + } + }, + { + "id": "/subscriptions/0accec26-d6de-4757-8e74-d080f38eaaab/locations/europe", + "name": "europe", + "displayName": "Europe", + "regionalDisplayName": "Europe", + "metadata": { + "regionType": "Logical", + "regionCategory": "Other" + } + }, + { + "id": "/subscriptions/0accec26-d6de-4757-8e74-d080f38eaaab/locations/global", + "name": "global", + "displayName": "Global", + "regionalDisplayName": "Global", + "metadata": { + "regionType": "Logical", + "regionCategory": "Other" + } + }, + { + "id": "/subscriptions/0accec26-d6de-4757-8e74-d080f38eaaab/locations/india", + "name": "india", + "displayName": "India", + "regionalDisplayName": "India", + "metadata": { + "regionType": "Logical", + "regionCategory": "Other" + } + }, + { + "id": "/subscriptions/0accec26-d6de-4757-8e74-d080f38eaaab/locations/japan", + "name": "japan", + "displayName": "Japan", + "regionalDisplayName": "Japan", + "metadata": { + "regionType": "Logical", + "regionCategory": "Other" + } + }, + { + "id": "/subscriptions/0accec26-d6de-4757-8e74-d080f38eaaab/locations/uk", + "name": "uk", + "displayName": "United Kingdom", + "regionalDisplayName": "United Kingdom", + "metadata": { + "regionType": "Logical", + "regionCategory": "Other" + } + }, + { + "id": "/subscriptions/0accec26-d6de-4757-8e74-d080f38eaaab/locations/unitedstates", + "name": "unitedstates", + "displayName": "United States", + "regionalDisplayName": "United States", + "metadata": { + "regionType": "Logical", + "regionCategory": "Other" + } + }, + { + "id": "/subscriptions/0accec26-d6de-4757-8e74-d080f38eaaab/locations/eastasiastage", + "name": "eastasiastage", + "displayName": "East Asia (Stage)", + "regionalDisplayName": "(Asia Pacific) East Asia (Stage)", + "metadata": { + "regionType": "Logical", + "regionCategory": "Other", + "geographyGroup": "Asia Pacific" + } + }, + { + "id": "/subscriptions/0accec26-d6de-4757-8e74-d080f38eaaab/locations/southeastasiastage", + "name": "southeastasiastage", + "displayName": "Southeast Asia (Stage)", + "regionalDisplayName": "(Asia Pacific) Southeast Asia (Stage)", + "metadata": { + "regionType": "Logical", + "regionCategory": "Other", + "geographyGroup": "Asia Pacific" + } + }, + { + "id": "/subscriptions/0accec26-d6de-4757-8e74-d080f38eaaab/locations/centraluseuap", + "name": "centraluseuap", + "displayName": "Central US EUAP", + "regionalDisplayName": "(US) Central US EUAP", + "metadata": { + "regionType": "Physical", + "regionCategory": "Other", + "geographyGroup": "US", + "longitude": "-93.6208", + "latitude": "41.5908", + "pairedRegion": [ + { + "name": "eastus2euap", + "id": "/subscriptions/0accec26-d6de-4757-8e74-d080f38eaaab/locations/eastus2euap" + } + ] + } + }, + { + "id": "/subscriptions/0accec26-d6de-4757-8e74-d080f38eaaab/locations/eastus2euap", + "name": "eastus2euap", + "displayName": "East US 2 EUAP", + "regionalDisplayName": "(US) East US 2 EUAP", + "metadata": { + "regionType": "Physical", + "regionCategory": "Other", + "geographyGroup": "US", + "longitude": "-78.3889", + "latitude": "36.6681", + "pairedRegion": [ + { + "name": "centraluseuap", + "id": "/subscriptions/0accec26-d6de-4757-8e74-d080f38eaaab/locations/centraluseuap" + } + ] + } + }, + { + "id": "/subscriptions/0accec26-d6de-4757-8e74-d080f38eaaab/locations/westcentralus", + "name": "westcentralus", + "displayName": "West Central US", + "regionalDisplayName": "(US) West Central US", + "metadata": { + "regionType": "Physical", + "regionCategory": "Other", + "geographyGroup": "US", + "longitude": "-110.234", + "latitude": "40.890", + "physicalLocation": "Wyoming", + "pairedRegion": [ + { + "name": "westus2", + "id": "/subscriptions/0accec26-d6de-4757-8e74-d080f38eaaab/locations/westus2" + } + ] + } + }, + { + "id": "/subscriptions/0accec26-d6de-4757-8e74-d080f38eaaab/locations/southafricawest", + "name": "southafricawest", + "displayName": "South Africa West", + "regionalDisplayName": "(Africa) South Africa West", + "metadata": { + "regionType": "Physical", + "regionCategory": "Other", + "geographyGroup": "Africa", + "longitude": "18.843266", + "latitude": "-34.075691", + "physicalLocation": "Cape Town", + "pairedRegion": [ + { + "name": "southafricanorth", + "id": "/subscriptions/0accec26-d6de-4757-8e74-d080f38eaaab/locations/southafricanorth" + } + ] + } + }, + { + "id": "/subscriptions/0accec26-d6de-4757-8e74-d080f38eaaab/locations/australiacentral", + "name": "australiacentral", + "displayName": "Australia Central", + "regionalDisplayName": "(Asia Pacific) Australia Central", + "metadata": { + "regionType": "Physical", + "regionCategory": "Other", + "geographyGroup": "Asia Pacific", + "longitude": "149.1244", + "latitude": "-35.3075", + "physicalLocation": "Canberra", + "pairedRegion": [ + { + "name": "australiacentral", + "id": "/subscriptions/0accec26-d6de-4757-8e74-d080f38eaaab/locations/australiacentral" + } + ] + } + }, + { + "id": "/subscriptions/0accec26-d6de-4757-8e74-d080f38eaaab/locations/australiacentral2", + "name": "australiacentral2", + "displayName": "Australia Central 2", + "regionalDisplayName": "(Asia Pacific) Australia Central 2", + "metadata": { + "regionType": "Physical", + "regionCategory": "Other", + "geographyGroup": "Asia Pacific", + "longitude": "149.1244", + "latitude": "-35.3075", + "physicalLocation": "Canberra", + "pairedRegion": [ + { + "name": "australiacentral2", + "id": "/subscriptions/0accec26-d6de-4757-8e74-d080f38eaaab/locations/australiacentral2" + } + ] + } + }, + { + "id": "/subscriptions/0accec26-d6de-4757-8e74-d080f38eaaab/locations/australiasoutheast", + "name": "australiasoutheast", + "displayName": "Australia Southeast", + "regionalDisplayName": "(Asia Pacific) Australia Southeast", + "metadata": { + "regionType": "Physical", + "regionCategory": "Other", + "geographyGroup": "Asia Pacific", + "longitude": "144.9631", + "latitude": "-37.8136", + "physicalLocation": "Victoria", + "pairedRegion": [ + { + "name": "australiaeast", + "id": "/subscriptions/0accec26-d6de-4757-8e74-d080f38eaaab/locations/australiaeast" + } + ] + } + }, + { + "id": "/subscriptions/0accec26-d6de-4757-8e74-d080f38eaaab/locations/japanwest", + "name": "japanwest", + "displayName": "Japan West", + "regionalDisplayName": "(Asia Pacific) Japan West", + "metadata": { + "regionType": "Physical", + "regionCategory": "Other", + "geographyGroup": "Asia Pacific", + "longitude": "135.5022", + "latitude": "34.6939", + "physicalLocation": "Osaka", + "pairedRegion": [ + { + "name": "japaneast", + "id": "/subscriptions/0accec26-d6de-4757-8e74-d080f38eaaab/locations/japaneast" + } + ] + } + }, + { + "id": "/subscriptions/0accec26-d6de-4757-8e74-d080f38eaaab/locations/jioindiacentral", + "name": "jioindiacentral", + "displayName": "Jio India Central", + "regionalDisplayName": "(Asia Pacific) Jio India Central", + "metadata": { + "regionType": "Physical", + "regionCategory": "Other", + "geographyGroup": "Asia Pacific", + "longitude": "79.08886", + "latitude": "21.146633", + "physicalLocation": "Nagpur", + "pairedRegion": [ + { + "name": "jioindiawest", + "id": "/subscriptions/0accec26-d6de-4757-8e74-d080f38eaaab/locations/jioindiawest" + } + ] + } + }, + { + "id": "/subscriptions/0accec26-d6de-4757-8e74-d080f38eaaab/locations/koreasouth", + "name": "koreasouth", + "displayName": "Korea South", + "regionalDisplayName": "(Asia Pacific) Korea South", + "metadata": { + "regionType": "Physical", + "regionCategory": "Other", + "geographyGroup": "Asia Pacific", + "longitude": "129.0756", + "latitude": "35.1796", + "physicalLocation": "Busan", + "pairedRegion": [ + { + "name": "koreacentral", + "id": "/subscriptions/0accec26-d6de-4757-8e74-d080f38eaaab/locations/koreacentral" + } + ] + } + }, + { + "id": "/subscriptions/0accec26-d6de-4757-8e74-d080f38eaaab/locations/southindia", + "name": "southindia", + "displayName": "South India", + "regionalDisplayName": "(Asia Pacific) South India", + "metadata": { + "regionType": "Physical", + "regionCategory": "Other", + "geographyGroup": "Asia Pacific", + "longitude": "80.1636", + "latitude": "12.9822", + "physicalLocation": "Chennai", + "pairedRegion": [ + { + "name": "centralindia", + "id": "/subscriptions/0accec26-d6de-4757-8e74-d080f38eaaab/locations/centralindia" + } + ] + } + }, + { + "id": "/subscriptions/0accec26-d6de-4757-8e74-d080f38eaaab/locations/westindia", + "name": "westindia", + "displayName": "West India", + "regionalDisplayName": "(Asia Pacific) West India", + "metadata": { + "regionType": "Physical", + "regionCategory": "Other", + "geographyGroup": "Asia Pacific", + "longitude": "72.868", + "latitude": "19.088", + "physicalLocation": "Mumbai", + "pairedRegion": [ + { + "name": "southindia", + "id": "/subscriptions/0accec26-d6de-4757-8e74-d080f38eaaab/locations/southindia" + } + ] + } + }, + { + "id": "/subscriptions/0accec26-d6de-4757-8e74-d080f38eaaab/locations/canadaeast", + "name": "canadaeast", + "displayName": "Canada East", + "regionalDisplayName": "(Canada) Canada East", + "metadata": { + "regionType": "Physical", + "regionCategory": "Other", + "geographyGroup": "Canada", + "longitude": "-71.217", + "latitude": "46.817", + "physicalLocation": "Quebec", + "pairedRegion": [ + { + "name": "canadacentral", + "id": "/subscriptions/0accec26-d6de-4757-8e74-d080f38eaaab/locations/canadacentral" + } + ] + } + }, + { + "id": "/subscriptions/0accec26-d6de-4757-8e74-d080f38eaaab/locations/francesouth", + "name": "francesouth", + "displayName": "France South", + "regionalDisplayName": "(Europe) France South", + "metadata": { + "regionType": "Physical", + "regionCategory": "Other", + "geographyGroup": "Europe", + "longitude": "2.1972", + "latitude": "43.8345", + "physicalLocation": "Marseille", + "pairedRegion": [ + { + "name": "francecentral", + "id": "/subscriptions/0accec26-d6de-4757-8e74-d080f38eaaab/locations/francecentral" + } + ] + } + }, + { + "id": "/subscriptions/0accec26-d6de-4757-8e74-d080f38eaaab/locations/germanynorth", + "name": "germanynorth", + "displayName": "Germany North", + "regionalDisplayName": "(Europe) Germany North", + "metadata": { + "regionType": "Physical", + "regionCategory": "Other", + "geographyGroup": "Europe", + "longitude": "8.806422", + "latitude": "53.073635", + "physicalLocation": "Berlin", + "pairedRegion": [ + { + "name": "germanywestcentral", + "id": "/subscriptions/0accec26-d6de-4757-8e74-d080f38eaaab/locations/germanywestcentral" + } + ] + } + }, + { + "id": "/subscriptions/0accec26-d6de-4757-8e74-d080f38eaaab/locations/norwaywest", + "name": "norwaywest", + "displayName": "Norway West", + "regionalDisplayName": "(Europe) Norway West", + "metadata": { + "regionType": "Physical", + "regionCategory": "Other", + "geographyGroup": "Europe", + "longitude": "5.733107", + "latitude": "58.969975", + "physicalLocation": "Norway", + "pairedRegion": [ + { + "name": "norwayeast", + "id": "/subscriptions/0accec26-d6de-4757-8e74-d080f38eaaab/locations/norwayeast" + } + ] + } + }, + { + "id": "/subscriptions/0accec26-d6de-4757-8e74-d080f38eaaab/locations/swedensouth", + "name": "swedensouth", + "displayName": "Sweden South", + "regionalDisplayName": "(Europe) Sweden South", + "metadata": { + "regionType": "Physical", + "regionCategory": "Other", + "geographyGroup": "Europe", + "longitude": "13.0007", + "latitude": "55.6059", + "physicalLocation": "Malmo", + "pairedRegion": [ + { + "name": "swedencentral", + "id": "/subscriptions/0accec26-d6de-4757-8e74-d080f38eaaab/locations/swedencentral" + } + ] + } + }, + { + "id": "/subscriptions/0accec26-d6de-4757-8e74-d080f38eaaab/locations/switzerlandwest", + "name": "switzerlandwest", + "displayName": "Switzerland West", + "regionalDisplayName": "(Europe) Switzerland West", + "metadata": { + "regionType": "Physical", + "regionCategory": "Other", + "geographyGroup": "Europe", + "longitude": "6.143158", + "latitude": "46.204391", + "physicalLocation": "Geneva", + "pairedRegion": [ + { + "name": "switzerlandnorth", + "id": "/subscriptions/0accec26-d6de-4757-8e74-d080f38eaaab/locations/switzerlandnorth" + } + ] + } + }, + { + "id": "/subscriptions/0accec26-d6de-4757-8e74-d080f38eaaab/locations/ukwest", + "name": "ukwest", + "displayName": "UK West", + "regionalDisplayName": "(Europe) UK West", + "metadata": { + "regionType": "Physical", + "regionCategory": "Other", + "geographyGroup": "Europe", + "longitude": "-3.084", + "latitude": "53.427", + "physicalLocation": "Cardiff", + "pairedRegion": [ + { + "name": "uksouth", + "id": "/subscriptions/0accec26-d6de-4757-8e74-d080f38eaaab/locations/uksouth" + } + ] + } + }, + { + "id": "/subscriptions/0accec26-d6de-4757-8e74-d080f38eaaab/locations/uaecentral", + "name": "uaecentral", + "displayName": "UAE Central", + "regionalDisplayName": "(Middle East) UAE Central", + "metadata": { + "regionType": "Physical", + "regionCategory": "Other", + "geographyGroup": "Middle East", + "longitude": "54.366669", + "latitude": "24.466667", + "physicalLocation": "Abu Dhabi", + "pairedRegion": [ + { + "name": "uaenorth", + "id": "/subscriptions/0accec26-d6de-4757-8e74-d080f38eaaab/locations/uaenorth" + } + ] + } + }, + { + "id": "/subscriptions/0accec26-d6de-4757-8e74-d080f38eaaab/locations/brazilsoutheast", + "name": "brazilsoutheast", + "displayName": "Brazil Southeast", + "regionalDisplayName": "(South America) Brazil Southeast", + "metadata": { + "regionType": "Physical", + "regionCategory": "Other", + "geographyGroup": "South America", + "longitude": "-43.2075", + "latitude": "-22.90278", + "physicalLocation": "Rio", + "pairedRegion": [ + { + "name": "brazilsouth", + "id": "/subscriptions/0accec26-d6de-4757-8e74-d080f38eaaab/locations/brazilsouth" + } + ] + } + }, + { + "id": "/subscriptions/0accec26-d6de-4757-8e74-d080f38eaaab/locations/eastusslv", + "name": "eastusslv", + "displayName": "East US SLV", + "regionalDisplayName": "(South America) East US SLV", + "metadata": { + "regionType": "Physical", + "regionCategory": "Other", + "geographyGroup": "South America", + "longitude": "-43.2075", + "latitude": "-22.90278", + "physicalLocation": "Silverstone", + "pairedRegion": [ + { + "name": "eastusslv", + "id": "/subscriptions/0accec26-d6de-4757-8e74-d080f38eaaab/locations/eastusslv" + } + ] + } + } + ] + } + } + ], + "Variables": { + "RandomSeed": "1594143768", + "SUBSCRIPTION_ID": "0accec26-d6de-4757-8e74-d080f38eaaab" + } +} \ No newline at end of file From ba9dc1ca8e480e81ece7e3e12435d950be082d81 Mon Sep 17 00:00:00 2001 From: Harvey Chen <30464227+HarveyLink@users.noreply.github.com> Date: Mon, 10 May 2021 13:56:00 +0800 Subject: [PATCH 09/16] Update ClientContextTests.cs --- .../tests/Scenario/ClientContextTests.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sdk/resourcemanager/Azure.ResourceManager.Core/tests/Scenario/ClientContextTests.cs b/sdk/resourcemanager/Azure.ResourceManager.Core/tests/Scenario/ClientContextTests.cs index b1fd4433c21c..09cab9dc452f 100644 --- a/sdk/resourcemanager/Azure.ResourceManager.Core/tests/Scenario/ClientContextTests.cs +++ b/sdk/resourcemanager/Azure.ResourceManager.Core/tests/Scenario/ClientContextTests.cs @@ -28,13 +28,13 @@ public async Task TestClientContextPolicy() Console.WriteLine("-----Client 1-----"); _ = await client1.DefaultSubscription.GetResourceGroups().Construct(LocationData.WestUS2).CreateOrUpdateAsync(Recording.GenerateAssetName("testrg")); - Assert.AreEqual(2, dummyPolicy1.numMsgGot); + Assert.AreEqual(1, dummyPolicy1.numMsgGot); options1.AddPolicy(dummyPolicy2, HttpPipelinePosition.PerCall); _ = await client1.DefaultSubscription.GetResourceGroups().Construct(LocationData.WestUS2).CreateOrUpdateAsync(Recording.GenerateAssetName("test2Rg-")); - Assert.AreEqual(3, dummyPolicy1.numMsgGot); + Assert.AreEqual(2, dummyPolicy1.numMsgGot); Assert.AreEqual(0, dummyPolicy2.numMsgGot); } From 1883fbcbb212712c1a0fda4448f57b2a6fda61d1 Mon Sep 17 00:00:00 2001 From: Harvey Chen <30464227+HarveyLink@users.noreply.github.com> Date: Tue, 11 May 2021 13:59:40 +0800 Subject: [PATCH 10/16] update based on comments --- .../src/Generated/SubscriptionData.cs | 14 ++- .../src/Subscription.cs | 11 ++ .../src/SubscriptionContainer.cs | 76 ++++++++++--- .../src/SubscriptionOperations.cs | 104 +++++------------ .../Scenario/SubscriptionContainerTests.cs | 30 +++++ .../Scenario/SubscriptionOperationsTests.cs | 8 -- .../SubscriptionContainerTests/List().json | 105 ++++++++++++++++++ .../List()Async.json | 105 ++++++++++++++++++ 8 files changed, 351 insertions(+), 102 deletions(-) create mode 100644 sdk/resourcemanager/Azure.ResourceManager.Core/tests/Scenario/SubscriptionContainerTests.cs create mode 100644 sdk/resourcemanager/Azure.ResourceManager.Core/tests/SessionRecords/SubscriptionContainerTests/List().json create mode 100644 sdk/resourcemanager/Azure.ResourceManager.Core/tests/SessionRecords/SubscriptionContainerTests/List()Async.json diff --git a/sdk/resourcemanager/Azure.ResourceManager.Core/src/Generated/SubscriptionData.cs b/sdk/resourcemanager/Azure.ResourceManager.Core/src/Generated/SubscriptionData.cs index db74ce64de17..745e0f3f970e 100644 --- a/sdk/resourcemanager/Azure.ResourceManager.Core/src/Generated/SubscriptionData.cs +++ b/sdk/resourcemanager/Azure.ResourceManager.Core/src/Generated/SubscriptionData.cs @@ -2,6 +2,7 @@ // Licensed under the MIT License. using System.Collections.Generic; +using Azure.Core; namespace Azure.ResourceManager.Core { @@ -10,6 +11,15 @@ namespace Azure.ResourceManager.Core /// public partial class SubscriptionData : TrackedResource { + /// Initializes a new instance of Subscription. + internal SubscriptionData(string id, + string displayName, + IDictionary tags, + string resourceType = "Microsoft.Resources/subscriptions") : base(id, displayName, resourceType, null, tags) + { + ManagedByTenants = new ChangeTrackingList(); + } + /// /// Initializes a new instance of the class. /// @@ -23,7 +33,7 @@ public partial class SubscriptionData : TrackedResource The authorization source of the request. Valid values are one or more combinations of Legacy, RoleBased, Bypassed, Direct and Management. For example, 'Legacy, RoleBased'. /// An array containing the tenants managing the subscription. /// The tags attached to the subscription. - public SubscriptionData(string id, + internal SubscriptionData(string id, string displayName, string subscriptionId, string tenantId, @@ -33,7 +43,7 @@ public SubscriptionData(string id, IReadOnlyList managedByTenants, IDictionary tags, string resourceType = "Microsoft.Resources/subscriptions") - : base(id, displayName, resourceType, tags, null) + : base(id, displayName, resourceType, null, tags) { Name = displayName; SubscriptionGuid = subscriptionId; diff --git a/sdk/resourcemanager/Azure.ResourceManager.Core/src/Subscription.cs b/sdk/resourcemanager/Azure.ResourceManager.Core/src/Subscription.cs index be897509c78a..7ebfe4b5a495 100644 --- a/sdk/resourcemanager/Azure.ResourceManager.Core/src/Subscription.cs +++ b/sdk/resourcemanager/Azure.ResourceManager.Core/src/Subscription.cs @@ -29,6 +29,17 @@ internal Subscription(SubscriptionOperations subscription, SubscriptionData subs Data = subscriptionData; } + /// + /// Initializes a new instance of the class. + /// + /// The operations object to copy the client parameters from. + /// The data model representing the generic azure resource. + internal Subscription(OperationsBase operations, SubscriptionData subscriptionData) + : base(operations, subscriptionData.Id) + { + Data = subscriptionData; + } + /// /// Gets the subscription data model. /// diff --git a/sdk/resourcemanager/Azure.ResourceManager.Core/src/SubscriptionContainer.cs b/sdk/resourcemanager/Azure.ResourceManager.Core/src/SubscriptionContainer.cs index 7f5b0af82efe..bd8a5bdaa03d 100644 --- a/sdk/resourcemanager/Azure.ResourceManager.Core/src/SubscriptionContainer.cs +++ b/sdk/resourcemanager/Azure.ResourceManager.Core/src/SubscriptionContainer.cs @@ -2,7 +2,9 @@ // Licensed under the MIT License. using System; +using System.Linq; using System.Threading; +using System.Threading.Tasks; using Azure.Core; namespace Azure.ResourceManager.Core @@ -26,7 +28,7 @@ protected SubscriptionContainer() internal SubscriptionContainer(ClientContext clientContext) : base(clientContext, null) { - Operations = new SubscriptionOperations(clientContext, Guid.NewGuid().ToString()); + RestClient = new SubscriptionsRestOperations(this.Diagnostics, this.Pipeline); } /// @@ -37,7 +39,7 @@ internal SubscriptionContainer(ClientContext clientContext) /// /// Gets the operations that can be performed on the container. /// - private SubscriptionOperations Operations; + private SubscriptionsRestOperations RestClient; /// /// Lists all subscriptions in the current container. @@ -48,18 +50,37 @@ internal SubscriptionContainer(ClientContext clientContext) [ForwardsClientCalls] public virtual Pageable List(CancellationToken cancellationToken = default) { - using var scope = Diagnostics.CreateScope("SubscriptionContainer.List"); - scope.Start(); - - try + Page FirstPageFunc(int? pageSizeHint) { - return Operations.List(cancellationToken); + using var scope = Diagnostics.CreateScope("SubscriptionContainer.List"); + scope.Start(); + try + { + var response = RestClient.List(cancellationToken); + return Page.FromValues(response.Value.Value.Select(data => new Subscription(this, data)).ToList(), response.Value.NextLink, response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } } - catch (Exception e) + Page NextPageFunc(string nextLink, int? pageSizeHint) { - scope.Failed(e); - throw; + using var scope = Diagnostics.CreateScope("SubscriptionContainer.List"); + scope.Start(); + try + { + var response = RestClient.ListNextPage(nextLink, cancellationToken); + return Page.FromValues(response.Value.Value.Select(data => new Subscription(this, data)).ToList(), response.Value.NextLink, response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } } + return PageableHelpers.CreateEnumerable(FirstPageFunc, NextPageFunc); } /// @@ -71,18 +92,37 @@ public virtual Pageable List(CancellationToken cancellationToken = [ForwardsClientCalls] public virtual AsyncPageable ListAsync(CancellationToken cancellationToken = default) { - using var scope = Diagnostics.CreateScope("SubscriptionContainer.List"); - scope.Start(); - - try + async Task> FirstPageFunc(int? pageSizeHint) { - return Operations.ListAsync(cancellationToken); + using var scope = Diagnostics.CreateScope("SubscriptionContainer.List"); + scope.Start(); + try + { + var response = await RestClient.ListAsync(cancellationToken).ConfigureAwait(false); + return Page.FromValues(response.Value.Value.Select(data => new Subscription(this, data)).ToList(), response.Value.NextLink, response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } } - catch (Exception e) + async Task> NextPageFunc(string nextLink, int? pageSizeHint) { - scope.Failed(e); - throw; + using var scope = Diagnostics.CreateScope("SubscriptionContainer.List"); + scope.Start(); + try + { + var response = await RestClient.ListNextPageAsync(nextLink, cancellationToken).ConfigureAwait(false); + return Page.FromValues(response.Value.Value.Select(data => new Subscription(this, data)).ToList(), response.Value.NextLink, response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } } + return PageableHelpers.CreateAsyncEnumerable(FirstPageFunc, NextPageFunc); } /// diff --git a/sdk/resourcemanager/Azure.ResourceManager.Core/src/SubscriptionOperations.cs b/sdk/resourcemanager/Azure.ResourceManager.Core/src/SubscriptionOperations.cs index db050289a4c3..e7bf2f332406 100644 --- a/sdk/resourcemanager/Azure.ResourceManager.Core/src/SubscriptionOperations.cs +++ b/sdk/resourcemanager/Azure.ResourceManager.Core/src/SubscriptionOperations.cs @@ -47,6 +47,16 @@ protected SubscriptionOperations(SubscriptionOperations subscription, Subscripti { } + /// + /// Initializes a new instance of the class. + /// + /// The resource operations to copy the options from. + /// The identifier of the resource that is the target of operations. + internal SubscriptionOperations(OperationsBase operations, TenantResourceIdentifier id) + : base(operations, id) + { + } + /// /// ListResources of type T /// @@ -74,7 +84,7 @@ public virtual AsyncPageable ListResourcesAsync(Func protected override ResourceType ValidResourceType => ResourceType; - private SubscriptionsRestOperations SubscriptionsRestOperations => new SubscriptionsRestOperations(new ClientDiagnostics(this.ClientOptions), this.Pipeline, BaseUri); + private SubscriptionsRestOperations SubscriptionsRestOperations => new SubscriptionsRestOperations(this.Diagnostics, this.Pipeline, BaseUri); /// /// Gets the resource group container under this subscription. @@ -97,91 +107,37 @@ public virtual LocationContainer GetLocations() /// public override Response Get(CancellationToken cancellationToken = default) { - return new PhArmResponse( + using var scope = Diagnostics.CreateScope("SubscriptionOperations.Get"); + scope.Start(); + try + { + return new PhArmResponse( SubscriptionsRestOperations.Get(Id.Name, cancellationToken), Converter()); - } - - /// - public override async Task> GetAsync(CancellationToken cancellationToken = default) - { - return new PhArmResponse( - await SubscriptionsRestOperations.GetAsync(Id.Name, cancellationToken).ConfigureAwait(false), - Converter()); - } - - /// Gets all subscriptions for a tenant. - /// The cancellation token to use. - public virtual AsyncPageable ListAsync(CancellationToken cancellationToken = default) - { - async Task> FirstPageFunc(int? pageSizeHint) - { - using var scope = Diagnostics.CreateScope("SubscriptionOperations.List"); - scope.Start(); - try - { - var response = await SubscriptionsRestOperations.ListAsync(cancellationToken).ConfigureAwait(false); - return Page.FromValues(response.Value.Value.Select(data => new Subscription(this, data)).ToList(), response.Value.NextLink, response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } } - async Task> NextPageFunc(string nextLink, int? pageSizeHint) + catch (Exception e) { - using var scope = Diagnostics.CreateScope("SubscriptionOperations.List"); - scope.Start(); - try - { - var response = await SubscriptionsRestOperations.ListNextPageAsync(nextLink, cancellationToken).ConfigureAwait(false); - return Page.FromValues(response.Value.Value.Select(data => new Subscription(this, data)).ToList(), response.Value.NextLink, response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } + scope.Failed(e); + throw; } - return PageableHelpers.CreateAsyncEnumerable(FirstPageFunc, NextPageFunc); } - /// Gets all subscriptions for a tenant. - /// The cancellation token to use. - public virtual Pageable List(CancellationToken cancellationToken = default) + /// + public override async Task> GetAsync(CancellationToken cancellationToken = default) { - Page FirstPageFunc(int? pageSizeHint) + using var scope = Diagnostics.CreateScope("SubscriptionOperations.Get"); + scope.Start(); + try { - using var scope = Diagnostics.CreateScope("SubscriptionOperations.List"); - scope.Start(); - try - { - var response = SubscriptionsRestOperations.List(cancellationToken); - return Page.FromValues(response.Value.Value.Select(data => new Subscription(this, data)).ToList(), response.Value.NextLink, response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } + return new PhArmResponse( + await SubscriptionsRestOperations.GetAsync(Id.Name, cancellationToken).ConfigureAwait(false), + Converter()); } - Page NextPageFunc(string nextLink, int? pageSizeHint) + catch (Exception e) { - using var scope = Diagnostics.CreateScope("SubscriptionOperations.List"); - scope.Start(); - try - { - var response = SubscriptionsRestOperations.ListNextPage(nextLink, cancellationToken); - return Page.FromValues(response.Value.Value.Select(data => new Subscription(this, data)).ToList(), response.Value.NextLink, response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } + scope.Failed(e); + throw; } - return PageableHelpers.CreateEnumerable(FirstPageFunc, NextPageFunc); } /// This operation provides all the locations that are available for resource providers; however, each resource provider may support a subset of this list. diff --git a/sdk/resourcemanager/Azure.ResourceManager.Core/tests/Scenario/SubscriptionContainerTests.cs b/sdk/resourcemanager/Azure.ResourceManager.Core/tests/Scenario/SubscriptionContainerTests.cs new file mode 100644 index 000000000000..3ccc5c20a304 --- /dev/null +++ b/sdk/resourcemanager/Azure.ResourceManager.Core/tests/Scenario/SubscriptionContainerTests.cs @@ -0,0 +1,30 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using Azure.Core.TestFramework; +using NUnit.Framework; + +namespace Azure.ResourceManager.Core.Tests +{ + public class SubscriptionContainerTests : ResourceManagerTestBase + { + public SubscriptionContainerTests(bool isAsync) + : base(isAsync)//, RecordedTestMode.Record) + { + } + + [TestCase] + [RecordedTest] + public async Task List() + { + int count = 0; + await foreach (var rg in Client.GetSubscriptions().ListAsync()) + { + count++; + } + Assert.GreaterOrEqual(count, 1); + } + } +} diff --git a/sdk/resourcemanager/Azure.ResourceManager.Core/tests/Scenario/SubscriptionOperationsTests.cs b/sdk/resourcemanager/Azure.ResourceManager.Core/tests/Scenario/SubscriptionOperationsTests.cs index 649cedd3550d..f449fa22fec9 100644 --- a/sdk/resourcemanager/Azure.ResourceManager.Core/tests/Scenario/SubscriptionOperationsTests.cs +++ b/sdk/resourcemanager/Azure.ResourceManager.Core/tests/Scenario/SubscriptionOperationsTests.cs @@ -124,14 +124,6 @@ public async Task TestGetResourceGroupOpsLong(int length) } } - [RecordedTest] - public async Task TestListSubscriptions() - { - var subOps = Client.DefaultSubscription; - var subscriptions = await subOps.ListAsync().ToEnumerableAsync(); - Assert.IsTrue(subscriptions.Count != 0); - } - [RecordedTest] public async Task TestListLocations() { diff --git a/sdk/resourcemanager/Azure.ResourceManager.Core/tests/SessionRecords/SubscriptionContainerTests/List().json b/sdk/resourcemanager/Azure.ResourceManager.Core/tests/SessionRecords/SubscriptionContainerTests/List().json new file mode 100644 index 000000000000..6a0acad5defd --- /dev/null +++ b/sdk/resourcemanager/Azure.ResourceManager.Core/tests/SessionRecords/SubscriptionContainerTests/List().json @@ -0,0 +1,105 @@ +{ + "Entries": [ + { + "RequestUri": "https://management.azure.com/subscriptions/0accec26-d6de-4757-8e74-d080f38eaaab?api-version=2019-11-01", + "RequestMethod": "GET", + "RequestHeaders": { + "Accept": "application/json", + "Authorization": "Sanitized", + "User-Agent": [ + "azsdk-net-ResourceManager.Core/1.0.0-alpha.20210511.1", + "(.NET Core 4.6.29916.01; Microsoft Windows 10.0.19043 )" + ], + "x-ms-client-request-id": "5453eacbe2431579248c8478b9b439da", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "Cache-Control": "no-cache", + "Content-Length": "403", + "Content-Type": "application/json; charset=utf-8", + "Date": "Tue, 11 May 2021 03:18:08 GMT", + "Expires": "-1", + "Pragma": "no-cache", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains", + "X-Content-Type-Options": "nosniff", + "x-ms-correlation-request-id": "cd083a2b-b0af-4968-bb7f-3da78e782608", + "x-ms-ratelimit-remaining-subscription-reads": "11998", + "x-ms-request-id": "cd083a2b-b0af-4968-bb7f-3da78e782608", + "x-ms-routing-request-id": "SOUTHEASTASIA:20210511T031809Z:cd083a2b-b0af-4968-bb7f-3da78e782608" + }, + "ResponseBody": { + "id": "/subscriptions/0accec26-d6de-4757-8e74-d080f38eaaab", + "authorizationSource": "RoleBased", + "managedByTenants": [], + "subscriptionId": "0accec26-d6de-4757-8e74-d080f38eaaab", + "tenantId": "72f988bf-86f1-41af-91ab-2d7cd011db47", + "displayName": "ACR - TEST - China Team", + "state": "Enabled", + "subscriptionPolicies": { + "locationPlacementId": "Internal_2014-09-01", + "quotaId": "Internal_2014-09-01", + "spendingLimit": "Off" + } + } + }, + { + "RequestUri": "https://management.azure.com/subscriptions?api-version=2019-11-01", + "RequestMethod": "GET", + "RequestHeaders": { + "Accept": "application/json", + "Authorization": "Sanitized", + "traceparent": "00-f6229a3f96255c4eb4f86e2292a6e05d-0700d5af5c03f94a-00", + "User-Agent": [ + "azsdk-net-ResourceManager.Core/1.0.0-alpha.20210511.1", + "(.NET Core 4.6.29916.01; Microsoft Windows 10.0.19043 )" + ], + "x-ms-client-request-id": "774b9a80b2f57c1039c6584c410ddf04", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "Cache-Control": "no-cache", + "Content-Length": "450", + "Content-Type": "application/json; charset=utf-8", + "Date": "Tue, 11 May 2021 03:18:08 GMT", + "Expires": "-1", + "Pragma": "no-cache", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains", + "X-Content-Type-Options": "nosniff", + "x-ms-correlation-request-id": "0590023d-85d8-4ab0-8877-3aa9c95303eb", + "x-ms-ratelimit-remaining-tenant-reads": "11999", + "x-ms-request-id": "0590023d-85d8-4ab0-8877-3aa9c95303eb", + "x-ms-routing-request-id": "SOUTHEASTASIA:20210511T031809Z:0590023d-85d8-4ab0-8877-3aa9c95303eb" + }, + "ResponseBody": { + "value": [ + { + "id": "/subscriptions/0accec26-d6de-4757-8e74-d080f38eaaab", + "authorizationSource": "RoleBased", + "managedByTenants": [], + "subscriptionId": "0accec26-d6de-4757-8e74-d080f38eaaab", + "tenantId": "72f988bf-86f1-41af-91ab-2d7cd011db47", + "displayName": "ACR - TEST - China Team", + "state": "Enabled", + "subscriptionPolicies": { + "locationPlacementId": "Internal_2014-09-01", + "quotaId": "Internal_2014-09-01", + "spendingLimit": "Off" + } + } + ], + "count": { + "type": "Total", + "value": 1 + } + } + } + ], + "Variables": { + "RandomSeed": "1379336306", + "SUBSCRIPTION_ID": "0accec26-d6de-4757-8e74-d080f38eaaab" + } +} \ No newline at end of file diff --git a/sdk/resourcemanager/Azure.ResourceManager.Core/tests/SessionRecords/SubscriptionContainerTests/List()Async.json b/sdk/resourcemanager/Azure.ResourceManager.Core/tests/SessionRecords/SubscriptionContainerTests/List()Async.json new file mode 100644 index 000000000000..220dfb884b96 --- /dev/null +++ b/sdk/resourcemanager/Azure.ResourceManager.Core/tests/SessionRecords/SubscriptionContainerTests/List()Async.json @@ -0,0 +1,105 @@ +{ + "Entries": [ + { + "RequestUri": "https://management.azure.com/subscriptions/0accec26-d6de-4757-8e74-d080f38eaaab?api-version=2019-11-01", + "RequestMethod": "GET", + "RequestHeaders": { + "Accept": "application/json", + "Authorization": "Sanitized", + "User-Agent": [ + "azsdk-net-ResourceManager.Core/1.0.0-alpha.20210511.1", + "(.NET Core 4.6.29916.01; Microsoft Windows 10.0.19043 )" + ], + "x-ms-client-request-id": "746f9c8720e5d4879bdb08737441bf80", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "Cache-Control": "no-cache", + "Content-Length": "403", + "Content-Type": "application/json; charset=utf-8", + "Date": "Tue, 11 May 2021 03:18:08 GMT", + "Expires": "-1", + "Pragma": "no-cache", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains", + "X-Content-Type-Options": "nosniff", + "x-ms-correlation-request-id": "c358a8b3-21ed-486b-88ec-b41aa81274c6", + "x-ms-ratelimit-remaining-subscription-reads": "11998", + "x-ms-request-id": "c358a8b3-21ed-486b-88ec-b41aa81274c6", + "x-ms-routing-request-id": "SOUTHEASTASIA:20210511T031809Z:c358a8b3-21ed-486b-88ec-b41aa81274c6" + }, + "ResponseBody": { + "id": "/subscriptions/0accec26-d6de-4757-8e74-d080f38eaaab", + "authorizationSource": "RoleBased", + "managedByTenants": [], + "subscriptionId": "0accec26-d6de-4757-8e74-d080f38eaaab", + "tenantId": "72f988bf-86f1-41af-91ab-2d7cd011db47", + "displayName": "ACR - TEST - China Team", + "state": "Enabled", + "subscriptionPolicies": { + "locationPlacementId": "Internal_2014-09-01", + "quotaId": "Internal_2014-09-01", + "spendingLimit": "Off" + } + } + }, + { + "RequestUri": "https://management.azure.com/subscriptions?api-version=2019-11-01", + "RequestMethod": "GET", + "RequestHeaders": { + "Accept": "application/json", + "Authorization": "Sanitized", + "traceparent": "00-1f68e51d5a6c4a4791c139f6b8491242-9fbfd39c762f0b4d-00", + "User-Agent": [ + "azsdk-net-ResourceManager.Core/1.0.0-alpha.20210511.1", + "(.NET Core 4.6.29916.01; Microsoft Windows 10.0.19043 )" + ], + "x-ms-client-request-id": "a0e6efaab7aa9630d58fda4f254d492e", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "Cache-Control": "no-cache", + "Content-Length": "450", + "Content-Type": "application/json; charset=utf-8", + "Date": "Tue, 11 May 2021 03:18:09 GMT", + "Expires": "-1", + "Pragma": "no-cache", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains", + "X-Content-Type-Options": "nosniff", + "x-ms-correlation-request-id": "255c71bc-04c5-491c-ba8a-79e915153372", + "x-ms-ratelimit-remaining-tenant-reads": "11999", + "x-ms-request-id": "255c71bc-04c5-491c-ba8a-79e915153372", + "x-ms-routing-request-id": "SOUTHEASTASIA:20210511T031809Z:255c71bc-04c5-491c-ba8a-79e915153372" + }, + "ResponseBody": { + "value": [ + { + "id": "/subscriptions/0accec26-d6de-4757-8e74-d080f38eaaab", + "authorizationSource": "RoleBased", + "managedByTenants": [], + "subscriptionId": "0accec26-d6de-4757-8e74-d080f38eaaab", + "tenantId": "72f988bf-86f1-41af-91ab-2d7cd011db47", + "displayName": "ACR - TEST - China Team", + "state": "Enabled", + "subscriptionPolicies": { + "locationPlacementId": "Internal_2014-09-01", + "quotaId": "Internal_2014-09-01", + "spendingLimit": "Off" + } + } + ], + "count": { + "type": "Total", + "value": 1 + } + } + } + ], + "Variables": { + "RandomSeed": "1153084172", + "SUBSCRIPTION_ID": "0accec26-d6de-4757-8e74-d080f38eaaab" + } +} \ No newline at end of file From bc93cbbd4abe9befd50470de22eba2d534a3804a Mon Sep 17 00:00:00 2001 From: Harvey Chen <30464227+HarveyLink@users.noreply.github.com> Date: Tue, 11 May 2021 16:17:08 +0800 Subject: [PATCH 11/16] Add get test --- .../src/Generated/SubscriptionData.cs | 6 +- .../Scenario/SubscriptionOperationsTests.cs | 7 ++ .../TestGetSubscription.json | 97 +++++++++++++++++++ .../TestGetSubscriptionAsync.json | 97 +++++++++++++++++++ 4 files changed, 206 insertions(+), 1 deletion(-) create mode 100644 sdk/resourcemanager/Azure.ResourceManager.Core/tests/SessionRecords/SubscriptionOperationsTests/TestGetSubscription.json create mode 100644 sdk/resourcemanager/Azure.ResourceManager.Core/tests/SessionRecords/SubscriptionOperationsTests/TestGetSubscriptionAsync.json diff --git a/sdk/resourcemanager/Azure.ResourceManager.Core/src/Generated/SubscriptionData.cs b/sdk/resourcemanager/Azure.ResourceManager.Core/src/Generated/SubscriptionData.cs index 745e0f3f970e..450d62da4f27 100644 --- a/sdk/resourcemanager/Azure.ResourceManager.Core/src/Generated/SubscriptionData.cs +++ b/sdk/resourcemanager/Azure.ResourceManager.Core/src/Generated/SubscriptionData.cs @@ -11,7 +11,11 @@ namespace Azure.ResourceManager.Core /// public partial class SubscriptionData : TrackedResource { - /// Initializes a new instance of Subscription. + /// Initializes a new instance of class. + /// The subscription id. + /// The subscription name. + /// The tags attached to the subscription. + /// The subscription resource type. internal SubscriptionData(string id, string displayName, IDictionary tags, diff --git a/sdk/resourcemanager/Azure.ResourceManager.Core/tests/Scenario/SubscriptionOperationsTests.cs b/sdk/resourcemanager/Azure.ResourceManager.Core/tests/Scenario/SubscriptionOperationsTests.cs index f449fa22fec9..425d66de13b6 100644 --- a/sdk/resourcemanager/Azure.ResourceManager.Core/tests/Scenario/SubscriptionOperationsTests.cs +++ b/sdk/resourcemanager/Azure.ResourceManager.Core/tests/Scenario/SubscriptionOperationsTests.cs @@ -132,6 +132,13 @@ public async Task TestListLocations() Assert.IsTrue(locations.Count != 0); } + [RecordedTest] + public async Task TestGetSubscription() + { + var subscription = await Client.DefaultSubscription.GetAsync(); + Assert.NotNull(subscription.Value.Data.Id); + } + private string GetLongString(int length) { StringBuilder builder = new StringBuilder(); diff --git a/sdk/resourcemanager/Azure.ResourceManager.Core/tests/SessionRecords/SubscriptionOperationsTests/TestGetSubscription.json b/sdk/resourcemanager/Azure.ResourceManager.Core/tests/SessionRecords/SubscriptionOperationsTests/TestGetSubscription.json new file mode 100644 index 000000000000..68dd5372c9c4 --- /dev/null +++ b/sdk/resourcemanager/Azure.ResourceManager.Core/tests/SessionRecords/SubscriptionOperationsTests/TestGetSubscription.json @@ -0,0 +1,97 @@ +{ + "Entries": [ + { + "RequestUri": "https://management.azure.com/subscriptions/0accec26-d6de-4757-8e74-d080f38eaaab?api-version=2019-11-01", + "RequestMethod": "GET", + "RequestHeaders": { + "Accept": "application/json", + "Authorization": "Sanitized", + "User-Agent": [ + "azsdk-net-ResourceManager.Core/1.0.0-alpha.20210511.1", + "(.NET Core 4.6.29916.01; Microsoft Windows 10.0.19043 )" + ], + "x-ms-client-request-id": "23099f43405cf00bfa4e99276006b903", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "Cache-Control": "no-cache", + "Content-Length": "403", + "Content-Type": "application/json; charset=utf-8", + "Date": "Tue, 11 May 2021 08:16:53 GMT", + "Expires": "-1", + "Pragma": "no-cache", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains", + "X-Content-Type-Options": "nosniff", + "x-ms-correlation-request-id": "b7f8d93d-e57f-4416-b329-48e03e30fb17", + "x-ms-ratelimit-remaining-subscription-reads": "11998", + "x-ms-request-id": "b7f8d93d-e57f-4416-b329-48e03e30fb17", + "x-ms-routing-request-id": "SOUTHEASTASIA:20210511T081654Z:b7f8d93d-e57f-4416-b329-48e03e30fb17" + }, + "ResponseBody": { + "id": "/subscriptions/0accec26-d6de-4757-8e74-d080f38eaaab", + "authorizationSource": "RoleBased", + "managedByTenants": [], + "subscriptionId": "0accec26-d6de-4757-8e74-d080f38eaaab", + "tenantId": "72f988bf-86f1-41af-91ab-2d7cd011db47", + "displayName": "ACR - TEST - China Team", + "state": "Enabled", + "subscriptionPolicies": { + "locationPlacementId": "Internal_2014-09-01", + "quotaId": "Internal_2014-09-01", + "spendingLimit": "Off" + } + } + }, + { + "RequestUri": "https://management.azure.com/subscriptions/0accec26-d6de-4757-8e74-d080f38eaaab?api-version=2019-11-01", + "RequestMethod": "GET", + "RequestHeaders": { + "Accept": "application/json", + "Authorization": "Sanitized", + "traceparent": "00-15d699bce100f44aa981ebb9bcde7341-f8e98b42fa0e1348-00", + "User-Agent": [ + "azsdk-net-ResourceManager.Core/1.0.0-alpha.20210511.1", + "(.NET Core 4.6.29916.01; Microsoft Windows 10.0.19043 )" + ], + "x-ms-client-request-id": "1607eb0ff799af16ce07eeb73e3bfd4b", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "Cache-Control": "no-cache", + "Content-Length": "403", + "Content-Type": "application/json; charset=utf-8", + "Date": "Tue, 11 May 2021 08:16:53 GMT", + "Expires": "-1", + "Pragma": "no-cache", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains", + "X-Content-Type-Options": "nosniff", + "x-ms-correlation-request-id": "fdb21d1c-197d-4c74-b4b2-a17a87b12ece", + "x-ms-ratelimit-remaining-subscription-reads": "11997", + "x-ms-request-id": "fdb21d1c-197d-4c74-b4b2-a17a87b12ece", + "x-ms-routing-request-id": "SOUTHEASTASIA:20210511T081654Z:fdb21d1c-197d-4c74-b4b2-a17a87b12ece" + }, + "ResponseBody": { + "id": "/subscriptions/0accec26-d6de-4757-8e74-d080f38eaaab", + "authorizationSource": "RoleBased", + "managedByTenants": [], + "subscriptionId": "0accec26-d6de-4757-8e74-d080f38eaaab", + "tenantId": "72f988bf-86f1-41af-91ab-2d7cd011db47", + "displayName": "ACR - TEST - China Team", + "state": "Enabled", + "subscriptionPolicies": { + "locationPlacementId": "Internal_2014-09-01", + "quotaId": "Internal_2014-09-01", + "spendingLimit": "Off" + } + } + } + ], + "Variables": { + "RandomSeed": "162365129", + "SUBSCRIPTION_ID": "0accec26-d6de-4757-8e74-d080f38eaaab" + } +} \ No newline at end of file diff --git a/sdk/resourcemanager/Azure.ResourceManager.Core/tests/SessionRecords/SubscriptionOperationsTests/TestGetSubscriptionAsync.json b/sdk/resourcemanager/Azure.ResourceManager.Core/tests/SessionRecords/SubscriptionOperationsTests/TestGetSubscriptionAsync.json new file mode 100644 index 000000000000..50216a1ab63c --- /dev/null +++ b/sdk/resourcemanager/Azure.ResourceManager.Core/tests/SessionRecords/SubscriptionOperationsTests/TestGetSubscriptionAsync.json @@ -0,0 +1,97 @@ +{ + "Entries": [ + { + "RequestUri": "https://management.azure.com/subscriptions/0accec26-d6de-4757-8e74-d080f38eaaab?api-version=2019-11-01", + "RequestMethod": "GET", + "RequestHeaders": { + "Accept": "application/json", + "Authorization": "Sanitized", + "User-Agent": [ + "azsdk-net-ResourceManager.Core/1.0.0-alpha.20210511.1", + "(.NET Core 4.6.29916.01; Microsoft Windows 10.0.19043 )" + ], + "x-ms-client-request-id": "b21bf42701fdabc43a406edcb7768ae3", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "Cache-Control": "no-cache", + "Content-Length": "403", + "Content-Type": "application/json; charset=utf-8", + "Date": "Tue, 11 May 2021 08:16:53 GMT", + "Expires": "-1", + "Pragma": "no-cache", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains", + "X-Content-Type-Options": "nosniff", + "x-ms-correlation-request-id": "5e97cc38-96b6-434e-9acd-c78031413141", + "x-ms-ratelimit-remaining-subscription-reads": "11998", + "x-ms-request-id": "5e97cc38-96b6-434e-9acd-c78031413141", + "x-ms-routing-request-id": "SOUTHEASTASIA:20210511T081654Z:5e97cc38-96b6-434e-9acd-c78031413141" + }, + "ResponseBody": { + "id": "/subscriptions/0accec26-d6de-4757-8e74-d080f38eaaab", + "authorizationSource": "RoleBased", + "managedByTenants": [], + "subscriptionId": "0accec26-d6de-4757-8e74-d080f38eaaab", + "tenantId": "72f988bf-86f1-41af-91ab-2d7cd011db47", + "displayName": "ACR - TEST - China Team", + "state": "Enabled", + "subscriptionPolicies": { + "locationPlacementId": "Internal_2014-09-01", + "quotaId": "Internal_2014-09-01", + "spendingLimit": "Off" + } + } + }, + { + "RequestUri": "https://management.azure.com/subscriptions/0accec26-d6de-4757-8e74-d080f38eaaab?api-version=2019-11-01", + "RequestMethod": "GET", + "RequestHeaders": { + "Accept": "application/json", + "Authorization": "Sanitized", + "traceparent": "00-0a8152f39d53264ba87a40b6270ac83e-1f14f625b643e649-00", + "User-Agent": [ + "azsdk-net-ResourceManager.Core/1.0.0-alpha.20210511.1", + "(.NET Core 4.6.29916.01; Microsoft Windows 10.0.19043 )" + ], + "x-ms-client-request-id": "4d3789c23f58499912a63b70c107f471", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "Cache-Control": "no-cache", + "Content-Length": "403", + "Content-Type": "application/json; charset=utf-8", + "Date": "Tue, 11 May 2021 08:16:54 GMT", + "Expires": "-1", + "Pragma": "no-cache", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains", + "X-Content-Type-Options": "nosniff", + "x-ms-correlation-request-id": "bf6edeaa-b326-4494-8f3d-49de566a2255", + "x-ms-ratelimit-remaining-subscription-reads": "11997", + "x-ms-request-id": "bf6edeaa-b326-4494-8f3d-49de566a2255", + "x-ms-routing-request-id": "SOUTHEASTASIA:20210511T081654Z:bf6edeaa-b326-4494-8f3d-49de566a2255" + }, + "ResponseBody": { + "id": "/subscriptions/0accec26-d6de-4757-8e74-d080f38eaaab", + "authorizationSource": "RoleBased", + "managedByTenants": [], + "subscriptionId": "0accec26-d6de-4757-8e74-d080f38eaaab", + "tenantId": "72f988bf-86f1-41af-91ab-2d7cd011db47", + "displayName": "ACR - TEST - China Team", + "state": "Enabled", + "subscriptionPolicies": { + "locationPlacementId": "Internal_2014-09-01", + "quotaId": "Internal_2014-09-01", + "spendingLimit": "Off" + } + } + } + ], + "Variables": { + "RandomSeed": "1264655405", + "SUBSCRIPTION_ID": "0accec26-d6de-4757-8e74-d080f38eaaab" + } +} \ No newline at end of file From 739e83382779cf8a8d20c14c77a105bda9fcd61d Mon Sep 17 00:00:00 2001 From: Harvey Chen <30464227+HarveyLink@users.noreply.github.com> Date: Wed, 12 May 2021 17:34:57 +0800 Subject: [PATCH 12/16] Remove unnecessary file --- .../src/Generated/ChangeTrackingList.cs | 193 ------------------ .../src/Generated/SubscriptionListResult.cs | 1 + 2 files changed, 1 insertion(+), 193 deletions(-) delete mode 100644 sdk/resourcemanager/Azure.ResourceManager.Core/src/Generated/ChangeTrackingList.cs diff --git a/sdk/resourcemanager/Azure.ResourceManager.Core/src/Generated/ChangeTrackingList.cs b/sdk/resourcemanager/Azure.ResourceManager.Core/src/Generated/ChangeTrackingList.cs deleted file mode 100644 index f176dcd9aa62..000000000000 --- a/sdk/resourcemanager/Azure.ResourceManager.Core/src/Generated/ChangeTrackingList.cs +++ /dev/null @@ -1,193 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -using System; -using System.Collections; -using System.Collections.Generic; -using System.Linq; -using Azure.Core; - -#nullable enable - -namespace Azure.ResourceManager.Core -{ - internal class ChangeTrackingList : IList, IReadOnlyList - { - private IList? _innerList; - - public ChangeTrackingList() - { - } - - public ChangeTrackingList(Optional> optionalList) : this(optionalList.Value) - { - } - - public ChangeTrackingList(Optional> optionalList) : this(optionalList.Value) - { - } - - private ChangeTrackingList(IEnumerable innerList) - { - if (innerList == null) - { - return; - } - - _innerList = innerList.ToList(); - } - - private ChangeTrackingList(IList innerList) - { - if (innerList == null) - { - return; - } - - _innerList = innerList; - } - - public bool IsUndefined => _innerList == null; - - public void Reset() - { - _innerList = null; - } - - public IEnumerator GetEnumerator() - { - if (IsUndefined) - { - IEnumerator EnumerateEmpty() - { - yield break; - } - - return EnumerateEmpty(); - } - return EnsureList().GetEnumerator(); - } - - IEnumerator IEnumerable.GetEnumerator() - { - return GetEnumerator(); - } - - public void Add(T item) - { - EnsureList().Add(item); - } - - public void Clear() - { - EnsureList().Clear(); - } - - public bool Contains(T item) - { - if (IsUndefined) - { - return false; - } - - return EnsureList().Contains(item); - } - - public void CopyTo(T[] array, int arrayIndex) - { - if (IsUndefined) - { - return; - } - - EnsureList().CopyTo(array, arrayIndex); - } - - public bool Remove(T item) - { - if (IsUndefined) - { - return false; - } - - return EnsureList().Remove(item); - } - - public int Count - { - get - { - if (IsUndefined) - { - return 0; - } - return EnsureList().Count; - } - } - - public bool IsReadOnly - { - get - { - if (IsUndefined) - { - return false; - } - - return EnsureList().IsReadOnly; - } - } - - public int IndexOf(T item) - { - if (IsUndefined) - { - return -1; - } - - return EnsureList().IndexOf(item); - } - - public void Insert(int index, T item) - { - EnsureList().Insert(index, item); - } - - public void RemoveAt(int index) - { - if (IsUndefined) - { - throw new ArgumentOutOfRangeException(nameof(index)); - } - - EnsureList().RemoveAt(index); - } - - public T this[int index] - { - get - { - if (IsUndefined) - { - throw new ArgumentOutOfRangeException(nameof(index)); - } - - return EnsureList()[index]; - } - set - { - if (IsUndefined) - { - throw new ArgumentOutOfRangeException(nameof(index)); - } - - EnsureList()[index] = value; - } - } - - private IList EnsureList() - { - return _innerList ??= new List(); - } - } -} diff --git a/sdk/resourcemanager/Azure.ResourceManager.Core/src/Generated/SubscriptionListResult.cs b/sdk/resourcemanager/Azure.ResourceManager.Core/src/Generated/SubscriptionListResult.cs index e61ab11686e4..883fb24d6434 100644 --- a/sdk/resourcemanager/Azure.ResourceManager.Core/src/Generated/SubscriptionListResult.cs +++ b/sdk/resourcemanager/Azure.ResourceManager.Core/src/Generated/SubscriptionListResult.cs @@ -3,6 +3,7 @@ using System; using System.Collections.Generic; +using Azure.Core; namespace Azure.ResourceManager.Core { From a3ade68dd26ce25d973ac28b712d027997d66fc3 Mon Sep 17 00:00:00 2001 From: Harvey Chen <30464227+HarveyLink@users.noreply.github.com> Date: Wed, 12 May 2021 17:35:46 +0800 Subject: [PATCH 13/16] Update LocationListResult.cs --- .../src/Generated/LocationListResult.cs | 1 + 1 file changed, 1 insertion(+) diff --git a/sdk/resourcemanager/Azure.ResourceManager.Core/src/Generated/LocationListResult.cs b/sdk/resourcemanager/Azure.ResourceManager.Core/src/Generated/LocationListResult.cs index e9aa64f8f59b..89f289fbcb4c 100644 --- a/sdk/resourcemanager/Azure.ResourceManager.Core/src/Generated/LocationListResult.cs +++ b/sdk/resourcemanager/Azure.ResourceManager.Core/src/Generated/LocationListResult.cs @@ -2,6 +2,7 @@ // Licensed under the MIT License. using System.Collections.Generic; +using Azure.Core; namespace Azure.ResourceManager.Core { From 9e6b9e9a748ac27a6f1a11858ae2892e312f0fed Mon Sep 17 00:00:00 2001 From: Harvey Chen <30464227+HarveyLink@users.noreply.github.com> Date: Fri, 14 May 2021 08:23:39 +0800 Subject: [PATCH 14/16] Update ClientContextTests.cs --- .../tests/Scenario/ClientContextTests.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sdk/resourcemanager/Azure.ResourceManager.Core/tests/Scenario/ClientContextTests.cs b/sdk/resourcemanager/Azure.ResourceManager.Core/tests/Scenario/ClientContextTests.cs index 09cab9dc452f..b1fd4433c21c 100644 --- a/sdk/resourcemanager/Azure.ResourceManager.Core/tests/Scenario/ClientContextTests.cs +++ b/sdk/resourcemanager/Azure.ResourceManager.Core/tests/Scenario/ClientContextTests.cs @@ -28,13 +28,13 @@ public async Task TestClientContextPolicy() Console.WriteLine("-----Client 1-----"); _ = await client1.DefaultSubscription.GetResourceGroups().Construct(LocationData.WestUS2).CreateOrUpdateAsync(Recording.GenerateAssetName("testrg")); - Assert.AreEqual(1, dummyPolicy1.numMsgGot); + Assert.AreEqual(2, dummyPolicy1.numMsgGot); options1.AddPolicy(dummyPolicy2, HttpPipelinePosition.PerCall); _ = await client1.DefaultSubscription.GetResourceGroups().Construct(LocationData.WestUS2).CreateOrUpdateAsync(Recording.GenerateAssetName("test2Rg-")); - Assert.AreEqual(2, dummyPolicy1.numMsgGot); + Assert.AreEqual(3, dummyPolicy1.numMsgGot); Assert.AreEqual(0, dummyPolicy2.numMsgGot); } From 5195dbf966bb667e140222ad588ef764fd9742df Mon Sep 17 00:00:00 2001 From: Harvey Chen <30464227+HarveyLink@users.noreply.github.com> Date: Mon, 17 May 2021 16:57:56 +0800 Subject: [PATCH 15/16] Update operation class & add tests --- .../src/ResourceContainerBase.cs | 4 + .../src/Subscription.cs | 11 -- .../src/SubscriptionOperations.cs | 31 +--- .../Scenario/SubscriptionContainerTests.cs | 24 ++++ .../DoesExist().json | 134 ++++++++++++++++++ .../DoesExist()Async.json | 134 ++++++++++++++++++ .../SubscriptionContainerTests/TryGet().json | 134 ++++++++++++++++++ .../TryGet()Async.json | 134 ++++++++++++++++++ 8 files changed, 571 insertions(+), 35 deletions(-) create mode 100644 sdk/resourcemanager/Azure.ResourceManager.Core/tests/SessionRecords/SubscriptionContainerTests/DoesExist().json create mode 100644 sdk/resourcemanager/Azure.ResourceManager.Core/tests/SessionRecords/SubscriptionContainerTests/DoesExist()Async.json create mode 100644 sdk/resourcemanager/Azure.ResourceManager.Core/tests/SessionRecords/SubscriptionContainerTests/TryGet().json create mode 100644 sdk/resourcemanager/Azure.ResourceManager.Core/tests/SessionRecords/SubscriptionContainerTests/TryGet()Async.json diff --git a/sdk/resourcemanager/Azure.ResourceManager.Core/src/ResourceContainerBase.cs b/sdk/resourcemanager/Azure.ResourceManager.Core/src/ResourceContainerBase.cs index 7fcaaded8fe2..c59737769719 100644 --- a/sdk/resourcemanager/Azure.ResourceManager.Core/src/ResourceContainerBase.cs +++ b/sdk/resourcemanager/Azure.ResourceManager.Core/src/ResourceContainerBase.cs @@ -174,6 +174,8 @@ public virtual async Task TryGetAsync(string resourceName, Cancella /// Whether or not the resource existed. public virtual bool DoesExist(string resourceName, CancellationToken cancellationToken = default) { + using var scope = Diagnostics.CreateScope("ResourceContainerBase`3.DoesExist"); + scope.Start(); return TryGet(resourceName, cancellationToken) != null; } @@ -186,6 +188,8 @@ public virtual bool DoesExist(string resourceName, CancellationToken cancellatio /// Whether or not the resource existed. public virtual async Task DoesExistAsync(string resourceName, CancellationToken cancellationToken = default) { + using var scope = Diagnostics.CreateScope("ResourceContainerBase`3.DoesExist"); + scope.Start(); return await TryGetAsync(resourceName, cancellationToken).ConfigureAwait(false) != null; } diff --git a/sdk/resourcemanager/Azure.ResourceManager.Core/src/Subscription.cs b/sdk/resourcemanager/Azure.ResourceManager.Core/src/Subscription.cs index 7ebfe4b5a495..f15eb8db44ec 100644 --- a/sdk/resourcemanager/Azure.ResourceManager.Core/src/Subscription.cs +++ b/sdk/resourcemanager/Azure.ResourceManager.Core/src/Subscription.cs @@ -18,17 +18,6 @@ protected Subscription() { } - /// - /// Initializes a new instance of the class. - /// - /// The subscription operations to copy the client options from. - /// The resource data model. - internal Subscription(SubscriptionOperations subscription, SubscriptionData subscriptionData) - : base(subscription, subscriptionData.Id) - { - Data = subscriptionData; - } - /// /// Initializes a new instance of the class. /// diff --git a/sdk/resourcemanager/Azure.ResourceManager.Core/src/SubscriptionOperations.cs b/sdk/resourcemanager/Azure.ResourceManager.Core/src/SubscriptionOperations.cs index e7bf2f332406..80223c57ca0b 100644 --- a/sdk/resourcemanager/Azure.ResourceManager.Core/src/SubscriptionOperations.cs +++ b/sdk/resourcemanager/Azure.ResourceManager.Core/src/SubscriptionOperations.cs @@ -37,16 +37,6 @@ internal SubscriptionOperations(ClientContext clientContext, string subscription { } - /// - /// Initializes a new instance of the class. - /// - /// The subscription operations to copy client options from. - /// The identifier of the subscription. - protected SubscriptionOperations(SubscriptionOperations subscription, SubscriptionResourceIdentifier id) - : base(subscription, id) - { - } - /// /// Initializes a new instance of the class. /// @@ -84,7 +74,7 @@ public virtual AsyncPageable ListResourcesAsync(Func protected override ResourceType ValidResourceType => ResourceType; - private SubscriptionsRestOperations SubscriptionsRestOperations => new SubscriptionsRestOperations(this.Diagnostics, this.Pipeline, BaseUri); + private SubscriptionsRestOperations RestClient => new SubscriptionsRestOperations(Diagnostics, Pipeline, BaseUri); /// /// Gets the resource group container under this subscription. @@ -111,9 +101,8 @@ public override Response Get(CancellationToken cancellationToken = scope.Start(); try { - return new PhArmResponse( - SubscriptionsRestOperations.Get(Id.Name, cancellationToken), - Converter()); + var response = RestClient.Get(Id.Name, cancellationToken); + return Response.FromValue(new Subscription(this, response.Value), response.GetRawResponse()); } catch (Exception e) { @@ -129,9 +118,8 @@ public override async Task> GetAsync(CancellationToken ca scope.Start(); try { - return new PhArmResponse( - await SubscriptionsRestOperations.GetAsync(Id.Name, cancellationToken).ConfigureAwait(false), - Converter()); + var response = await RestClient.GetAsync(Id.Name, cancellationToken).ConfigureAwait(false); + return Response.FromValue(new Subscription(this, response.Value), response.GetRawResponse()); } catch (Exception e) { @@ -157,7 +145,7 @@ async Task> FirstPageFunc(int? pageSizeHint) scope.Start(); try { - var response = await SubscriptionsRestOperations.ListLocationsAsync(subscriptionId, cancellationToken).ConfigureAwait(false); + var response = await RestClient.ListLocationsAsync(subscriptionId, cancellationToken).ConfigureAwait(false); return Page.FromValues(response.Value.Value, null, response.GetRawResponse()); } catch (Exception e) @@ -186,7 +174,7 @@ Page FirstPageFunc(int? pageSizeHint) scope.Start(); try { - var response = SubscriptionsRestOperations.ListLocations(subscriptionId, cancellationToken); + var response = RestClient.ListLocations(subscriptionId, cancellationToken); return Page.FromValues(response.Value.Value, null, response.GetRawResponse()); } catch (Exception e) @@ -198,11 +186,6 @@ Page FirstPageFunc(int? pageSizeHint) return PageableHelpers.CreateEnumerable(FirstPageFunc, null); } - private Func Converter() - { - return s => new Subscription(this, s); - } - /// /// Gets a container representing all resources as generic objects in the current tenant. /// diff --git a/sdk/resourcemanager/Azure.ResourceManager.Core/tests/Scenario/SubscriptionContainerTests.cs b/sdk/resourcemanager/Azure.ResourceManager.Core/tests/Scenario/SubscriptionContainerTests.cs index 3ccc5c20a304..1ffff268e8c4 100644 --- a/sdk/resourcemanager/Azure.ResourceManager.Core/tests/Scenario/SubscriptionContainerTests.cs +++ b/sdk/resourcemanager/Azure.ResourceManager.Core/tests/Scenario/SubscriptionContainerTests.cs @@ -26,5 +26,29 @@ public async Task List() } Assert.GreaterOrEqual(count, 1); } + + [TestCase] + [RecordedTest] + public async Task TryGet() + { + var foo = await Client.GetSubscriptions().TryGetAsync("/subscriptions/"+ new Guid().ToString()).ConfigureAwait(false); + Assert.IsNull(foo); + string subscriptionId = Client.DefaultSubscription.Id.SubscriptionId; + var subscription = await Client.GetSubscriptions().TryGetAsync("/subscriptions/" + subscriptionId).ConfigureAwait(false); + Assert.NotNull(subscription); + Assert.IsTrue(subscription.Id.SubscriptionId.Equals(subscriptionId)); + } + + [TestCase] + [RecordedTest] + public async Task DoesExist() + { + var expectFalse = await Client.GetSubscriptions().DoesExistAsync("/subscriptions/" + new Guid().ToString()).ConfigureAwait(false); + Assert.IsFalse(expectFalse); + string subscriptionId = Client.DefaultSubscription.Id.SubscriptionId; + var expectTrue = await Client.GetSubscriptions().DoesExistAsync("/subscriptions/" + subscriptionId).ConfigureAwait(false); + Assert.IsTrue(expectTrue); + } + } } diff --git a/sdk/resourcemanager/Azure.ResourceManager.Core/tests/SessionRecords/SubscriptionContainerTests/DoesExist().json b/sdk/resourcemanager/Azure.ResourceManager.Core/tests/SessionRecords/SubscriptionContainerTests/DoesExist().json new file mode 100644 index 000000000000..f58db0f07e63 --- /dev/null +++ b/sdk/resourcemanager/Azure.ResourceManager.Core/tests/SessionRecords/SubscriptionContainerTests/DoesExist().json @@ -0,0 +1,134 @@ +{ + "Entries": [ + { + "RequestUri": "https://management.azure.com/subscriptions/0accec26-d6de-4757-8e74-d080f38eaaab?api-version=2019-11-01", + "RequestMethod": "GET", + "RequestHeaders": { + "Accept": "application/json", + "Authorization": "Sanitized", + "User-Agent": [ + "azsdk-net-ResourceManager.Core/1.0.0-alpha.20210517.1", + "(.NET Core 4.6.30015.01; Microsoft Windows 10.0.19043 )" + ], + "x-ms-client-request-id": "954da0f85ddc5ae1bcc1678755774e2d", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "Cache-Control": "no-cache", + "Content-Length": "403", + "Content-Type": "application/json; charset=utf-8", + "Date": "Mon, 17 May 2021 08:56:01 GMT", + "Expires": "-1", + "Pragma": "no-cache", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains", + "X-Content-Type-Options": "nosniff", + "x-ms-correlation-request-id": "efdaab89-1aff-4a26-838b-8bbc868b1c27", + "x-ms-ratelimit-remaining-subscription-reads": "11996", + "x-ms-request-id": "efdaab89-1aff-4a26-838b-8bbc868b1c27", + "x-ms-routing-request-id": "SOUTHEASTASIA:20210517T085602Z:efdaab89-1aff-4a26-838b-8bbc868b1c27" + }, + "ResponseBody": { + "id": "/subscriptions/0accec26-d6de-4757-8e74-d080f38eaaab", + "authorizationSource": "RoleBased", + "managedByTenants": [], + "subscriptionId": "0accec26-d6de-4757-8e74-d080f38eaaab", + "tenantId": "72f988bf-86f1-41af-91ab-2d7cd011db47", + "displayName": "ACR - TEST - China Team", + "state": "Enabled", + "subscriptionPolicies": { + "locationPlacementId": "Internal_2014-09-01", + "quotaId": "Internal_2014-09-01", + "spendingLimit": "Off" + } + } + }, + { + "RequestUri": "https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000?api-version=2019-11-01", + "RequestMethod": "GET", + "RequestHeaders": { + "Accept": "application/json", + "Authorization": "Sanitized", + "traceparent": "00-2b1a917e14180b419886b5f95016da47-0d01fc0eed9f3e4a-00", + "User-Agent": [ + "azsdk-net-ResourceManager.Core/1.0.0-alpha.20210517.1", + "(.NET Core 4.6.30015.01; Microsoft Windows 10.0.19043 )" + ], + "x-ms-client-request-id": "a91890e152474b8fe320118c804c404b", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": null, + "StatusCode": 404, + "ResponseHeaders": { + "Cache-Control": "no-cache", + "Content-Length": "129", + "Content-Type": "application/json; charset=utf-8", + "Date": "Mon, 17 May 2021 08:56:01 GMT", + "Expires": "-1", + "Pragma": "no-cache", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains", + "X-Content-Type-Options": "nosniff", + "x-ms-correlation-request-id": "43994261-553b-472a-a42e-107efa2c0769", + "x-ms-failure-cause": "gateway", + "x-ms-request-id": "43994261-553b-472a-a42e-107efa2c0769", + "x-ms-routing-request-id": "SOUTHEASTASIA:20210517T085602Z:43994261-553b-472a-a42e-107efa2c0769" + }, + "ResponseBody": { + "error": { + "code": "SubscriptionNotFound", + "message": "The subscription \u002700000000-0000-0000-0000-000000000000\u0027 could not be found." + } + } + }, + { + "RequestUri": "https://management.azure.com/subscriptions/0accec26-d6de-4757-8e74-d080f38eaaab?api-version=2019-11-01", + "RequestMethod": "GET", + "RequestHeaders": { + "Accept": "application/json", + "Authorization": "Sanitized", + "traceparent": "00-6c24b4917f4dfc4e853bd6cbdda4fa42-7f26ee9d67083e47-00", + "User-Agent": [ + "azsdk-net-ResourceManager.Core/1.0.0-alpha.20210517.1", + "(.NET Core 4.6.30015.01; Microsoft Windows 10.0.19043 )" + ], + "x-ms-client-request-id": "b3da44e501409210956d011334e3a30b", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "Cache-Control": "no-cache", + "Content-Length": "403", + "Content-Type": "application/json; charset=utf-8", + "Date": "Mon, 17 May 2021 08:56:01 GMT", + "Expires": "-1", + "Pragma": "no-cache", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains", + "X-Content-Type-Options": "nosniff", + "x-ms-correlation-request-id": "492d6c44-e39c-447e-8425-7c04d8a87e8c", + "x-ms-ratelimit-remaining-subscription-reads": "11995", + "x-ms-request-id": "492d6c44-e39c-447e-8425-7c04d8a87e8c", + "x-ms-routing-request-id": "SOUTHEASTASIA:20210517T085602Z:492d6c44-e39c-447e-8425-7c04d8a87e8c" + }, + "ResponseBody": { + "id": "/subscriptions/0accec26-d6de-4757-8e74-d080f38eaaab", + "authorizationSource": "RoleBased", + "managedByTenants": [], + "subscriptionId": "0accec26-d6de-4757-8e74-d080f38eaaab", + "tenantId": "72f988bf-86f1-41af-91ab-2d7cd011db47", + "displayName": "ACR - TEST - China Team", + "state": "Enabled", + "subscriptionPolicies": { + "locationPlacementId": "Internal_2014-09-01", + "quotaId": "Internal_2014-09-01", + "spendingLimit": "Off" + } + } + } + ], + "Variables": { + "RandomSeed": "615415797", + "SUBSCRIPTION_ID": "0accec26-d6de-4757-8e74-d080f38eaaab" + } +} \ No newline at end of file diff --git a/sdk/resourcemanager/Azure.ResourceManager.Core/tests/SessionRecords/SubscriptionContainerTests/DoesExist()Async.json b/sdk/resourcemanager/Azure.ResourceManager.Core/tests/SessionRecords/SubscriptionContainerTests/DoesExist()Async.json new file mode 100644 index 000000000000..2c94e3559018 --- /dev/null +++ b/sdk/resourcemanager/Azure.ResourceManager.Core/tests/SessionRecords/SubscriptionContainerTests/DoesExist()Async.json @@ -0,0 +1,134 @@ +{ + "Entries": [ + { + "RequestUri": "https://management.azure.com/subscriptions/0accec26-d6de-4757-8e74-d080f38eaaab?api-version=2019-11-01", + "RequestMethod": "GET", + "RequestHeaders": { + "Accept": "application/json", + "Authorization": "Sanitized", + "User-Agent": [ + "azsdk-net-ResourceManager.Core/1.0.0-alpha.20210517.1", + "(.NET Core 4.6.30015.01; Microsoft Windows 10.0.19043 )" + ], + "x-ms-client-request-id": "6d4d06e07879edd54803f4f7c30212b5", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "Cache-Control": "no-cache", + "Content-Length": "403", + "Content-Type": "application/json; charset=utf-8", + "Date": "Mon, 17 May 2021 08:56:39 GMT", + "Expires": "-1", + "Pragma": "no-cache", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains", + "X-Content-Type-Options": "nosniff", + "x-ms-correlation-request-id": "ca062cdf-cf15-4404-99c3-aabb615c1596", + "x-ms-ratelimit-remaining-subscription-reads": "11998", + "x-ms-request-id": "ca062cdf-cf15-4404-99c3-aabb615c1596", + "x-ms-routing-request-id": "SOUTHEASTASIA:20210517T085640Z:ca062cdf-cf15-4404-99c3-aabb615c1596" + }, + "ResponseBody": { + "id": "/subscriptions/0accec26-d6de-4757-8e74-d080f38eaaab", + "authorizationSource": "RoleBased", + "managedByTenants": [], + "subscriptionId": "0accec26-d6de-4757-8e74-d080f38eaaab", + "tenantId": "72f988bf-86f1-41af-91ab-2d7cd011db47", + "displayName": "ACR - TEST - China Team", + "state": "Enabled", + "subscriptionPolicies": { + "locationPlacementId": "Internal_2014-09-01", + "quotaId": "Internal_2014-09-01", + "spendingLimit": "Off" + } + } + }, + { + "RequestUri": "https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000?api-version=2019-11-01", + "RequestMethod": "GET", + "RequestHeaders": { + "Accept": "application/json", + "Authorization": "Sanitized", + "traceparent": "00-53c24e295893f14498a19838b7dad36c-b6e96189acb29042-00", + "User-Agent": [ + "azsdk-net-ResourceManager.Core/1.0.0-alpha.20210517.1", + "(.NET Core 4.6.30015.01; Microsoft Windows 10.0.19043 )" + ], + "x-ms-client-request-id": "967edcb9df34ccc76c84a3cf54e20e27", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": null, + "StatusCode": 404, + "ResponseHeaders": { + "Cache-Control": "no-cache", + "Content-Length": "129", + "Content-Type": "application/json; charset=utf-8", + "Date": "Mon, 17 May 2021 08:56:39 GMT", + "Expires": "-1", + "Pragma": "no-cache", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains", + "X-Content-Type-Options": "nosniff", + "x-ms-correlation-request-id": "858f343c-5137-46c3-b6ba-bb65ac6f6c0a", + "x-ms-failure-cause": "gateway", + "x-ms-request-id": "858f343c-5137-46c3-b6ba-bb65ac6f6c0a", + "x-ms-routing-request-id": "SOUTHEASTASIA:20210517T085640Z:858f343c-5137-46c3-b6ba-bb65ac6f6c0a" + }, + "ResponseBody": { + "error": { + "code": "SubscriptionNotFound", + "message": "The subscription \u002700000000-0000-0000-0000-000000000000\u0027 could not be found." + } + } + }, + { + "RequestUri": "https://management.azure.com/subscriptions/0accec26-d6de-4757-8e74-d080f38eaaab?api-version=2019-11-01", + "RequestMethod": "GET", + "RequestHeaders": { + "Accept": "application/json", + "Authorization": "Sanitized", + "traceparent": "00-4971231a259f0f44be175f01c612ebd1-9da1f2c1a9eace45-00", + "User-Agent": [ + "azsdk-net-ResourceManager.Core/1.0.0-alpha.20210517.1", + "(.NET Core 4.6.30015.01; Microsoft Windows 10.0.19043 )" + ], + "x-ms-client-request-id": "e7dce1e0e7a6229c64685e8517e432f3", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "Cache-Control": "no-cache", + "Content-Length": "403", + "Content-Type": "application/json; charset=utf-8", + "Date": "Mon, 17 May 2021 08:56:39 GMT", + "Expires": "-1", + "Pragma": "no-cache", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains", + "X-Content-Type-Options": "nosniff", + "x-ms-correlation-request-id": "ecf58bba-9a69-4ebb-87b6-e61dfb38b13b", + "x-ms-ratelimit-remaining-subscription-reads": "11997", + "x-ms-request-id": "ecf58bba-9a69-4ebb-87b6-e61dfb38b13b", + "x-ms-routing-request-id": "SOUTHEASTASIA:20210517T085640Z:ecf58bba-9a69-4ebb-87b6-e61dfb38b13b" + }, + "ResponseBody": { + "id": "/subscriptions/0accec26-d6de-4757-8e74-d080f38eaaab", + "authorizationSource": "RoleBased", + "managedByTenants": [], + "subscriptionId": "0accec26-d6de-4757-8e74-d080f38eaaab", + "tenantId": "72f988bf-86f1-41af-91ab-2d7cd011db47", + "displayName": "ACR - TEST - China Team", + "state": "Enabled", + "subscriptionPolicies": { + "locationPlacementId": "Internal_2014-09-01", + "quotaId": "Internal_2014-09-01", + "spendingLimit": "Off" + } + } + } + ], + "Variables": { + "RandomSeed": "2103169327", + "SUBSCRIPTION_ID": "0accec26-d6de-4757-8e74-d080f38eaaab" + } +} \ No newline at end of file diff --git a/sdk/resourcemanager/Azure.ResourceManager.Core/tests/SessionRecords/SubscriptionContainerTests/TryGet().json b/sdk/resourcemanager/Azure.ResourceManager.Core/tests/SessionRecords/SubscriptionContainerTests/TryGet().json new file mode 100644 index 000000000000..ec3dbe17f8d5 --- /dev/null +++ b/sdk/resourcemanager/Azure.ResourceManager.Core/tests/SessionRecords/SubscriptionContainerTests/TryGet().json @@ -0,0 +1,134 @@ +{ + "Entries": [ + { + "RequestUri": "https://management.azure.com/subscriptions/0accec26-d6de-4757-8e74-d080f38eaaab?api-version=2019-11-01", + "RequestMethod": "GET", + "RequestHeaders": { + "Accept": "application/json", + "Authorization": "Sanitized", + "User-Agent": [ + "azsdk-net-ResourceManager.Core/1.0.0-alpha.20210517.1", + "(.NET Core 4.6.30015.01; Microsoft Windows 10.0.19043 )" + ], + "x-ms-client-request-id": "5f67e6e5bbb1c55597815398f29990ac", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "Cache-Control": "no-cache", + "Content-Length": "403", + "Content-Type": "application/json; charset=utf-8", + "Date": "Mon, 17 May 2021 08:25:20 GMT", + "Expires": "-1", + "Pragma": "no-cache", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains", + "X-Content-Type-Options": "nosniff", + "x-ms-correlation-request-id": "10f2b5d6-16a7-4547-ba12-229860122de6", + "x-ms-ratelimit-remaining-subscription-reads": "11998", + "x-ms-request-id": "10f2b5d6-16a7-4547-ba12-229860122de6", + "x-ms-routing-request-id": "SOUTHEASTASIA:20210517T082521Z:10f2b5d6-16a7-4547-ba12-229860122de6" + }, + "ResponseBody": { + "id": "/subscriptions/0accec26-d6de-4757-8e74-d080f38eaaab", + "authorizationSource": "RoleBased", + "managedByTenants": [], + "subscriptionId": "0accec26-d6de-4757-8e74-d080f38eaaab", + "tenantId": "72f988bf-86f1-41af-91ab-2d7cd011db47", + "displayName": "ACR - TEST - China Team", + "state": "Enabled", + "subscriptionPolicies": { + "locationPlacementId": "Internal_2014-09-01", + "quotaId": "Internal_2014-09-01", + "spendingLimit": "Off" + } + } + }, + { + "RequestUri": "https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000?api-version=2019-11-01", + "RequestMethod": "GET", + "RequestHeaders": { + "Accept": "application/json", + "Authorization": "Sanitized", + "traceparent": "00-06bfb33bbc7d2d4489e43a23ead2498e-6fd10317b668374d-00", + "User-Agent": [ + "azsdk-net-ResourceManager.Core/1.0.0-alpha.20210517.1", + "(.NET Core 4.6.30015.01; Microsoft Windows 10.0.19043 )" + ], + "x-ms-client-request-id": "b8265557a1ecc6e90c040fa3e146cc6e", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": null, + "StatusCode": 404, + "ResponseHeaders": { + "Cache-Control": "no-cache", + "Content-Length": "129", + "Content-Type": "application/json; charset=utf-8", + "Date": "Mon, 17 May 2021 08:25:21 GMT", + "Expires": "-1", + "Pragma": "no-cache", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains", + "X-Content-Type-Options": "nosniff", + "x-ms-correlation-request-id": "d7f4014d-2a63-400d-9bdc-a6c5cda0465a", + "x-ms-failure-cause": "gateway", + "x-ms-request-id": "d7f4014d-2a63-400d-9bdc-a6c5cda0465a", + "x-ms-routing-request-id": "SOUTHEASTASIA:20210517T082521Z:d7f4014d-2a63-400d-9bdc-a6c5cda0465a" + }, + "ResponseBody": { + "error": { + "code": "SubscriptionNotFound", + "message": "The subscription \u002700000000-0000-0000-0000-000000000000\u0027 could not be found." + } + } + }, + { + "RequestUri": "https://management.azure.com/subscriptions/0accec26-d6de-4757-8e74-d080f38eaaab?api-version=2019-11-01", + "RequestMethod": "GET", + "RequestHeaders": { + "Accept": "application/json", + "Authorization": "Sanitized", + "traceparent": "00-4810d819e42ad0458a57dffa1021a9d3-651986ce304d5c49-00", + "User-Agent": [ + "azsdk-net-ResourceManager.Core/1.0.0-alpha.20210517.1", + "(.NET Core 4.6.30015.01; Microsoft Windows 10.0.19043 )" + ], + "x-ms-client-request-id": "3b2da0aa02b8733139640f6caaabd042", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "Cache-Control": "no-cache", + "Content-Length": "403", + "Content-Type": "application/json; charset=utf-8", + "Date": "Mon, 17 May 2021 08:25:21 GMT", + "Expires": "-1", + "Pragma": "no-cache", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains", + "X-Content-Type-Options": "nosniff", + "x-ms-correlation-request-id": "e66f2064-23e5-42ac-a89a-2e43fa7f47b0", + "x-ms-ratelimit-remaining-subscription-reads": "11997", + "x-ms-request-id": "e66f2064-23e5-42ac-a89a-2e43fa7f47b0", + "x-ms-routing-request-id": "SOUTHEASTASIA:20210517T082521Z:e66f2064-23e5-42ac-a89a-2e43fa7f47b0" + }, + "ResponseBody": { + "id": "/subscriptions/0accec26-d6de-4757-8e74-d080f38eaaab", + "authorizationSource": "RoleBased", + "managedByTenants": [], + "subscriptionId": "0accec26-d6de-4757-8e74-d080f38eaaab", + "tenantId": "72f988bf-86f1-41af-91ab-2d7cd011db47", + "displayName": "ACR - TEST - China Team", + "state": "Enabled", + "subscriptionPolicies": { + "locationPlacementId": "Internal_2014-09-01", + "quotaId": "Internal_2014-09-01", + "spendingLimit": "Off" + } + } + } + ], + "Variables": { + "RandomSeed": "89275053", + "SUBSCRIPTION_ID": "0accec26-d6de-4757-8e74-d080f38eaaab" + } +} \ No newline at end of file diff --git a/sdk/resourcemanager/Azure.ResourceManager.Core/tests/SessionRecords/SubscriptionContainerTests/TryGet()Async.json b/sdk/resourcemanager/Azure.ResourceManager.Core/tests/SessionRecords/SubscriptionContainerTests/TryGet()Async.json new file mode 100644 index 000000000000..b63c86764ec6 --- /dev/null +++ b/sdk/resourcemanager/Azure.ResourceManager.Core/tests/SessionRecords/SubscriptionContainerTests/TryGet()Async.json @@ -0,0 +1,134 @@ +{ + "Entries": [ + { + "RequestUri": "https://management.azure.com/subscriptions/0accec26-d6de-4757-8e74-d080f38eaaab?api-version=2019-11-01", + "RequestMethod": "GET", + "RequestHeaders": { + "Accept": "application/json", + "Authorization": "Sanitized", + "User-Agent": [ + "azsdk-net-ResourceManager.Core/1.0.0-alpha.20210517.1", + "(.NET Core 4.6.30015.01; Microsoft Windows 10.0.19043 )" + ], + "x-ms-client-request-id": "08e27b197f19770c22c185089ff3893e", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "Cache-Control": "no-cache", + "Content-Length": "403", + "Content-Type": "application/json; charset=utf-8", + "Date": "Mon, 17 May 2021 08:56:40 GMT", + "Expires": "-1", + "Pragma": "no-cache", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains", + "X-Content-Type-Options": "nosniff", + "x-ms-correlation-request-id": "c4c7ae5a-c0f9-4724-b86b-80495b91dbc9", + "x-ms-ratelimit-remaining-subscription-reads": "11996", + "x-ms-request-id": "c4c7ae5a-c0f9-4724-b86b-80495b91dbc9", + "x-ms-routing-request-id": "SOUTHEASTASIA:20210517T085640Z:c4c7ae5a-c0f9-4724-b86b-80495b91dbc9" + }, + "ResponseBody": { + "id": "/subscriptions/0accec26-d6de-4757-8e74-d080f38eaaab", + "authorizationSource": "RoleBased", + "managedByTenants": [], + "subscriptionId": "0accec26-d6de-4757-8e74-d080f38eaaab", + "tenantId": "72f988bf-86f1-41af-91ab-2d7cd011db47", + "displayName": "ACR - TEST - China Team", + "state": "Enabled", + "subscriptionPolicies": { + "locationPlacementId": "Internal_2014-09-01", + "quotaId": "Internal_2014-09-01", + "spendingLimit": "Off" + } + } + }, + { + "RequestUri": "https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000?api-version=2019-11-01", + "RequestMethod": "GET", + "RequestHeaders": { + "Accept": "application/json", + "Authorization": "Sanitized", + "traceparent": "00-147c0ff04cf1964db885c9fd13e7daec-92ce39d13d1dcd4b-00", + "User-Agent": [ + "azsdk-net-ResourceManager.Core/1.0.0-alpha.20210517.1", + "(.NET Core 4.6.30015.01; Microsoft Windows 10.0.19043 )" + ], + "x-ms-client-request-id": "6b14fde4e729027e18626b6369a0981c", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": null, + "StatusCode": 404, + "ResponseHeaders": { + "Cache-Control": "no-cache", + "Content-Length": "129", + "Content-Type": "application/json; charset=utf-8", + "Date": "Mon, 17 May 2021 08:56:40 GMT", + "Expires": "-1", + "Pragma": "no-cache", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains", + "X-Content-Type-Options": "nosniff", + "x-ms-correlation-request-id": "77762705-5daa-4b46-93d2-0bd6594b7ce3", + "x-ms-failure-cause": "gateway", + "x-ms-request-id": "77762705-5daa-4b46-93d2-0bd6594b7ce3", + "x-ms-routing-request-id": "SOUTHEASTASIA:20210517T085640Z:77762705-5daa-4b46-93d2-0bd6594b7ce3" + }, + "ResponseBody": { + "error": { + "code": "SubscriptionNotFound", + "message": "The subscription \u002700000000-0000-0000-0000-000000000000\u0027 could not be found." + } + } + }, + { + "RequestUri": "https://management.azure.com/subscriptions/0accec26-d6de-4757-8e74-d080f38eaaab?api-version=2019-11-01", + "RequestMethod": "GET", + "RequestHeaders": { + "Accept": "application/json", + "Authorization": "Sanitized", + "traceparent": "00-51756dffa3e4694c8096bd575d743b97-4c68a7fb73e20443-00", + "User-Agent": [ + "azsdk-net-ResourceManager.Core/1.0.0-alpha.20210517.1", + "(.NET Core 4.6.30015.01; Microsoft Windows 10.0.19043 )" + ], + "x-ms-client-request-id": "95a7da9e5805e6d4261573917aa2e17a", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "Cache-Control": "no-cache", + "Content-Length": "403", + "Content-Type": "application/json; charset=utf-8", + "Date": "Mon, 17 May 2021 08:56:40 GMT", + "Expires": "-1", + "Pragma": "no-cache", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains", + "X-Content-Type-Options": "nosniff", + "x-ms-correlation-request-id": "69a924b1-6272-4a68-b74c-9017cfbb5693", + "x-ms-ratelimit-remaining-subscription-reads": "11995", + "x-ms-request-id": "69a924b1-6272-4a68-b74c-9017cfbb5693", + "x-ms-routing-request-id": "SOUTHEASTASIA:20210517T085641Z:69a924b1-6272-4a68-b74c-9017cfbb5693" + }, + "ResponseBody": { + "id": "/subscriptions/0accec26-d6de-4757-8e74-d080f38eaaab", + "authorizationSource": "RoleBased", + "managedByTenants": [], + "subscriptionId": "0accec26-d6de-4757-8e74-d080f38eaaab", + "tenantId": "72f988bf-86f1-41af-91ab-2d7cd011db47", + "displayName": "ACR - TEST - China Team", + "state": "Enabled", + "subscriptionPolicies": { + "locationPlacementId": "Internal_2014-09-01", + "quotaId": "Internal_2014-09-01", + "spendingLimit": "Off" + } + } + } + ], + "Variables": { + "RandomSeed": "463410310", + "SUBSCRIPTION_ID": "0accec26-d6de-4757-8e74-d080f38eaaab" + } +} \ No newline at end of file From f209ab22faa20d53a3f322321a8e0e663ebd8663 Mon Sep 17 00:00:00 2001 From: m-nash Date: Mon, 17 May 2021 10:15:10 -0700 Subject: [PATCH 16/16] move models to model folder --- .../Generated/{ => Models}/LocationListResult.Serialization.cs | 0 .../src/Generated/{ => Models}/LocationListResult.cs | 0 .../src/Generated/{ => Models}/ManagedByTenant.Serialization.cs | 0 .../src/Generated/{ => Models}/ManagedByTenant.cs | 0 .../src/Generated/{ => Models}/SpendingLimit.Serialization.cs | 0 .../src/Generated/{ => Models}/SpendingLimit.cs | 0 .../src/Generated/{ => Models}/SubscriptionData.Serialization.cs | 0 .../src/Generated/{ => Models}/SubscriptionData.cs | 0 .../{ => Models}/SubscriptionListResult.Serialization.cs | 0 .../src/Generated/{ => Models}/SubscriptionListResult.cs | 0 .../Generated/{ => Models}/SubscriptionPolicies.Serialization.cs | 0 .../src/Generated/{ => Models}/SubscriptionPolicies.cs | 0 .../src/Generated/{ => Models}/SubscriptionState.Serialization.cs | 0 .../src/Generated/{ => Models}/SubscriptionState.cs | 0 14 files changed, 0 insertions(+), 0 deletions(-) rename sdk/resourcemanager/Azure.ResourceManager.Core/src/Generated/{ => Models}/LocationListResult.Serialization.cs (100%) rename sdk/resourcemanager/Azure.ResourceManager.Core/src/Generated/{ => Models}/LocationListResult.cs (100%) rename sdk/resourcemanager/Azure.ResourceManager.Core/src/Generated/{ => Models}/ManagedByTenant.Serialization.cs (100%) rename sdk/resourcemanager/Azure.ResourceManager.Core/src/Generated/{ => Models}/ManagedByTenant.cs (100%) rename sdk/resourcemanager/Azure.ResourceManager.Core/src/Generated/{ => Models}/SpendingLimit.Serialization.cs (100%) rename sdk/resourcemanager/Azure.ResourceManager.Core/src/Generated/{ => Models}/SpendingLimit.cs (100%) rename sdk/resourcemanager/Azure.ResourceManager.Core/src/Generated/{ => Models}/SubscriptionData.Serialization.cs (100%) rename sdk/resourcemanager/Azure.ResourceManager.Core/src/Generated/{ => Models}/SubscriptionData.cs (100%) rename sdk/resourcemanager/Azure.ResourceManager.Core/src/Generated/{ => Models}/SubscriptionListResult.Serialization.cs (100%) rename sdk/resourcemanager/Azure.ResourceManager.Core/src/Generated/{ => Models}/SubscriptionListResult.cs (100%) rename sdk/resourcemanager/Azure.ResourceManager.Core/src/Generated/{ => Models}/SubscriptionPolicies.Serialization.cs (100%) rename sdk/resourcemanager/Azure.ResourceManager.Core/src/Generated/{ => Models}/SubscriptionPolicies.cs (100%) rename sdk/resourcemanager/Azure.ResourceManager.Core/src/Generated/{ => Models}/SubscriptionState.Serialization.cs (100%) rename sdk/resourcemanager/Azure.ResourceManager.Core/src/Generated/{ => Models}/SubscriptionState.cs (100%) diff --git a/sdk/resourcemanager/Azure.ResourceManager.Core/src/Generated/LocationListResult.Serialization.cs b/sdk/resourcemanager/Azure.ResourceManager.Core/src/Generated/Models/LocationListResult.Serialization.cs similarity index 100% rename from sdk/resourcemanager/Azure.ResourceManager.Core/src/Generated/LocationListResult.Serialization.cs rename to sdk/resourcemanager/Azure.ResourceManager.Core/src/Generated/Models/LocationListResult.Serialization.cs diff --git a/sdk/resourcemanager/Azure.ResourceManager.Core/src/Generated/LocationListResult.cs b/sdk/resourcemanager/Azure.ResourceManager.Core/src/Generated/Models/LocationListResult.cs similarity index 100% rename from sdk/resourcemanager/Azure.ResourceManager.Core/src/Generated/LocationListResult.cs rename to sdk/resourcemanager/Azure.ResourceManager.Core/src/Generated/Models/LocationListResult.cs diff --git a/sdk/resourcemanager/Azure.ResourceManager.Core/src/Generated/ManagedByTenant.Serialization.cs b/sdk/resourcemanager/Azure.ResourceManager.Core/src/Generated/Models/ManagedByTenant.Serialization.cs similarity index 100% rename from sdk/resourcemanager/Azure.ResourceManager.Core/src/Generated/ManagedByTenant.Serialization.cs rename to sdk/resourcemanager/Azure.ResourceManager.Core/src/Generated/Models/ManagedByTenant.Serialization.cs diff --git a/sdk/resourcemanager/Azure.ResourceManager.Core/src/Generated/ManagedByTenant.cs b/sdk/resourcemanager/Azure.ResourceManager.Core/src/Generated/Models/ManagedByTenant.cs similarity index 100% rename from sdk/resourcemanager/Azure.ResourceManager.Core/src/Generated/ManagedByTenant.cs rename to sdk/resourcemanager/Azure.ResourceManager.Core/src/Generated/Models/ManagedByTenant.cs diff --git a/sdk/resourcemanager/Azure.ResourceManager.Core/src/Generated/SpendingLimit.Serialization.cs b/sdk/resourcemanager/Azure.ResourceManager.Core/src/Generated/Models/SpendingLimit.Serialization.cs similarity index 100% rename from sdk/resourcemanager/Azure.ResourceManager.Core/src/Generated/SpendingLimit.Serialization.cs rename to sdk/resourcemanager/Azure.ResourceManager.Core/src/Generated/Models/SpendingLimit.Serialization.cs diff --git a/sdk/resourcemanager/Azure.ResourceManager.Core/src/Generated/SpendingLimit.cs b/sdk/resourcemanager/Azure.ResourceManager.Core/src/Generated/Models/SpendingLimit.cs similarity index 100% rename from sdk/resourcemanager/Azure.ResourceManager.Core/src/Generated/SpendingLimit.cs rename to sdk/resourcemanager/Azure.ResourceManager.Core/src/Generated/Models/SpendingLimit.cs diff --git a/sdk/resourcemanager/Azure.ResourceManager.Core/src/Generated/SubscriptionData.Serialization.cs b/sdk/resourcemanager/Azure.ResourceManager.Core/src/Generated/Models/SubscriptionData.Serialization.cs similarity index 100% rename from sdk/resourcemanager/Azure.ResourceManager.Core/src/Generated/SubscriptionData.Serialization.cs rename to sdk/resourcemanager/Azure.ResourceManager.Core/src/Generated/Models/SubscriptionData.Serialization.cs diff --git a/sdk/resourcemanager/Azure.ResourceManager.Core/src/Generated/SubscriptionData.cs b/sdk/resourcemanager/Azure.ResourceManager.Core/src/Generated/Models/SubscriptionData.cs similarity index 100% rename from sdk/resourcemanager/Azure.ResourceManager.Core/src/Generated/SubscriptionData.cs rename to sdk/resourcemanager/Azure.ResourceManager.Core/src/Generated/Models/SubscriptionData.cs diff --git a/sdk/resourcemanager/Azure.ResourceManager.Core/src/Generated/SubscriptionListResult.Serialization.cs b/sdk/resourcemanager/Azure.ResourceManager.Core/src/Generated/Models/SubscriptionListResult.Serialization.cs similarity index 100% rename from sdk/resourcemanager/Azure.ResourceManager.Core/src/Generated/SubscriptionListResult.Serialization.cs rename to sdk/resourcemanager/Azure.ResourceManager.Core/src/Generated/Models/SubscriptionListResult.Serialization.cs diff --git a/sdk/resourcemanager/Azure.ResourceManager.Core/src/Generated/SubscriptionListResult.cs b/sdk/resourcemanager/Azure.ResourceManager.Core/src/Generated/Models/SubscriptionListResult.cs similarity index 100% rename from sdk/resourcemanager/Azure.ResourceManager.Core/src/Generated/SubscriptionListResult.cs rename to sdk/resourcemanager/Azure.ResourceManager.Core/src/Generated/Models/SubscriptionListResult.cs diff --git a/sdk/resourcemanager/Azure.ResourceManager.Core/src/Generated/SubscriptionPolicies.Serialization.cs b/sdk/resourcemanager/Azure.ResourceManager.Core/src/Generated/Models/SubscriptionPolicies.Serialization.cs similarity index 100% rename from sdk/resourcemanager/Azure.ResourceManager.Core/src/Generated/SubscriptionPolicies.Serialization.cs rename to sdk/resourcemanager/Azure.ResourceManager.Core/src/Generated/Models/SubscriptionPolicies.Serialization.cs diff --git a/sdk/resourcemanager/Azure.ResourceManager.Core/src/Generated/SubscriptionPolicies.cs b/sdk/resourcemanager/Azure.ResourceManager.Core/src/Generated/Models/SubscriptionPolicies.cs similarity index 100% rename from sdk/resourcemanager/Azure.ResourceManager.Core/src/Generated/SubscriptionPolicies.cs rename to sdk/resourcemanager/Azure.ResourceManager.Core/src/Generated/Models/SubscriptionPolicies.cs diff --git a/sdk/resourcemanager/Azure.ResourceManager.Core/src/Generated/SubscriptionState.Serialization.cs b/sdk/resourcemanager/Azure.ResourceManager.Core/src/Generated/Models/SubscriptionState.Serialization.cs similarity index 100% rename from sdk/resourcemanager/Azure.ResourceManager.Core/src/Generated/SubscriptionState.Serialization.cs rename to sdk/resourcemanager/Azure.ResourceManager.Core/src/Generated/Models/SubscriptionState.Serialization.cs diff --git a/sdk/resourcemanager/Azure.ResourceManager.Core/src/Generated/SubscriptionState.cs b/sdk/resourcemanager/Azure.ResourceManager.Core/src/Generated/Models/SubscriptionState.cs similarity index 100% rename from sdk/resourcemanager/Azure.ResourceManager.Core/src/Generated/SubscriptionState.cs rename to sdk/resourcemanager/Azure.ResourceManager.Core/src/Generated/Models/SubscriptionState.cs