Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add attributes sub-cmd in list command #192

Merged
merged 3 commits into from
Jul 25, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
## NGSI Go v0.8.4-next

- Hardening: Add attributes sub-cmd in list command (#192)
- Update: Change command name from geoproxy to queryproxy (#191)
- Improve: Add test case to wait for Wilma to be ready (#190)
- Improve: Update e2e test (#189)
Expand Down
4 changes: 2 additions & 2 deletions docs/apis_mapping_table.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,8 @@ These tables show the mapping from FIWARE Open APIs to NGSI Go commands.
| DELETE /ngsi-ld/v1/subscriptions/{subscriptionId} | delete subscription --id {subscriptionId} |
| GET /ngsi-ld/v1/types/ | list types |
| GET /ngsi-ld/v1/types/{type} | (not yet implemented) |
| GET /ngsi-ld/v1/attributes/ | (not yet implemented) |
| GET /ngsi-ld/v1/attributes/{attrId} | (not yet implemented) |
| GET /ngsi-ld/v1/attributes/ | list attributes |
| GET /ngsi-ld/v1/attributes/{attrId} | list attributes --attr {attrId} |
| POST /ngsi-ld/v1/csourceRegistrations/ | create registration |
| GET /ngsi-ld/v1/csourceRegistrations/ | list registrations |
| GET /ngsi-ld/v1/csourceRegistrations/{registrationId} | get registration --id {registrationId} |
Expand Down
39 changes: 39 additions & 0 deletions docs/ngsi/list.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
This command lists types, entities, subscriptions or registrations.

- [List multiple types](#list-multiple-types)
- [List multiple attributes](#list-multiple-attributes)
- [List multiple entities](#list-multiple-entities)
- [List multipletemporal entities](#list-multiple-temporal-entities)
- [List multiple subscriptions](#list-multiple-subscriptions)
Expand Down Expand Up @@ -63,6 +64,44 @@ ngsi list types --json
["InventoryItem","Product","Shelf","Store"]
```

<a name="list-multiple-attributes"></a>

## List multiple attributes

This command lists attributes.

```console
ngsi list [common options] attributes [options]
```

### Options

| Options | Description |
| ---------------------- | ----------------------------------------------- |
| --attr value | attribute name |
| --details, -d | detailed attribute information (default: false) |
| --pretty, -P | pretty format (default: false) |
| --link value, -L value | specify @context |
| --help | show help (default: false) |

### Examples

```console
ngsi list --host orion-ld attributes
```

```console
ngsi list --host orion-ld attributes --link ctx
```

```console
ngsi list --host orion-ld attributes --attr "https://w3id.org/saref#temperature"
```

```console
ngsi list --host orion-ld attributes --attr temperature --link ctx
```

<a name="list-multiple-entities"></a>

## List multiple entities
Expand Down
1 change: 1 addition & 0 deletions docs/usage.md
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,7 @@ ngsi [global options] command [common options] sub-command [options]
| | [subscription](./ngsi/get.md#get-a-subscription) | get subscription |
| | [registration](./ngsi/get.md#get-a-registration) | get registration |
| [list](./ngsi/list.md) | [types](./ngsi/list.md#list-multiple-types) | list types |
| | [attributes](./ngsi/list.md#list-multiple-attributes) | list attributes |
| | [entities](./ngsi/list.md#list-multiple-entities) | list entties |
| | [tentities](./ngsi/list.md#list-multiple-temporal-entities) | List temporal entities |
| | [subscription](./ngsi/list.md#list-multiple-subscriptions) | list subscription |
Expand Down
2 changes: 1 addition & 1 deletion e2e/cases/1000_common/0001_ngsi.test
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ COMMANDS:
create create entity(ies), subscription or registration
delete delete entity(ies), attribute, subscription or registration
get get entity(ies), attribute(s), subscription, registration or type
list list types, entities, subscriptions or registrations
list list types, attributes, entities, tentities, subscriptions or registrations
replace replace entities or attributes
update update entities, attribute(s) or subscription
upsert upsert entity or entities
Expand Down
3 changes: 2 additions & 1 deletion e2e/cases/4000_ngsi-v2/0501_list_command.test
Original file line number Diff line number Diff line change
Expand Up @@ -32,12 +32,13 @@ ngsi list --help

```
NAME:
ngsi list - list types, entities, subscriptions or registrations
ngsi list - list types, attributes, entities, tentities, subscriptions or registrations

USAGE:
ngsi list command [command options] [arguments...]

COMMANDS:
attributes list attributes
types list types
entities list entities
tentities list temporal entities
Expand Down
Loading