Uh oh!
There was an error while loading. Please reload this page.
[Quota] Add API to list preset variables - #8372
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@## main #8372 +/- ##
=============================================
- Coverage 31.08% 15.52% -15.57% + Complexity 33949 11970 -21979
=============================================
Files 5404 5459 +55 Lines 380282 487311 +107029 Branches 55505 62522 +7017 =============================================
- Hits 118222 75637 -42585 - Misses 246302 403459 +157157 + Partials 15758 8215 -7543
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
DaanHoogland
left a comment
There was a problem hiding this comment.
clgtm, and lots of test. Just a thought; an integration test seems appropriate for such a profoundly user facing feature, would you say @BryanMLima ?
Uh oh!
There was an error while loading. Please reload this page.
sureshanaparti
commented
Dec 25, 2023
@blueorangutan package |
blueorangutan
commented
Dec 25, 2023
@sureshanaparti a [SL] Jenkins job has been kicked to build packages. It will be bundled with KVM, XenServer and VMware SystemVM templates. I'll keep you posted as I make progress. |
blueorangutan
commented
Dec 25, 2023
Packaging result [SF]: ✔️ el7 ✔️ el8 ✔️ el9 ✔️ debian ✔️ suse15. SL-JID 8141 |
sureshanaparti
commented
Dec 25, 2023
@blueorangutan test |
blueorangutan
commented
Dec 25, 2023
@sureshanaparti a [SL] Trillian-Jenkins test job (centos7 mgmt + kvm-centos7) has been kicked to run smoke tests |
blueorangutan
commented
Dec 26, 2023
[SF] Trillian test result (tid-8680)
|
BryanMLima
commented
Jan 23, 2024
@DaanHoogland, got back after the holidays, and looking back, I don't think it needs integration tests. Mainly because there is no interaction with other APIs. The |
BryanMLima
commented
Jan 23, 2024
@blueorangutan package |
blueorangutan
commented
Jan 23, 2024
@BryanMLima a [SL] Jenkins job has been kicked to build packages. It will be bundled with KVM, XenServer and VMware SystemVM templates. I'll keep you posted as I make progress. |
blueorangutan
commented
Jan 23, 2024
Packaging result [SF]: ✔️ el7 ✔️ el8 ✔️ el9 ✔️ debian ✔️ suse15. SL-JID 8423 |
This pull request has merge conflicts. Dear author, please fix the conflicts and sync your branch with the base branch. |
…eset-variables-list-api
BryanMLima
commented
Feb 8, 2024
@blueorangutan package |
blueorangutan
commented
Feb 8, 2024
@BryanMLima a [SL] Jenkins job has been kicked to build packages. It will be bundled with KVM, XenServer and VMware SystemVM templates. I'll keep you posted as I make progress. |
blueorangutan
commented
Feb 8, 2024
Packaging result [SF]: ✔️ el7 ✔️ el8 ✔️ el9 ✔️ debian ✔️ suse15. SL-JID 8590 |
DaanHoogland
commented
Feb 9, 2024
@blueorangutan test |
blueorangutan
commented
Feb 9, 2024
@DaanHoogland a [SL] Trillian-Jenkins test job (centos7 mgmt + kvm-centos7) has been kicked to run smoke tests |
blueorangutan
commented
Feb 10, 2024
[SF] Trillian test result (tid-9148)
|
BryanMLima
commented
Apr 19, 2024
@blueorangutan package |
blueorangutan
commented
Apr 19, 2024
@BryanMLima a [SL] Jenkins job has been kicked to build packages. It will be bundled with KVM, XenServer and VMware SystemVM templates. I'll keep you posted as I make progress. |
blueorangutan
commented
Apr 19, 2024
Packaging result [SF]: ✔️ el7 ✔️ el8 ✔️ el9 ✔️ debian ✔️ suse15. SL-JID 9338 |
bernardodemarco
left a comment
There was a problem hiding this comment.
LGTM, I manually tested this one.
Preset variables for quota usage type 14
> quotaPresetVariablesList usagetype=14
{
"count": 20,
"variables": [
{
"description": "Account owner of the resource.",
"variable": "account"
},
{
"description": "Role of the account. This field will not exist if the account is a project.",
"variable": "account.role"
},
{
"description": "Role type of the resource's owner.",
"variable": "account.role.type"
},
{
"description": "ID of the resource.",
"variable": "account.role.id"
},
{
"description": "Name of the resource.",
"variable": "account.role.name"
},
{
"description": "ID of the resource.",
"variable": "account.id"
},
{
"description": "Name of the resource.",
"variable": "account.name"
},
{
"description": "Domain owner of the resource.",
"variable": "domain"
},
{
"description": "Path of the domain owner of the resource.",
"variable": "domain.path"
},
{
"description": "ID of the resource.",
"variable": "domain.id"
},
{
"description": "Name of the resource.",
"variable": "domain.name"
},
{
"description": "Project owner of the resource. This field will not exist if the resource belongs to an account.",
"variable": "project"
},
{
"description": "ID of the resource.",
"variable": "project.id"
},
{
"description": "Name of the resource.",
"variable": "project.name"
},
{
"description": "Type of the record used. Examples for this are: VirtualMachine, DomainRouter, SourceNat, KVM.",
"variable": "resourceType"
},
{
"description": "Data related to the resource being processed.",
"variable": "value"
},
{
"description": "A list of resources of the account between the start and end date of the usage record being calculated (i.e.: [{zoneId: ..., domainId:...}]).",
"variable": "value.accountResources"
},
{
"description": "Zone where the resource is.",
"variable": "zone"
},
{
"description": "ID of the resource.",
"variable": "zone.id"
},
{
"description": "Name of the resource.",
"variable": "zone.name"
}
]
}Preset variables for quota usage type 10
> quotaPresetVariablesList usagetype=10
{
"count": 20,
"variables": [
{
"description": "Account owner of the resource.",
"variable": "account"
},
{
"description": "Role of the account. This field will not exist if the account is a project.",
"variable": "account.role"
},
{
"description": "Role type of the resource's owner.",
"variable": "account.role.type"
},
{
"description": "ID of the resource.",
"variable": "account.role.id"
},
{
"description": "Name of the resource.",
"variable": "account.role.name"
},
{
"description": "ID of the resource.",
"variable": "account.id"
},
{
"description": "Name of the resource.",
"variable": "account.name"
},
{
"description": "Domain owner of the resource.",
"variable": "domain"
},
{
"description": "Path of the domain owner of the resource.",
"variable": "domain.path"
},
{
"description": "ID of the resource.",
"variable": "domain.id"
},
{
"description": "Name of the resource.",
"variable": "domain.name"
},
{
"description": "Project owner of the resource. This field will not exist if the resource belongs to an account.",
"variable": "project"
},
{
"description": "ID of the resource.",
"variable": "project.id"
},
{
"description": "Name of the resource.",
"variable": "project.name"
},
{
"description": "Type of the record used. Examples for this are: VirtualMachine, DomainRouter, SourceNat, KVM.",
"variable": "resourceType"
},
{
"description": "Data related to the resource being processed.",
"variable": "value"
},
{
"description": "A list of resources of the account between the start and end date of the usage record being calculated (i.e.: [{zoneId: ..., domainId:...}]).",
"variable": "value.accountResources"
},
{
"description": "Zone where the resource is.",
"variable": "zone"
},
{
"description": "ID of the resource.",
"variable": "zone.id"
},
{
"description": "Name of the resource.",
"variable": "zone.name"
}
]
}Preset variables for quota usage type 6
> quotaPresetVariablesList usagetype=6
{
"count": 35,
"variables": [
{
"description": "Account owner of the resource.",
"variable": "account"
},
{
"description": "Role of the account. This field will not exist if the account is a project.",
"variable": "account.role"
},
{
"description": "Role type of the resource's owner.",
"variable": "account.role.type"
},
{
"description": "ID of the resource.",
"variable": "account.role.id"
},
{
"description": "Name of the resource.",
"variable": "account.role.name"
},
{
"description": "ID of the resource.",
"variable": "account.id"
},
{
"description": "Name of the resource.",
"variable": "account.name"
},
{
"description": "Domain owner of the resource.",
"variable": "domain"
},
{
"description": "Path of the domain owner of the resource.",
"variable": "domain.path"
},
{
"description": "ID of the resource.",
"variable": "domain.id"
},
{
"description": "Name of the resource.",
"variable": "domain.name"
},
{
"description": "Project owner of the resource. This field will not exist if the resource belongs to an account.",
"variable": "project"
},
{
"description": "ID of the resource.",
"variable": "project.id"
},
{
"description": "Name of the resource.",
"variable": "project.name"
},
{
"description": "Type of the record used. Examples for this are: VirtualMachine, DomainRouter, SourceNat, KVM.",
"variable": "resourceType"
},
{
"description": "Data related to the resource being processed.",
"variable": "value"
},
{
"description": "ID of the resource.",
"variable": "value.id"
},
{
"description": "Name of the resource.",
"variable": "value.name"
},
{
"description": "A list of resources of the account between the start and end date of the usage record being calculated (i.e.: [{zoneId: ..., domainId:...}]).",
"variable": "value.accountResources"
},
{
"description": "List of tags of the resource in the format key:value (i.e.: {\"a\":\"b\", \"c\":\"d\"}).",
"variable": "value.tags"
},
{
"description": "Size of the resource (in MiB).",
"variable": "value.size"
},
{
"description": "Provisioning type of the resource. Values can be: thin, sparse or fat.",
"variable": "value.provisioningType"
},
{
"description": "Disk offering of the volume.",
"variable": "value.diskOffering"
},
{
"description": "ID of the resource.",
"variable": "value.diskOffering.id"
},
{
"description": "Name of the resource.",
"variable": "value.diskOffering.name"
},
{
"description": "Storage where the volume or snapshot is. While handling with snapshots, this value can be from the primary storage if the globalsetting 'snapshot.backup.to.secondary' is false, otherwise it will be from secondary storage.",
"variable": "value.storage"
},
{
"description": "List of string representing the tags of the storage where the volume is (i.e.: [\"a\", \"b\"]).",
"variable": "value.storage.tags"
},
{
"description": "Whether the tag is a rule interpreted in JavaScript. Applicable only for primary storages.",
"variable": "value.storage.isTagARule"
},
{
"description": "Scope of the storage where the volume is. Values can be: ZONE, CLUSTER or HOST. Applicable only for primary storages.",
"variable": "value.storage.scope"
},
{
"description": "ID of the resource.",
"variable": "value.storage.id"
},
{
"description": "Name of the resource.",
"variable": "value.storage.name"
},
{
"description": "The volume format. Values can be: RAW, VHD, VHDX, OVA and QCOW2.",
"variable": "value.volumeFormat"
},
{
"description": "Zone where the resource is.",
"variable": "zone"
},
{
"description": "ID of the resource.",
"variable": "zone.id"
},
{
"description": "Name of the resource.",
"variable": "zone.name"
}
]
}Uh oh!
There was an error while loading. Please reload this page.
DaanHoogland
commented
May 28, 2024
@BryanMLima will you apply @bernardodemarco 's sugestion #8372 (comment) , or can we merge as is? Also, @BryanMLima this is marked for 4.19.1 but based on main. What to do? |
Co-authored-by: Bernardo De Marco Gonçalves <bernardomg2004@gmail.com>
@bernardodemarco, thanks for testing it.
I changed the milestone to 4.20, we can merge this after the checks have passed, just to be sure. |
BryanMLima
commented
May 29, 2024
@blueorangutan package |
blueorangutan
commented
May 29, 2024
@BryanMLima a [SL] Jenkins job has been kicked to build packages. It will be bundled with KVM, XenServer and VMware SystemVM templates. I'll keep you posted as I make progress. |
blueorangutan
commented
May 29, 2024
Packaging result [SF]: ✔️ el7 ✔️ el8 ✔️ el9 ✔️ debian ✔️ suse15. SL-JID 9733 |
BryanMLima
commented
Jun 12, 2024
@blueorangutan package |
blueorangutan
commented
Jun 12, 2024
@BryanMLima a [SL] Jenkins job has been kicked to build packages. It will be bundled with KVM, XenServer and VMware SystemVM templates. I'll keep you posted as I make progress. |
blueorangutan
commented
Jun 12, 2024
Packaging result [SF]: ✔️ el7 ✔️ el8 ✔️ el9 ✔️ debian ✔️ suse15. SL-JID 9906 |
BryanMLima
commented
Jun 13, 2024
Merging this one based on reviews and manual tests. |
yadvr
commented
Jun 14, 2024
@BryanMLima shouldn't we need to run smoketests on the PR, or do we think they were covered by GHA/simulator smoketests? |
BryanMLima
commented
Jun 14, 2024
@rohityadavcloud, the smoke tests were already run in #8372 (comment), and the only test error was not related to the changes in this PR (further commits did not add any major changes). Furthermore, this patch only introduces new features to the Quota plugin, it does not change any behaviour that would break the smoke tests. |
* Add API for listing Quota preset variables * Add new line at EOF * Address review * Remove usage types * Remove usage types from quotatypes * Remove unused imports * Add space for preset variable definition description Co-authored-by: Bernardo De Marco Gonçalves <bernardomg2004@gmail.com> --------- Co-authored-by: Bernardo De Marco Gonçalves <bernardomg2004@gmail.com>
Description
This PR extends the functionality introduced in PR #5909, allowing users to list the preset variables via API, facilitating the creation of the activation rules while creating tariffs for the Quota plugin.
Types of changes
Feature/Enhancement Scale or Bug Severity
Feature/Enhancement Scale
How Has This Been Tested?
I tested this PR verifying the preset variables for the Quota usage types. Below, are the output for the quota usage type
RUNNING_VMSwith enum 1.API output