-
Notifications
You must be signed in to change notification settings - Fork 4.9k
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
Conversation
swagger PR is already merged, can any one take review on this? |
There was a problem hiding this 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 |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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
@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 } }, |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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.
@markcowl Comments are addressed. |
@azuresdkci retest this please |
Description
This checklist is used to make sure that common guidelines for a pull request are followed.
General Guidelines
Testing Guidelines
SDK Generation Guidelines
*.csproj
andAssemblyInfo.cs
files have been updated with the new version of the SDK.