History | View | Annotate | Download (57.9 kB)
Add instance query field for OS parameters
These were not available as a query field before. Update unittestsand description text for the other “..params” fields.
Signed-off-by: Michael Hanselmann <hansmi@google.com>Reviewed-by: Iustin Pop <iustin@google.com>
qlang: Remove OP_GLOB operator
It'll be implemented using OP_REGEXP by the parser.
Signed-off-by: Michael Hanselmann <hansmi@google.com>Reviewed-by: René Nussbaumer <rn@google.com>
query: Add implementation of regex match operator
So far this operator was not implemented. This patch adds an additionalvalue preparation function to the function table for binary operators,used to compile the regular expression. Unittests are included....
Convert OsDiagnose to query
query: Add conversion wrapper
Allows converting the value of a column before returning it. Useful forsorting while still using one of the other generic functions forretrieving the value.
query: Add operator for truth
The “?” operator is the equivalent of “if var” in Python.
query: Fix bug when names are specified
If the client/caller would specify names through the use of a filter,the result would be sorted. This is a regression over earlier Ganetiversions and verified in QA. This patch adds an optional parameter tocontrol the sorting and provides unittests....
query: Add support for filters
This patch adds a “compiler” for query filters, converting them to acallable function used while preparing the query result. In addition, ahints call allows some analysis to be done on the query (e.g. referencednames), making data collection more efficient....
Add query field flags
Some fields (e.g. “name”) should be treated specially when comparing forequality. Hypervisor names should use normal rules, but for node names,“node2” should be equivalent with “node2.example.com”.
To make these differences, a new field for flags is added to the query...
Add script to generate query fields documentation
- All lines matching "QUERY_FIELDS_${resource}" in the input will be replaced with a definition list describing the fields for $resource- The core code is kept in the Sphinx extension, so that it could be...
QUERY_FIELDS_${resource}
Add query field descriptions
- Make “doc” parameter to MakeField non-optional- Add descriptions for all fields
query: Add support for field description
Add constants for node roles
Add constants for instance status
They've been hardcoded for too long.
Signed-off-by: Michael Hanselmann <hansmi@google.com>Reviewed-by: Iustin Pop <iustin@google.com>Reviewed-by: René Nussbaumer <rn@google.com>
query: Use aliases for legacy instance NIC fields
Fix title of query field containing instance name
NodeQuery: mark live fields as UNAVAIL for non-vm_capable nodes
Since we don't have the data per design, UNAVAIL is appropriate here,while NODATA is not.
The patch also adds a comment: if we extend the live fields list tocontain other data in the future, we need to reevaluate this solution....
Export console information as query field
This makes it possible to get the console information via a LUXI query.
Fix instance list for instances running multiple times
If for some reason (e.g. failed migration) one instance is runningon multiple nodes the output can become inconsistent. To get that errorand make it consistent between runs we make the call on the secondary...
Merge branch 'devel-2.4'
Rename QRFS_* to RS_*
This patch renames QRFS_* to RS_* fields so they can be used in otherplaces (i.e. LUs) without confusion, as this was initially meant forquery operations.
Signed-off-by: René Nussbaumer <rn@google.com>Reviewed-by: Iustin Pop <iustin@google.com>
query: Add alias support in _PrepareFieldList
Signed-off-by: Iustin Pop <iustin@google.com>Reviewed-by: René Nussbaumer <rn@google.com>
Instance query: replace duplicates with aliases
query: use the actual types for BE/HV parameters
This patch exposes the VTYPE kind of BE/HV parameters, instead ofreturning QFT_OTHER. The current situation makes a query like:
gnt-instance list -o name,be/memory,oper_ram
very strange looking.
Signed-off-by: Iustin Pop <iustin@google.com>...
query: return UNAVAIL for "wrong" HV parameters
If a HV parameter is required that does not apply for an instance,currently the code returns None. This is bad, as it means we cannotswitch to the actual HV parameter types and validate correctly thisfield....
query: change (debug-mode) field validation errors
Currently, the single assert just checks that the entire row isconsistent (true/false), and dumps the row and field definitions as anaccompanying message. This makes it very hard to understand what failed....
Rename a few instance field titles
The conversion to querylib introduced unique field titles, which howeverdid an inconsistent rename of the instance vcpus/memory fields.
This patch makes both BE_MEMORY and VCPUS be named with prefix “Config”(which before was “Configured”), and drops the “Runtime” (note no...
query: Change internal result computation
While looking at the query library, I realized that while we have fivefield statuses, making this a 5-dimensional space, four of them areshrunk to a single possible value (None). Hence it should be possible toconvert this into a single value space plus extra 4 special constants....
Import QRFS_* and QFT_* in query.py
Currently, the QRFT/QFT constants are used with the module (e.g.constants.QRFS_NORMAL) in the query library. Given that there are 176uses of these constants in a module that has roughly ~1200 lines intotal (including whitespace), it makes sense to import these directly to...
query: Update docstrings
List node parameters in gnt-group list
Signed-off-by: René Nussbaumer <rn@google.com>Reviewed-by: Iustin Pop <iustin@google.com>Reviewed-by: Adeodato Simo <dato@google.com>
List node parameters (if any) in gnt-node info
Signed-off-by: René Nussbaumer <rn@google.com>Reviewed-by: Iustin Pop <iustin@google.com>Reviewed-by: Michael Hanselmann <hansmi@google.com>
Support query of node field 'powered'
This field is based on OOB support and is only available if there's oobsupport for that node.
Signed-off-by: René Nussbaumer <rn@google.com>Reviewed-by: Michael Hanselmann <hansmi@google.com>
query.py: add definitions for node group queries
Signed-off-by: Adeodato Simo <dato@google.com>Reviewed-by: Michael Hanselmann <hansmi@google.com>
ganeti.query_unittest.py: test lock fields too
Additionally, change TestQueryFields.testSomeFields() to handle lists offields shorter than 20 elements.
Convert “gnt-debug locks” to query2
Locks can now be queried using “Query(what="lock", …)” over LUXI.
query2: Add new field status “offline”
This allows “gnt-node list” to show the difference between modes markedoffline and nodes with e.g. RPC errors (“(nodata)”). node1 is themaster, node2's node daemon crashed and node3 is marked offline:
$ gnt-node list -o name,offline,dtotal,dfree...
query: Add wrapper for creating response object
It'll be used for querying locks.
Move QueryFields to query module
Also replace “sorted” with “utils.NiceSort” now that it supports a keyfunction.
query: Handle items missing timestamps
In upgraded configurations, some items might miss the “ctime” and/or“mtime” values and need to be handled specially.
query: Add definition for instance queries
query: Improve error checking
- Show only field definition, not callback when a result row is inconsistent- Show list of duplicate titles if there are any (module load time)
Signed-off-by: Michael Hanselmann <hansmi@google.com>Reviewed-by: Adeodato Simo <dato@google.com>
Add node query definition
This includes a bunch of helper functions which can be helpful for otherqueries, too. Unittests are included.
Add utility class for definition-based data queries
While not immediately visible, using definition-based queries will allowfor a number of optimizations and simplifications. This patch justcontains the utility class used for executing queries.
Signed-off-by: Michael Hanselmann <hansmi@google.com>...