influxdata / influxdata/influxdb

List Label Resource Mappings by Label Names and or Label IDs via label service

Open
#19,224 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Rust
Stars
31.7k
Forks
3.7k
Avg merge
13h 37m
Merged PRs (30d)
8

Description

Proposal:
The ability to list resources associated to a label via the label names or label ids.

type LabelService interface {
    ... existing
    AssociatedResources(ctx context.Context, filter LabelAssociationFilter) ([]LabelResourceMapping, error)
}

type LabelAssociationFilter struct {
    ResourceType ResourceType // optional

    OrgID ID    

    // at least 1 entry for 1 of the following
    IDs []ID
    Names []string
}

Current behavior:
Forces the API consumer to make multiple hops here to find this.

Desired behavior:
Remove the work arounds, multiple http calls and make the label service encapsulate this behavior.

Alternatives considered:
The existing painful experience

Use case:
This is super helpful for finding resources by a label. Say the CLi wants to limit resources in teh list calls by a label. Or the UI wants to find all resources for a given label. These are useful for finding meaningful context for resources.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start at the LabelService interface and trace the current multiple-hop lookup described in the issue. Define the service behavior around AssociatedResources and LabelAssociationFilter, including IDs, names, organization, and optional resource type. Done means consumers can find associated resources through the label service without multiple HTTP calls.

Written by the indexing model from the issue text.

Assessment

Tech stack
go
Domain
api, backend
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.