Skip to content

Add twin delete all and twin relationship delete all#331

Merged
digimaun merged 22 commits into
Azure:devfrom
vilit1:twin_delete_all3
Apr 21, 2021
Merged

Add twin delete all and twin relationship delete all#331
digimaun merged 22 commits into
Azure:devfrom
vilit1:twin_delete_all3

Conversation

@vilit1
Copy link
Copy Markdown
Contributor

@vilit1 vilit1 commented Apr 19, 2021


This project has adopted the Microsoft Open Source Code of Conduct. For more information see the Code of Conduct FAQ or contact opencode@microsoft.com with any additional questions or comments.

Thank you for contributing to the IoT extension!

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

General Guidelines

  • If introducing new functionality or modified behavior, are they backed by unit and integration tests?
  • In the same context as above are command names and their parameter definitions accurate? Do help docs have sufficient content?
  • Have all unit and integration tests passed locally? i.e. pytest <project root> -vv
  • Have static checks passed using the .pylintrc and .flake8 rules? Look at the CI scripts for example usage.
  • Have you made an entry in HISTORY.rst which concisely explains your feature or change?

@vilit1 vilit1 requested a review from digimaun as a code owner April 19, 2021 18:30
@vilit1
Copy link
Copy Markdown
Contributor Author

vilit1 commented Apr 19, 2021

image

Comment thread azext_iot/digitaltwins/command_map.py Outdated
Comment thread azext_iot/digitaltwins/command_map.py Outdated
Comment thread azext_iot/digitaltwins/_help.py Outdated
Comment thread azext_iot/digitaltwins/_help.py Outdated

helps["dt twin relationship delete-all"] = """
type: command
short-summary: Deletes all digital twin relationships on a Digital Twins instance, including incomming relationships.
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Small typo for incoming.

Comment thread azext_iot/digitaltwins/_help.py
Comment thread azext_iot/digitaltwins/commands_twins.py Outdated
Comment thread azext_iot/digitaltwins/commands_twins.py Outdated
Comment thread azext_iot/digitaltwins/providers/twin.py Outdated
Comment thread azext_iot/digitaltwins/providers/twin.py
twin_provider = TwinProvider(cmd=cmd, name=name_or_hostname, rg=resource_group_name)
if twin_id:
return twin_provider.delete_all_relationship(twin_id=twin_id)
else:
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

nit - this else could be eliminated

assert len(twin_query_result["result"]) == 0
assert twin_query_result["cost"]

def test_dt_twin_delete(self):
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

nit - I think we should label these tests as bulk delete

@vilit1
Copy link
Copy Markdown
Contributor Author

vilit1 commented Apr 21, 2021

image

@digimaun digimaun merged commit d95cf8c into Azure:dev Apr 21, 2021
@vilit1 vilit1 deleted the twin_delete_all3 branch October 29, 2021 17:26
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.

2 participants