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

[DataBoxEdge] adding orders cmdlet and changes related to local share and adding iot roles #10527

Merged
merged 5 commits into from
Nov 17, 2019

Conversation

raviten
Copy link
Contributor

@raviten raviten commented Nov 13, 2019

Description

Checklist

  • I have read the Submitting Changes section of CONTRIBUTING.md
  • The title of the PR is clear and informative
  • The appropriate ChangeLog.md file(s) has been updated:
    • For any service, the ChangeLog.md file can be found at src/{{SERVICE}}/{{SERVICE}}/ChangeLog.md
    • A snippet outlining the change(s) made in the PR should be written under the ## Upcoming Release header -- no new version header should be added
  • The PR does not introduce breaking changes
  • If applicable, the changes made in the PR have proper test coverage
  • For public API changes to cmdlets:
    • a cmdlet design review was approved for the changes in this repository (Microsoft internal only)
    • the markdown help files have been regenerated using the commands listed here

design 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

@adxsdkps
Copy link
Collaborator

Can one of the admins verify this patch?

@raviten raviten changed the title adding orders cmdlet and changes related to local share and adding iot roles [DataBoxEdge] adding orders cmdlet and changes related to local share and adding iot roles Nov 13, 2019
Copy link
Member

@erich-wang erich-wang left a 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);
}


Copy link
Member

Choose a reason for hiding this comment

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

nit: remove white lines

this.ResourceGroupName);
}

private string GetResourceNotFoundMessage()
Copy link
Member

Choose a reason for hiding this comment

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

Should be GetResourceAlreadyExistMessage?

Copy link
Contributor Author

@raviten raviten Nov 16, 2019

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

Copy link
Member

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(
Copy link
Member

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

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sure, will do

@raviten
Copy link
Contributor Author

raviten commented Nov 16, 2019

@raviten , please update changelog.md as well.

Sure, will do

Ravi Teja added 2 commits November 16, 2019 21:00
…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;

Copy link
Member

@erich-wang erich-wang Nov 17, 2019

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; }
Copy link
Member

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; }

Copy link
Member

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; }
Copy link
Member

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; }
Copy link
Member

Choose a reason for hiding this comment

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

ValueFromPipelineByPropertyName = true

Copy link
Member

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.

Copy link
Contributor Author

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

Copy link
Member

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; }
Copy link
Member

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; }
Copy link
Member

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; }
Copy link
Member

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; }
Copy link
Member

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; }
Copy link
Member

Choose a reason for hiding this comment

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

ValueFromPipelineByPropertyName = true

@erich-wang erich-wang merged commit 9565241 into Azure:master Nov 17, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants