Skip to content

Commit

Permalink
fix: adding support for providing list of values to all --id paramete…
Browse files Browse the repository at this point in the history
…rs, i.e. `c8y inventory get --id 1111,2222` or `c8y alarms get --id 1111,2222`
  • Loading branch information
reubenmiller committed May 16, 2021
1 parent cde8e4a commit 46fc97f
Show file tree
Hide file tree
Showing 78 changed files with 437 additions and 190 deletions.
16 changes: 5 additions & 11 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,20 +65,14 @@ None :)
* set-session causes bad console wrapping when console is not wide enough
* reduce message when width is not ok, or look at doing manual wrapping for

* duplicate output when using c8y agents get --id name1,name2

```sh
c8y agents create --name agent01
c8y agents create --name agent02
c8y agents get --id agent01,agent02 --select name -o csv
```

Will return two output entries
* Piping empty results has unexpected consequences

```sh
agent01
agent01
```
c8y agents list | c8y alarms list --dry | c8y auditrecords list --dry
echo "{}" | c8y auditrecords list --dry
```
~~not known~~
### Commands
Expand Down
4 changes: 2 additions & 2 deletions api/spec/json/alarms.json
Original file line number Diff line number Diff line change
Expand Up @@ -367,7 +367,7 @@
"pathParameters": [
{
"name": "id",
"type": "string",
"type": "[]id",
"pipeline": true,
"required": true,
"description": "Alarm id"
Expand Down Expand Up @@ -471,7 +471,7 @@
"pathParameters": [
{
"name": "id",
"type": "string",
"type": "[]id",
"pipeline": true,
"description": "Alarm id",
"required": true
Expand Down
2 changes: 1 addition & 1 deletion api/spec/json/auditRecords.json
Original file line number Diff line number Diff line change
Expand Up @@ -241,7 +241,7 @@
"pathParameters": [
{
"name": "id",
"type": "string",
"type": "[]id",
"required": true,
"pipeline": true,
"description": "Audit id"
Expand Down
6 changes: 3 additions & 3 deletions api/spec/json/binaries.json
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@
"pathParameters": [
{
"name": "id",
"type": "string",
"type": "[]id",
"required": true,
"pipeline": true,
"description": "Inventory binary id"
Expand Down Expand Up @@ -211,7 +211,7 @@
"pathParameters": [
{
"name": "id",
"type": "string",
"type": "[]id",
"required": true,
"pipeline": true,
"description": "Inventory binary id"
Expand Down Expand Up @@ -260,7 +260,7 @@
"pathParameters": [
{
"name": "id",
"type": "string",
"type": "[]id",
"required": true,
"pipeline": true,
"description": "Inventory binary id"
Expand Down
8 changes: 4 additions & 4 deletions api/spec/json/bulkOperations.json
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@
"pathParameters": [
{
"name": "id",
"type": "string",
"type": "[]id",
"required": true,
"pipeline": true,
"description": "Bulk Operation id"
Expand Down Expand Up @@ -126,7 +126,7 @@
"pathParameters": [
{
"name": "id",
"type": "string",
"type": "[]id",
"required": true,
"pipeline": true,
"description": "Bulk Operation id"
Expand Down Expand Up @@ -273,7 +273,7 @@
"pathParameters": [
{
"name": "id",
"type": "string",
"type": "[]id",
"description": "Bulk Operation id",
"pipeline": true,
"required": true
Expand Down Expand Up @@ -329,7 +329,7 @@
"queryParameters": [
{
"name": "id",
"type": "string",
"type": "[]id",
"property": "bulkOperationId",
"pipeline": true,
"required": true,
Expand Down
4 changes: 2 additions & 2 deletions api/spec/json/databroker.json
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@
"pathParameters": [
{
"name": "id",
"type": "string",
"type": "[]id",
"required": true,
"pipeline": true,
"description": "Data broker connector id"
Expand Down Expand Up @@ -100,7 +100,7 @@
"pathParameters": [
{
"name": "id",
"type": "string",
"type": "[]id",
"required": true,
"pipeline": true,
"description": "Data broker connector id"
Expand Down
10 changes: 5 additions & 5 deletions api/spec/json/deviceCredentials.json
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@
"pathParameters": [
{
"name": "id",
"type": "devicerequest",
"type": "[]devicerequest",
"required": true,
"pipeline": true,
"description": "New Device Request ID"
Expand Down Expand Up @@ -113,7 +113,7 @@
"body": [
{
"name": "id",
"type": "string",
"type": "[]id",
"required": true,
"pipeline": true,
"description": "Device identifier. Max: 1000 characters. E.g. IMEI"
Expand Down Expand Up @@ -156,7 +156,7 @@
"pathParameters": [
{
"name": "id",
"type": "devicerequest",
"type": "[]devicerequest",
"required": true,
"pipeline": true,
"description": "Device identifier"
Expand Down Expand Up @@ -207,7 +207,7 @@
"pathParameters": [
{
"name": "id",
"type": "devicerequest",
"type": "[]devicerequest",
"required": true,
"pipeline": true,
"description": "New Device Request ID"
Expand Down Expand Up @@ -246,7 +246,7 @@
"body": [
{
"name": "id",
"type": "devicerequest",
"type": "[]devicerequest",
"required": true,
"pipeline": true,
"description": "Device identifier. Max: 1000 characters. E.g. IMEI"
Expand Down
4 changes: 2 additions & 2 deletions api/spec/json/devicecontrol.json
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@
"pathParameters": [
{
"name": "id",
"type": "string",
"type": "[]id",
"required": true,
"pipeline": true,
"description": "Operation id"
Expand Down Expand Up @@ -299,7 +299,7 @@
"pathParameters": [
{
"name": "id",
"type": "string",
"type": "[]id",
"description": "Operation id",
"pipeline": true,
"required": true
Expand Down
14 changes: 7 additions & 7 deletions api/spec/json/events.json
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,7 @@
"pathParameters": [
{
"name": "id",
"type": "string",
"type": "[]id",
"required": true,
"pipeline": true,
"description": "Event id"
Expand Down Expand Up @@ -351,7 +351,7 @@
"pathParameters": [
{
"name": "id",
"type": "string",
"type": "[]id",
"required": true,
"pipeline": true,
"description": "Event id"
Expand Down Expand Up @@ -399,7 +399,7 @@
"pathParameters": [
{
"name": "id",
"type": "string",
"type": "[]id",
"required": true,
"pipeline": true,
"description": "Event id"
Expand Down Expand Up @@ -445,7 +445,7 @@
"pathParameters": [
{
"name": "id",
"type": "string",
"type": "[]id",
"required": true,
"pipeline": true,
"description": "Event id"
Expand Down Expand Up @@ -489,7 +489,7 @@
"pathParameters": [
{
"name": "id",
"type": "string",
"type": "[]id",
"required": true,
"pipeline": true,
"description": "Event id"
Expand Down Expand Up @@ -541,7 +541,7 @@
"pathParameters": [
{
"name": "id",
"type": "string",
"type": "[]id",
"required": true,
"pipeline": true,
"description": "Event id"
Expand Down Expand Up @@ -600,7 +600,7 @@
"pathParameters": [
{
"name": "id",
"type": "string",
"type": "[]id",
"required": true,
"pipeline": true,
"description": "Event id"
Expand Down
6 changes: 3 additions & 3 deletions api/spec/json/inventory.json
Original file line number Diff line number Diff line change
Expand Up @@ -338,7 +338,7 @@
"pathParameters": [
{
"name": "id",
"type": "string",
"type": "[]id",
"pipeline": true,
"required": true,
"description": "ManagedObject id"
Expand Down Expand Up @@ -410,7 +410,7 @@
"pathParameters": [
{
"name": "id",
"type": "string",
"type": "[]id",
"pipeline": true,
"description": "ManagedObject id",
"required": true
Expand Down Expand Up @@ -478,7 +478,7 @@
"pathParameters": [
{
"name": "id",
"type": "string",
"type": "[]id",
"pipeline": true,
"required": true,
"description": "ManagedObject id"
Expand Down
6 changes: 3 additions & 3 deletions api/spec/json/inventoryAdditions.json
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@
"pathParameters": [
{
"name": "id",
"type": "string",
"type": "[]id",
"pipeline": true,
"pipelineAliases": [
"deviceId",
Expand Down Expand Up @@ -109,7 +109,7 @@
"pathParameters": [
{
"name": "id",
"type": "string",
"type": "[]id",
"property": "id",
"required": true,
"description": "Managed object id where the child addition will be added to",
Expand Down Expand Up @@ -165,7 +165,7 @@
"pathParameters": [
{
"name": "id",
"type": "string",
"type": "[]id",
"required": true,
"description": "Managed object id"
},
Expand Down
8 changes: 4 additions & 4 deletions api/spec/json/inventoryAssets.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
"pathParameters": [
{
"name": "id",
"type": "string",
"type": "[]id",
"required": true,
"pipeline": true,
"pipelineAliases": [
Expand Down Expand Up @@ -206,9 +206,9 @@
"pathParameters": [
{
"name": "id",
"type": "string",
"required": true,
"description": "Asset id"
"type": "[]id",
"description": "Asset id",
"required": true
},
{
"name": "child",
Expand Down
4 changes: 2 additions & 2 deletions api/spec/json/measurements.json
Original file line number Diff line number Diff line change
Expand Up @@ -318,7 +318,7 @@
"pathParameters": [
{
"name": "id",
"type": "string",
"type": "[]id",
"required": true,
"pipeline": true,
"description": "Measurement id"
Expand Down Expand Up @@ -418,7 +418,7 @@
"pathParameters": [
{
"name": "id",
"type": "string",
"type": "[]id",
"required": true,
"pipeline": true,
"description": "Measurement id"
Expand Down
6 changes: 3 additions & 3 deletions api/spec/json/retentionRules.json
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@
"pathParameters": [
{
"name": "id",
"type": "string",
"type": "[]id",
"required": true,
"pipeline": true,
"description": "Retention rule id"
Expand Down Expand Up @@ -199,7 +199,7 @@
"pathParameters": [
{
"name": "id",
"type": "string",
"type": "[]id",
"required": true,
"pipeline": true,
"description": "Retention rule id"
Expand Down Expand Up @@ -250,7 +250,7 @@
"pathParameters": [
{
"name": "id",
"type": "string",
"type": "[]id",
"required": true,
"pipeline": true,
"description": "Retention rule id"
Expand Down
4 changes: 2 additions & 2 deletions api/spec/json/users.json
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@
"pathParameters": [
{
"name": "id",
"type": "string",
"type": "[]id",
"required": true,
"pipeline": true,
"description": "Role id. Note: lookup by name is not yet supported"
Expand Down Expand Up @@ -389,7 +389,7 @@
},
{
"name": "id",
"type": "string",
"type": "[]user",
"required": true,
"pipeline": true,
"description": "User id"
Expand Down
Loading

0 comments on commit 46fc97f

Please sign in to comment.