ClusterLabs / ClusterLabs/crmsh

enhancement: configuration search

Open
#698 3 comments 0 reactions 0 assignees View on GitHub
enhancement
Dominant language
Python
Stars
143
Forks
96
Avg merge
2d 6h
Merged PRs (30d)
16

Description

In crm shell `configure` context you can

- `edit` items specifying their name or a pattern that occurs in the resource name
- `show` items specifying their name or a pattern that occurs in the resource name

Given a highly consistent naming pattern for resources that would be fine to easily select *related* resources that way.
However the real world is not perfect and sometimes one wants to select resources containing some (more or less) magic string.

Therefore I suggest an enhancement that will allow matching not only based on the resource name, but also on the resource content. While I don't want to propose a specific syntax really, I'm sketching how it *could* be done:

"`crm(...) configure# grep `*pattern*" could list the names of all resources where either the name matches pattern, or where the text representation matches pattern (a possible extension might be "`grep xml` *pattern*" where the XML would be considered instead).

To combine such search result with commands easily, a set of additional commands can be imagined:

- "`show` [`all`] `matching` *pattern*": Display all resources matching (as described above) pattern. The `xml` extension would be possible, too (match XML and display XML)
- "`edit` [`all`] `matching` *pattern*": Edit all resources (in a single editor) matching pattern (as described above). The `xml` extension would be possible, too (match XML and display XML)
- "`delete` [`all`] `matching` *pattern*": Deleting all resources matching pattern (as described above) is probably a bad idea (thinking of `order` and `colocation` (among others))
- `filter` [`all`] `matching` *pattern*": ...restrict resources fed into `filter`...
- ... (possibly more)

(`all` is just some syntactic fill-word ("sugar") with no change in semantics, meaning it *does not* "match everything")

Contributor guide

Open the contributing guide

Research direction

Start with the crm shell `configure` context and read the existing `edit` and `show` selection behavior. The issue proposes several commands and alternative matching representations, so first establish the command syntax and matching semantics. Done requires an agreed, tested design for content-based resource search and its supported integrations.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
cli
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.