-
Notifications
You must be signed in to change notification settings - Fork 3.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
[DataBoxEdge] adding orders cmdlet and changes related to local share and adding iot roles #10527
Conversation
Can one of the admins verify this patch? |
src/DataBoxEdge/DataBoxEdge/Common/Cmdlets/Orders/DataBoxEdgeOrderGetCmdlet.cs
Show resolved
Hide resolved
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.
@raviten , please update changelog.md as well.
WriteObject(ListResource(), true); | ||
} | ||
|
||
|
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.
nit: remove white lines
src/DataBoxEdge/DataBoxEdge/Common/Cmdlets/Orders/DataBoxEdgeOrderNewCmdlet.cs
Show resolved
Hide resolved
this.ResourceGroupName); | ||
} | ||
|
||
private string GetResourceNotFoundMessage() |
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.
Should be GetResourceAlreadyExistMessage?
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 was consistent with other code structure, Is it fine if i raise a separate PR for this kind of change
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 mean the method name is the opposite of what it really does, so you should change its name to 'GetResourceAlreadyExistMessage'
@@ -143,14 +186,33 @@ private PSResourceModel CreateResourceModel() | |||
this.ResourceGroupName)); | |||
} | |||
|
|||
private ResourceModel AddAzureContainer(ResourceModel resourceModel) | |||
{ | |||
var sac = this.DataBoxEdgeManagementClient.StorageAccountCredentials.Get( |
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.
please use meaningful name instead of sac
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.
Sure, will do
Sure, will do |
…rderHistory as they will be part of output object only. Updated changelog md and sorted name spaces
using PSResourceModel = Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.PSDataBoxEdgeOrder; | ||
using PSTopLevelResource = Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.PSDataBoxEdgeDevice; | ||
using ResourceModel = Microsoft.Azure.Management.EdgeGateway.Models.Order; | ||
|
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.
Do not need to use alias for them, simply use original type name will be fine, same for other cmdlets.
ParameterSetName = GetByDeviceObjectParameterSet, | ||
HelpMessage = Constants.PsDeviceObjectHelpMessage)] | ||
[ValidateNotNullOrEmpty] | ||
public PSTopLevelResource DeviceObject { get; set; } |
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.
Please add
ValueFromPipeline = true
HelpMessage = Constants.ResourceIdHelpMessage)] | ||
[ValidateNotNullOrEmpty] | ||
public string ResourceId { get; set; } | ||
|
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.
ValueFromPipelineByPropertyName = true
Position = 0)] | ||
[ValidateNotNullOrEmpty] | ||
[ResourceGroupCompleter] | ||
public string ResourceGroupName { get; set; } |
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.
ValueFromPipelineByPropertyName = true
Position = 1)] | ||
[ResourceNameCompleter("Microsoft.DataBoxEdge/dataBoxEdgeDevices", nameof(ResourceGroupName))] | ||
[ValidateNotNullOrEmpty] | ||
public string DeviceName { get; set; } |
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.
ValueFromPipelineByPropertyName = true
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.
Please use Name as parameter name, and use DeviceName as alias. Same for other cmdlet.
Normally we prefer to use Name for current level resource.
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.
For each and every Order's resource name is constant and value of order's name is default and is under parent resource DataBoxEdge's resource which is referred here as DeviceName.
Since taking Name as parameter is redundant skipped accepting Name as parameter but in the future for some reason name can be reused
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.
In this case, please keep DeviceName
HelpMessage = Constants.InputObjectHelpMessage | ||
)] | ||
[ValidateNotNull] | ||
public PSResourceModel InputObject { get; set; } |
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.
ValueFromPipeline = true
HelpMessage = Constants.ResourceGroupNameHelpMessage, Position = 0)] | ||
[ValidateNotNullOrEmpty] | ||
[ResourceGroupCompleter] | ||
public string ResourceGroupName { get; set; } |
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.
ValueFromPipelineByPropertyName = true
[Parameter(Mandatory = true, ParameterSetName = DeleteByNameParameterSet, | ||
HelpMessage = Constants.DeviceNameHelpMessage, Position = 1)] | ||
[ValidateNotNullOrEmpty] | ||
public string DeviceName { get; set; } |
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.
ValueFromPipelineByPropertyName = true
ParameterSetName = SetByResourceIdParameterSet, | ||
HelpMessage = Constants.ResourceIdHelpMessage)] | ||
[ValidateNotNullOrEmpty] | ||
public string ResourceId { get; set; } |
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.
ValueFromPipelineByPropertyName = true
Position = 0)] | ||
[ValidateNotNullOrEmpty] | ||
[ResourceGroupCompleter] | ||
public string ResourceGroupName { get; set; } |
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.
ValueFromPipelineByPropertyName = true
Description
Checklist
CONTRIBUTING.md
ChangeLog.md
file(s) has been updated:ChangeLog.md
file can be found atsrc/{{SERVICE}}/{{SERVICE}}/ChangeLog.md
## Upcoming Release
header -- no new version header should be addeddesign review
Had made change from TrackingInfo to ForwardTrackingInfo as suggested
Had made change of parameterset for share creation as it requires DataFormat in Cloud Share creation only