Skip to content

Remove all unused Disks, PIPs and NICs from a resource group #445

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

Merged
merged 1 commit into from
Apr 23, 2021

Conversation

jyejare
Copy link
Contributor

@jyejare jyejare commented Mar 17, 2021

Closes #444 .

Additionaly, this PR adds a single function to remove all unused resources called cleanup_resources().

@jyejare
Copy link
Contributor Author

jyejare commented Mar 17, 2021

Test Results:

In[6]: asys.cleanup_resources()
Out[6]: True

@jyejare
Copy link
Contributor Author

jyejare commented Mar 22, 2021

Need a review here please !

@mshriver mshriver added the Azure label Mar 26, 2021
@jyejare
Copy link
Contributor Author

jyejare commented Apr 3, 2021

@mshriver Everything works perfect post changes:

> asys
<wrapanapi.systems.msazure.AzureSystem object at 0x10c141040>
> asys.list_free_nics()
['gqfzadzwnl-nic0', 'hoogczhxgw-nic0', 'hqwklatgvu-nic0', 'jbwdicmdrm-nic0', 'mpnlmjpeup-nic0', 'sflfbcmxis-nic0', 'trtafbseei-nic0']
> asys.list_free_discs()
['gqfzadzwnl-osdisk', 'hoogczhxgw-osdisk', 'hqwklatgvu-osdisk', 'jbwdicmdrm-osdisk', 'mpnlmjpeup-osdisk', 'sflfbcmxis-osdisk', 'trtafbseei-osdisk']
> asys.list_free_pip()
['gqfzadzwnl-pip0', 'hoogczhxgw-pip0', 'hqwklatgvu-pip0', 'jbwdicmdrm-pip0', 'mpnlmjpeup-pip0', 'sflfbcmxis-pip0', 'trtafbseei-pip0']
> asys.cleanup_resources()
True
> asys.list_free_nics()
[]
> asys.list_free_discs()
[]
> asys.list_free_nics()
[]

@jyejare jyejare force-pushed the azure_cleanup branch 2 times, most recently from 950554d to 0dcabc9 Compare April 14, 2021 09:08
@jyejare
Copy link
Contributor Author

jyejare commented Apr 14, 2021

@mshriver Addressed your comments we discussed in GChat !

Copy link
Collaborator

@mshriver mshriver left a comment

Choose a reason for hiding this comment

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

Couple more changes, looking solid now though.

@jyejare
Copy link
Contributor Author

jyejare commented Apr 16, 2021

@mshriver All latest comments are addressed!

@mshriver mshriver merged commit c8524ff into RedHatQE:master Apr 23, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Azure Cleanup] Add methods to list all free/unused resources to delete them
2 participants