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

CloudNetwork, NetworkPort and SecurityGroup belong to a ResourceGroup #19343

Merged

Conversation

mancabizjak
Copy link
Contributor

@mancabizjak mancabizjak commented Sep 30, 2019

In this commit we model a belongs_to relationship to a ResourceGroup for CloudNetwork, NetworkPort and SecurityGroup. A ResourceGroup now has a has_many relationship to these network entities. This mirrors the existing relationship between the ResourceGroup
and Vms.

Rationale

This change is relevant in the context of Azure and AzureStack providers.

It will allow us to intuitively infer related DB targets in the scope of targeted refresh for resource groups (an ongoing effort). Currently we can only do resource_group.vms, but to retrieve networks, network ports and security groups witin a specific resource group, we would have to use .where(ems_ref LIKE <resource_group.name>), since resource group name is a part of every AzureStack resource's ems_ref.

WIP

Links

@miq-bot add_label enhancement
@miq-bot assign @agrare

@lpichler
Copy link
Contributor

lpichler commented Sep 30, 2019

@mancabizjak do you need this PR to be merged first ? if so then mark this PR in title [WIP] CloudNetwork, Network...
and state (in description)that this PR require other PR. I am doing it with checkboxes ( but it is up to you):

WIP :

  • link1

EDIT: anyway thanks for the PRs :)

@mancabizjak mancabizjak changed the title CloudNetwork, NetworkPort and SecurityGroup belong to a ResourceGroup [WIP] CloudNetwork, NetworkPort and SecurityGroup belong to a ResourceGroup Sep 30, 2019
@miq-bot miq-bot added the wip label Sep 30, 2019
@mancabizjak
Copy link
Contributor Author

@lpichler that's right. Done and thanks for the heads up, appreciated!

@agrare agrare changed the title [WIP] CloudNetwork, NetworkPort and SecurityGroup belong to a ResourceGroup CloudNetwork, NetworkPort and SecurityGroup belong to a ResourceGroup Sep 30, 2019
@agrare agrare closed this Sep 30, 2019
@agrare agrare reopened this Sep 30, 2019
@miq-bot miq-bot removed the wip label Sep 30, 2019
With this commit we model a `belongs_to` relationship to a
ResourceGroup for CloudNetwork, NetworkPort and SecurityGroup models.
A ResourceGroup now has a `has_many` relationship to these network
entities. This mirrors the existing relationship between ResourceGroup
and VMs. When a resource group is deleted, references to the associated
resources are nullified.

Signed-off-by: Manca Bizjak <manca.bizjak@xlab.si>
@mancabizjak mancabizjak force-pushed the additional-resource-group-relationships branch from 03c9bd3 to e9e72f7 Compare October 1, 2019 14:00
@miq-bot
Copy link
Member

miq-bot commented Oct 1, 2019

Checked commit xlab-si@e9e72f7 with ruby 2.4.6, rubocop 0.69.0, haml-lint 0.20.0, and yamllint 1.10.0
5 files checked, 0 offenses detected
Everything looks fine. 🏆

@agrare agrare merged commit 1d73637 into ManageIQ:master Oct 1, 2019
@agrare agrare added this to the Sprint 122 Ending Oct 14, 2019 milestone Oct 1, 2019
@agrare
Copy link
Member

agrare commented Oct 1, 2019

Thanks @mancabizjak !

@mancabizjak mancabizjak deleted the additional-resource-group-relationships branch October 2, 2019 06:46
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.

5 participants