linode-cli icon indicating copy to clipboard operation
linode-cli copied to clipboard

[Bug]: 'events ls' sub-command cannot filter on entity.type

Open Sudavar opened this issue 1 year ago • 6 comments

CLI Version

linode-cli 5.41.3 Built off spec version 4.159.0

Command

linode-cli events ls --entity.type linode

Output

Request failed: 400
                  errors                   
┌──────────┬──────────────────────────────┐
│ field    │ reason                       │
├──────────┼──────────────────────────────┤
│ X-Filter │ Cannot filter on entity.type │
└──────────┴──────────────────────────────┘

Expected Behavior

List of events based on the type (linode in this case/example). This works in version linode-cli 5.41.2 Built off spec version 4.157.1 like a charm:

┌───────────┬────────────┬──────────────────────┬───────────────────┬─────────────────────┬──────────┬──────────────┬─────────┐
│ id        │ username   │ action               │ label             │ created             │ duration │ status       │ message │
├───────────┼────────────┼──────────────────────┼───────────────────┼─────────────────────┼──────────┼──────────────┼─────────┤
│ XXXXXXXXX │ user       │ linode_shutdown      │ TEST              │ 2023-07-29T20:32:03 │ 8.0      │ finished     │         │

Actual Behavior

API rejects saying Cannot filter on entity.type

Steps to Reproduce

Each time the events subcommand is invoked with --entity.type argument

Sudavar avatar Jul 29 '23 20:07 Sudavar

Thanks for the bug report!

This issue seems to have started occurring after we started using the +and operator when building the filter header. As a temporary workaround, we could consider using the +and operator only if multiple filters are defined.

I've reported this issue internally and will let you know when we have any updates to share 🙂

lgarber-akamai avatar Aug 02 '23 15:08 lgarber-akamai

Great, thank you very much.

Sudavar avatar Aug 04 '23 01:08 Sudavar

Hello,

do you have any information about when will this be released in an update?

Sudavar avatar Nov 28 '23 11:11 Sudavar

Hi @Sudavar, I think the issue has been fixed in the latest version of Linode CLI. Can you still see similar issue on your end?

myusername@mylaptop ~ % linode --version
linode-cli 5.45.2
Built off spec version 4.167.3
myusername@mylaptop ~ % linode events ls --entity.type linode 
┌─────────┬─────────┬─────────┬─────────┬─────────┬─────────┬─────────┬────────┐
│ id      │ userna… │ action  │ entity… │ created │ durati… │ status  │ messa… │
├─────────┼─────────┼─────────┼─────────┼─────────┼─────────┼─────────┼────────┤
│ 605767… │ zliang… │ linode… │ tf_tes… │ 2023-1… │ 22.0    │ finish… │        │
│ 605767… │ zliang… │ linode… │ tf_tes… │ 2023-1… │ 17.0    │ finish… │        │

zliang-akamai avatar Dec 05 '23 09:12 zliang-akamai

@zliang-akamai I actually want to filter based on entity.type and entity.id - I did test with the latest version and still get the error:

yury@host:~$ linode --version
linode-cli 5.45.2
Built off spec version 4.167.3

yury@host:~$ linode events ls --entity.type linode --entity.id XXXXXX
Request failed: 400
errors                                     
┌──────────┬──────────────────────────────┐
│ field    │ reason                       │
├──────────┼──────────────────────────────┤
│ X-Filter │ Cannot filter on entity.id   │
│ X-Filter │ Cannot filter on entity.type │
└──────────┴──────────────────────────────┘

This version however, does not throw error when filtering only based on entity.type linode

Sudavar avatar Dec 05 '23 17:12 Sudavar

Hey @Sudavar, Thanks for the extra info! I checked with my team and there is still some work in progress on the back-end to make this fully fixed. We will let you know when there is an update available.

zliang-akamai avatar Dec 05 '23 19:12 zliang-akamai

After reviewing this issue with internal teams we have found it goes beyond CLI and is a API level issue, it is planned to be fixed with Linode API v5.

jriddle-linode avatar Jul 25 '24 16:07 jriddle-linode