Skip to content

Remove Zones support in Resource cmdlets. #2980

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Sep 22, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -90,12 +90,6 @@ public class Resource<TProperties>
[JsonProperty(Required = Required.Default)]
public DateTime? ChangedTime { get; set; }

/// <summary>
/// Gets or sets the zones.
/// </summary>
[JsonProperty(Required = Required.Default)]
public string[] Zones { get; set; }

/// <summary>
/// Gets or sets the tags.
/// </summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,7 @@ internal static PSObject ToPsObject(this Resource<JToken> resource)
{ "CreatedTime", resource.CreatedTime },
{ "ChangedTime", resource.ChangedTime },
{ "ETag", resource.ETag },
{ "Sku", resource.Sku.ToJToken().ToPsObject() },
{ "Zones", resource.Zones },
{ "Sku", resource.Sku.ToJToken().ToPsObject() }
};

var resourceTypeName = resourceType == null && extensionResourceType == null
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,12 +75,6 @@ public sealed class NewAzureResourceCmdlet : ResourceManipulationCmdletBase
[Parameter(Mandatory = false, HelpMessage = "A hash table which represents resource tags.")]
public Hashtable Tag { get; set; }

/// <summary>
/// Gets or sets the zones.
/// </summary>
[Parameter(Mandatory = false, HelpMessage = "The zones.")]
public string[] Zones { get; set; }

/// <summary>
/// Gets or sets a value that indicates if the full object was passed it.
/// </summary>
Expand Down Expand Up @@ -150,8 +144,7 @@ private Resource<JToken> GetResource()
Plan = this.Plan.ToDictionary(addValueLayer: false).ToJson().FromJson<ResourcePlan>(),
Sku = this.Sku.ToDictionary(addValueLayer: false).ToJson().FromJson<ResourceSku>(),
Tags = TagsHelper.GetTagsDictionary(this.Tag),
Properties = this.Properties.ToResourcePropertiesBody(),
Zones = this.Zones
Properties = this.Properties.ToResourcePropertiesBody()
};
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,12 +69,6 @@ public sealed class SetAzureResourceCmdlet : ResourceManipulationCmdletBase
[Parameter(Mandatory = false, ValueFromPipelineByPropertyName = true, HelpMessage = "A hash table which represents resource tags.")]
public Hashtable Tag { get; set; }

/// <summary>
/// Gets or sets the zones.
/// </summary>
[Parameter(Mandatory = false, ValueFromPipelineByPropertyName = true, HelpMessage = "The zones.")]
public string[] Zones { get; set; }

/// <summary>
/// Gets or sets a value that indicates if an HTTP PATCH request needs to be made instead of PUT.
/// </summary>
Expand Down Expand Up @@ -161,8 +155,7 @@ private JToken GetResourceBody()
Sku = this.Sku.ToDictionary(addValueLayer: false).ToJson().FromJson<ResourceSku>() ?? resource.Sku,
Tags = TagsHelper.GetTagsDictionary(this.Tag) ?? resource.Tags,
Location = resource.Location,
Properties = this.Properties == null ? resource.Properties : this.Properties.ToResourcePropertiesBody(),
Zones = this.Zones ?? resource.Zones
Properties = this.Properties == null ? resource.Properties : this.Properties.ToResourcePropertiesBody()
}.ToJToken();
}
else
Expand All @@ -178,7 +171,7 @@ private JToken GetResourceBody()
/// </summary>
private Resource<JToken> GetPatchResourceBody()
{
if (this.Properties == null && this.Plan == null && this.Kind == null && this.Sku == null && this.Tag == null && this.Zones == null)
if (this.Properties == null && this.Plan == null && this.Kind == null && this.Sku == null && this.Tag == null)
{
return null;
}
Expand Down Expand Up @@ -210,11 +203,6 @@ private Resource<JToken> GetPatchResourceBody()
resourceBody.Tags = TagsHelper.GetTagsDictionary(this.Tag);
}

if (this.Zones != null)
{
resourceBody.Zones = this.Zones;
}

return resourceBody;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -302,10 +302,6 @@
<Label>ApiVersions</Label>
<PropertyName>ApiVersions</PropertyName>
</ListItem>
<ListItem>
<Label>ZoneMappings</Label>
<PropertyName>ZoneMappings</PropertyName>
</ListItem>
</ListItems>
</ListEntry>
</ListEntries>
Expand Down Expand Up @@ -336,13 +332,6 @@
<Label>Locations</Label>
<PropertyName>Locations</PropertyName>
</ListItem>
<ListItem>
<Label>ZoneMappings</Label>
<PropertyName>ZoneMappings</PropertyName>
<ItemSelectionCondition>
<ScriptBlock>$_.ZoneMappings</ScriptBlock>
</ItemSelectionCondition>
</ListItem>
</ListItems>
</ListEntry>
</ListEntries>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ public void TestGetResourceWithCollection()
ResourcesController.NewInstance.RunPsTest("Test-GetResourceWithCollection");
}

[Fact]
[Fact(Skip = "Zones are disabled for now.")]
[Trait(Category.AcceptanceType, Category.CheckIn)]
public void TestManageResourceWithZones()
{
Expand Down