Add `policy` resources

Open
#114 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

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

Research direction

Start by reviewing the existing namespace resource commands and their policy getters and setters. Compare those operations with the proposed pulsarctl policies [policy-property] [action] [options] [resource-entity] syntax, including namespace and topic entities. Done means policy operations are organized under the new resource without duplicated namespace and topic handling.

Written by the indexing model from the issue text.

Description

triage/week-50 workflow::backlog

Motivation

Currently we have some many commands under namespace resource. It introduces a few inconveniences.

  • We have too many getters and setters. It is really hard to people to find the right command, especially these policy operations are coupled with CRUD operations on namespaces.
  • Each time we introduce a name field in the policy. We have to add new getter and setter in the command.
  • We are introduce a topic-level policy in Pulsar. It means that we might need to add the operations under topic resource as well. It results in duplicated code.

Proposal

I am proposing introducing a policy resource for handling operations to policies at both namespace or topic level.

The proposed command syntax is described as followings:

pulsarctl policies [policy-property] [action] [options] [resource-entity]
  • policy-property is the property within the policy, such as backlog-quotas, subscribe-rate.
  • action is the operation can be applied on the policy-property, e.g. get and set.
  • options are the options for the action.
  • resource-entity can be a namespace or a topic (if we support topic-level policy)

The examples of the commands using this syntax are listed as follows:

  • get backlog quotas from a namespace
pulsarctl policies backlog-quota get tenant/ns
  • get backlog quotas from a topic
pulsarctl policies backlog-quota get tenant/ns/topic
Dominant language
Go
Stars
169
Forks
68
Avg merge
5m
Merged PRs (30d)
1

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.

More from streamnative/pulsarctl

All issues in streamnative/pulsarctl

Similar issues

More Go issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.