Skip to content

Commit c4c0705

Browse files
authored
Merge pull request Azure#2980 from TianoMS/tiano-d2
Remove Zones support in Resource cmdlets.
2 parents 5b7c7fc + c0c6114 commit c4c0705

File tree

6 files changed

+5
-42
lines changed

6 files changed

+5
-42
lines changed

src/ResourceManager/Resources/Commands.ResourceManager/Cmdlets/Entities/Resources/Resource.cs

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -90,12 +90,6 @@ public class Resource<TProperties>
9090
[JsonProperty(Required = Required.Default)]
9191
public DateTime? ChangedTime { get; set; }
9292

93-
/// <summary>
94-
/// Gets or sets the zones.
95-
/// </summary>
96-
[JsonProperty(Required = Required.Default)]
97-
public string[] Zones { get; set; }
98-
9993
/// <summary>
10094
/// Gets or sets the tags.
10195
/// </summary>

src/ResourceManager/Resources/Commands.ResourceManager/Cmdlets/Extensions/ResourceExtensions.cs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,8 +59,7 @@ internal static PSObject ToPsObject(this Resource<JToken> resource)
5959
{ "CreatedTime", resource.CreatedTime },
6060
{ "ChangedTime", resource.ChangedTime },
6161
{ "ETag", resource.ETag },
62-
{ "Sku", resource.Sku.ToJToken().ToPsObject() },
63-
{ "Zones", resource.Zones },
62+
{ "Sku", resource.Sku.ToJToken().ToPsObject() }
6463
};
6564

6665
var resourceTypeName = resourceType == null && extensionResourceType == null

src/ResourceManager/Resources/Commands.ResourceManager/Cmdlets/Implementation/Resource/NewAzureResourceCmdlet.cs

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -75,12 +75,6 @@ public sealed class NewAzureResourceCmdlet : ResourceManipulationCmdletBase
7575
[Parameter(Mandatory = false, HelpMessage = "A hash table which represents resource tags.")]
7676
public Hashtable Tag { get; set; }
7777

78-
/// <summary>
79-
/// Gets or sets the zones.
80-
/// </summary>
81-
[Parameter(Mandatory = false, HelpMessage = "The zones.")]
82-
public string[] Zones { get; set; }
83-
8478
/// <summary>
8579
/// Gets or sets a value that indicates if the full object was passed it.
8680
/// </summary>
@@ -150,8 +144,7 @@ private Resource<JToken> GetResource()
150144
Plan = this.Plan.ToDictionary(addValueLayer: false).ToJson().FromJson<ResourcePlan>(),
151145
Sku = this.Sku.ToDictionary(addValueLayer: false).ToJson().FromJson<ResourceSku>(),
152146
Tags = TagsHelper.GetTagsDictionary(this.Tag),
153-
Properties = this.Properties.ToResourcePropertiesBody(),
154-
Zones = this.Zones
147+
Properties = this.Properties.ToResourcePropertiesBody()
155148
};
156149
}
157150

src/ResourceManager/Resources/Commands.ResourceManager/Cmdlets/Implementation/Resource/SetAzureResourceCmdlet.cs

Lines changed: 2 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -69,12 +69,6 @@ public sealed class SetAzureResourceCmdlet : ResourceManipulationCmdletBase
6969
[Parameter(Mandatory = false, ValueFromPipelineByPropertyName = true, HelpMessage = "A hash table which represents resource tags.")]
7070
public Hashtable Tag { get; set; }
7171

72-
/// <summary>
73-
/// Gets or sets the zones.
74-
/// </summary>
75-
[Parameter(Mandatory = false, ValueFromPipelineByPropertyName = true, HelpMessage = "The zones.")]
76-
public string[] Zones { get; set; }
77-
7872
/// <summary>
7973
/// Gets or sets a value that indicates if an HTTP PATCH request needs to be made instead of PUT.
8074
/// </summary>
@@ -161,8 +155,7 @@ private JToken GetResourceBody()
161155
Sku = this.Sku.ToDictionary(addValueLayer: false).ToJson().FromJson<ResourceSku>() ?? resource.Sku,
162156
Tags = TagsHelper.GetTagsDictionary(this.Tag) ?? resource.Tags,
163157
Location = resource.Location,
164-
Properties = this.Properties == null ? resource.Properties : this.Properties.ToResourcePropertiesBody(),
165-
Zones = this.Zones ?? resource.Zones
158+
Properties = this.Properties == null ? resource.Properties : this.Properties.ToResourcePropertiesBody()
166159
}.ToJToken();
167160
}
168161
else
@@ -178,7 +171,7 @@ private JToken GetResourceBody()
178171
/// </summary>
179172
private Resource<JToken> GetPatchResourceBody()
180173
{
181-
if (this.Properties == null && this.Plan == null && this.Kind == null && this.Sku == null && this.Tag == null && this.Zones == null)
174+
if (this.Properties == null && this.Plan == null && this.Kind == null && this.Sku == null && this.Tag == null)
182175
{
183176
return null;
184177
}
@@ -210,11 +203,6 @@ private Resource<JToken> GetPatchResourceBody()
210203
resourceBody.Tags = TagsHelper.GetTagsDictionary(this.Tag);
211204
}
212205

213-
if (this.Zones != null)
214-
{
215-
resourceBody.Zones = this.Zones;
216-
}
217-
218206
return resourceBody;
219207
}
220208

src/ResourceManager/Resources/Commands.ResourceManager/Cmdlets/Microsoft.Azure.Commands.ResourceManager.Cmdlets.format.ps1xml

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -302,10 +302,6 @@
302302
<Label>ApiVersions</Label>
303303
<PropertyName>ApiVersions</PropertyName>
304304
</ListItem>
305-
<ListItem>
306-
<Label>ZoneMappings</Label>
307-
<PropertyName>ZoneMappings</PropertyName>
308-
</ListItem>
309305
</ListItems>
310306
</ListEntry>
311307
</ListEntries>
@@ -336,13 +332,6 @@
336332
<Label>Locations</Label>
337333
<PropertyName>Locations</PropertyName>
338334
</ListItem>
339-
<ListItem>
340-
<Label>ZoneMappings</Label>
341-
<PropertyName>ZoneMappings</PropertyName>
342-
<ItemSelectionCondition>
343-
<ScriptBlock>$_.ZoneMappings</ScriptBlock>
344-
</ItemSelectionCondition>
345-
</ListItem>
346335
</ListItems>
347336
</ListEntry>
348337
</ListEntries>

src/ResourceManager/Resources/Commands.Resources.Test/ScenarioTests/ResourceTests.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ public void TestGetResourceWithCollection()
133133
ResourcesController.NewInstance.RunPsTest("Test-GetResourceWithCollection");
134134
}
135135

136-
[Fact]
136+
[Fact(Skip = "Zones are disabled for now.")]
137137
[Trait(Category.AcceptanceType, Category.CheckIn)]
138138
public void TestManageResourceWithZones()
139139
{

0 commit comments

Comments
 (0)