boundary icon indicating copy to clipboard operation
boundary copied to clipboard

feat(cli): add/set/remove worker tags

Open A-440Hz opened this issue 2 years ago • 3 comments

example commands:

adding key with multiple values, adding multiple keys:

bin/boundary workers add-worker-tags -id w_1234567890 -tag key=val1,val2 -tag key2=val

Worker information: Active Connection Count: 0 Address: 127.0.0.1:9202 Created Time: Mon, 25 Jul 2022 10:03:39 PDT ID: w_1234567890 Last Status Time: 2022-07-25 19:41:09.485499 +0000 UTC Type: pki Updated Time: Mon, 25 Jul 2022 12:41:09 PDT Version: 2

Scope: ID: global Name: global Type: global

Tags: Configuration: type: ["dev" "local"] Api: key: ["val1" "val2"] key2: ["val"] Canonical: key: ["val1" "val2"] key2: ["val"] type: ["dev" "local"]

removing a single tag:

bin/boundary workers remove-worker-tags -id w_1234567890 -tag key=val1

Tags: Configuration: type: ["dev" "local"] Api: key: ["val2"] key2: ["val"] Canonical: key: ["val2"] key2: ["val"] type: ["dev" "local"]

setting all tags to nil:

bin/boundary workers set-worker-tags -id w_1234567890 -tag null

Tags: Configuration: type: ["dev" "local"] Canonical: type: ["dev" "local"]

A-440Hz avatar Jul 19 '22 01:07 A-440Hz

just the string parsing/initial flag stuff for now

A-440Hz avatar Jul 19 '22 01:07 A-440Hz

Can you add the new commands to internal/cmd/commands.go?

And the following in internal/cmd/gencli/input.go VersionedActions: []string{"update", "add-worker-tags", "set-worker-tags", "remove-worker-tags"},

irenarindos avatar Jul 19 '22 15:07 irenarindos

Looks like we're going to hold off on merging this until @jefferai is back and can take a look

irenarindos avatar Jul 25 '22 20:07 irenarindos