Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

[Storage] Supported vnetacl #3347

Merged
merged 6 commits into from Jun 19, 2017
Merged

Conversation

JasonYang-MSFT
Copy link
Member

@JasonYang-MSFT JasonYang-MSFT commented Jun 9, 2017

Description


This checklist is used to make sure that common guidelines for a pull request are followed.

General Guidelines

  • Title of the pull request is clear and informative.
  • There are a small number of commits, each of which have an informative message. This means that previously merged commits do not appear in the history of the PR. For more information on cleaning up the commits in your PR, see this page.

Testing Guidelines

  • Pull request includes test coverage for the included changes.

SDK Generation Guidelines

  • If an SDK is being regenerated based on a new swagger spec, a link to the pull request containing these swagger spec changes has been included above.
  • The generate.cmd file for the SDK has been updated with the version of AutoRest, as well as the commitid of your swagger spec or link to the swagger spec, used to generate the code.
  • The *.csproj and AssemblyInfo.cs files have been updated with the new version of the SDK.

@JasonYang-MSFT
Copy link
Member Author

@JasonYang-MSFT
Copy link
Member Author

swagger PR is already merged, can any one take review on this?

Copy link
Member

@markcowl markcowl left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One question about an enum with a single value. Otherwise LGTM

/// Defines values for Action.
/// </summary>
[JsonConverter(typeof(Newtonsoft.Json.Converters.StringEnumConverter))]
public enum Action
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why do we have an enum with only one value? Seems that this should just be a default value that is always serialized, rether than forcing the user to provide a proeprty that has only one possible value

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"Deny" could be a possible value to be added for disable specific vnetset. That's reason to set it as a enum here.
I already set default value as "Allow" in swagger, https://github.com/Azure/azure-rest-api-specs/blob/master/arm-storage/2017-06-01/swagger/storage.json#L885. But with "x-ms-enum" extension, it seems default value is not set. And "x-ms-enum" is required for swagger's linter check.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@JasonYang-MSFT Looking at the swagger, you have provided the correct information. My concern is that this property is not required, so that a user doesn't have to provide iot. What happens if this property is not provided by the user? I think you need to explicitly test this.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I just added a rule without action, this property could be set to "allow" by server side. So in this version, user doesn't need to provide it if user want to create a rule with aciton "allow", though this is the only value.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Excellent, that is precisely what you swagger spec says, thanks for the extra effort

@JasonYang-MSFT
Copy link
Member Author

@markcowl Comment is replied.

NetworkAcls = new StorageNetworkAcls
{
Bypass = @"Logging, Metrics",
IpRules = new List<IPRule> { new IPRule { IPAddressOrRange = "23.45.67.91", Action = Microsoft.Azure.Management.Storage.Models.Action.Allow } },
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is the potential issue. 'Action' is not a required property for this type. You should have a test that does not supply the Action value

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You could simply add an additional rule to this array that doesn't contain this data

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A rule without action added.

/// Defines values for Action.
/// </summary>
[JsonConverter(typeof(Newtonsoft.Json.Converters.StringEnumConverter))]
public enum Action
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@JasonYang-MSFT Looking at the swagger, you have provided the correct information. My concern is that this property is not required, so that a user doesn't have to provide iot. What happens if this property is not provided by the user? I think you need to explicitly test this.

@JasonYang-MSFT
Copy link
Member Author

@markcowl Comments are addressed.

@markcowl
Copy link
Member

@azuresdkci retest this please

@cormacpayne cormacpayne merged commit 4951f8f into Azure:psSdkJson6 Jun 19, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants