-
Notifications
You must be signed in to change notification settings - Fork 1.3k
network: allow ability to specify if network's ipaddress usage need to be hidden #3235
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
network: allow ability to specify if network's ipaddress usage need to be hidden #3235
Conversation
|
@blueorangutan package |
|
@borisstoyanov a Jenkins job has been kicked to build packages. I'll keep you posted as I make progress. |
|
Packaging result: ✔centos6 ✔centos7 ✔debian. JID-2649 |
…dden Signed-off-by: Rohit Yadav <[email protected]>
Signed-off-by: Rohit Yadav <[email protected]>
1814828 to
ea8343b
Compare
|
@blueorangutan package |
|
@rhtyd a Jenkins job has been kicked to build packages. I'll keep you posted as I make progress. |
|
Packaging result: ✔centos6 ✔centos7 ✔debian. JID-2664 |
borisstoyanov
left a comment
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.
LGTM, IP usage record is now displayed or not depending on the flag of the network
@blueorangutan test
|
@blueorangutan test |
|
@borisstoyanov a Trillian-Jenkins test job (centos7 mgmt + kvm-centos7) has been kicked to run smoke tests |
|
Trillian test result (tid-3460)
|
…t in the api response Signed-off-by: Rohit Yadav <[email protected]>
|
@blueorangutan package |
|
@borisstoyanov a Jenkins job has been kicked to build packages. I'll keep you posted as I make progress. |
|
Packaging result: ✔centos6 ✔centos7 ✔debian. JID-2824 |
|
@blueorangutan test |
|
@borisstoyanov a Trillian-Jenkins test job (centos7 mgmt + kvm-centos7) has been kicked to run smoke tests |
|
Trillian test result (tid-3628)
|
PaulAngus
left a comment
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.
LGTM manually tested, when hideipaddressusage = true ip usage for the designated network is not shown (list networkusage usagetype=3 )
With this commit, listUsageRecords filters out usages made on IP addresses on networks with "Hide IP Address Usage". This was previously introduced in apache#3235. This requires a DB schema change, to introduce a flag is_hidden in table cloud_usage.cloud_usage.
With this commit, listUsageRecords filters out usages made on IP addresses on networks with "Hide IP Address Usage". This was previously introduced in apache#3235. This requires a DB schema change, to introduce a flag is_hidden in table cloud_usage.cloud_usage.
With this commit, listUsageRecords filters out usages made on IP addresses on networks with "Hide IP Address Usage". This was previously introduced in apache#3235. This requires a DB schema change, to introduce a flag is_hidden in table cloud_usage.cloud_usage.
With this commit, listUsageRecords filters out usages made on IP addresses on networks with "Hide IP Address Usage". This was previously introduced in apache#3235. This requires a DB schema change, to introduce a flag is_hidden in table cloud_usage.cloud_usage.
Problem: Admins don’t want to charge for IP address usage on certain (shared) networks.
Root Cause: There is no flag or detail for admins to provide using UI or API when creating networks to specify if they want IP address usage of the network hidden.
Solution: A new boolean hideipaddressusage flag is added to the createNetwork API and a checkbox in the ‘Add guest network’ UI for the root admins to specify if they want the shared network’s IP address usage to be hidden in the listUsageRecords API response. The provided flag is saved as the ‘hideIpAddressUsage’ detail in the cloud.network_details table for the network. For existing (shared) networks, root admins can also specify the same boolean API parameter hideipaddressusage with the updateNetwork API request to configure the behaviour for an existing network. When the detail/flag is true, the IP address usage for the (shared) network is not exported in the listUsageRecords API response. The listNetworks API response will include the details of a network for root admin only. (note usage is still recorded in the usage database but not return by the listUsageRecords API)
The API flag works for any kind of network via the API, but the checkbox is only shown while creating shared networks in the UI.
Types of changes
This adds a new API arg only accessible to admins to specify if they
want the network's ip address usage hidden. This then saves this setting
in the network_details table for a network, and the listUsageRecords
API response creator checks for an IP address if it needs to be exported
or skipped/hidden.
The setting is available only to root admin via the listNetworks API response (details key).
Root admin can also update existing networks by using updateNetwork API and passing
hideipaddressusage=true|falseUI screenshot, that adds this checkbox only for admins creating a shared network:

**note: it's possible for all other kinds of networks to have their ip address usages skipped as well, available via the API.