-
Notifications
You must be signed in to change notification settings - Fork 66
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
[Draft] Adds nested Edge hierarchy creation command #580
Closed
Closed
Changes from all commits
Commits
Show all changes
14 commits
Select commit
Hold shift + click to select a range
4f8f6b8
Initial nested edge hierarchy implementation
c-ryan-k abb1598
Moved edge hierarchy command into provider pattern
c-ryan-k 1ea29c7
Remove Default Edge Agent from edge hierarchy config
c-ryan-k abec0a5
Linter fixes
c-ryan-k 5235b3f
Pattern updates and initial tests
c-ryan-k 1f4c374
Cleanup / linting / refactoring, test updates
c-ryan-k a84c21e
Added integration tests and minor fix in multi-step hierarchy logic
c-ryan-k e216547
Help Updates
c-ryan-k 7c926d9
Added deployment config processing and unit tests
c-ryan-k db4935e
Updated YAML parsing exception handling
c-ryan-k 1247ef3
Merge branch 'azure-dev' into nested_edge_rebase
c-ryan-k 1b2b37a
Cleanup
c-ryan-k 7454f68
Merge branch 'dev' into nested_edge_rebase
c-ryan-k dceb0a0
Wave of PR feedback
c-ryan-k File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
# coding=utf-8 | ||
# -------------------------------------------------------------------------------------------- | ||
# Copyright (c) Microsoft Corporation. All rights reserved. | ||
# Licensed under the MIT License. See License.txt in the project root for license information. | ||
# -------------------------------------------------------------------------------------------- | ||
|
||
from typing import List, Optional | ||
from azext_iot.iothub.providers.device_identity import DeviceIdentityProvider | ||
from knack.log import get_logger | ||
|
||
logger = get_logger(__name__) | ||
|
||
|
||
def iot_edge_hierarchy_create( | ||
cmd, | ||
devices: Optional[List[List[str]]] = None, | ||
config_file: Optional[str] = None, | ||
visualize: Optional[bool] = False, | ||
clean: Optional[bool] = False, | ||
hub_name: Optional[str] = None, | ||
resource_group_name: Optional[str] = None, | ||
login: Optional[str] = None, | ||
auth_type_dataplane: Optional[str] = None, | ||
): | ||
device_identity_provider = DeviceIdentityProvider( | ||
cmd=cmd, | ||
hub_name=hub_name, | ||
rg=resource_group_name, | ||
login=login, | ||
auth_type_dataplane=auth_type_dataplane, | ||
) | ||
return device_identity_provider.create_edge_hierarchy( | ||
devices=devices, | ||
config_file=config_file, | ||
clean=clean, | ||
visualize=visualize, | ||
) | ||
|
||
|
||
def iot_delete_devices( | ||
cmd, | ||
device_ids: List[str], | ||
confirm: Optional[bool] = True, | ||
hub_name: Optional[str] = None, | ||
resource_group_name: Optional[str] = None, | ||
login: Optional[str] = None, | ||
auth_type_dataplane: Optional[str] = None, | ||
): | ||
device_identity_provider = DeviceIdentityProvider( | ||
cmd=cmd, | ||
hub_name=hub_name, | ||
rg=resource_group_name, | ||
login=login, | ||
auth_type_dataplane=auth_type_dataplane, | ||
) | ||
return device_identity_provider.delete_device_identities( | ||
device_ids=device_ids, | ||
confirm=confirm | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
We should double-check the official terminology for this topic to ensure alignment...I've seen both "hierarchy" and "topology" being used.