-
Notifications
You must be signed in to change notification settings - Fork 69
Add cURL and CLI examples to POST /tags #212
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 cURL and CLI examples to POST /tags #212
Conversation
-H "Authorization: Bearer $TOKEN" \ | ||
-X POST -d '{ | ||
"label": "example tag", | ||
"linodes": [123,456], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@leslitagordita @yoshizzle I did some testing for this but ran into some problems:
When running the example command as it is here (with the IDs updated for resources that are actually on my account), the tag was created, but the Linodes and Volumes didn't get the tag applied to them. No error was returned by the API, and my API token had full permissions to write to my account.
Can I ask you to try this out too? I'm not sure if this is a problem with the example I've added, or if it might be a bug in the API.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I ran this with Linode and Volume IDs that exist on my account, and it worked as I expected.
openapi.yaml
Outdated
source: > | ||
linode-cli tags create \ | ||
--label 'example tag' \ | ||
--linodes (123 456) \ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Dorthu I realized when trying to write this example that I don't know how to represent lists as arguments for the Linode CLI. Using the Bash array syntax here didn't work; I got the following error:
linode-cli tags create \
--label 'example tag' \
--linodes (123 456) \
--volumes (9082 10003)
zsh: unknown file attribute: 1
Any tips for where I might be going wrong?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You need to specify --linodes
multiple times; in this case you want:
linode-cli tags create \
--label 'example tag' \
--linodes 123 \
--linodes 456 \
--volumes 9082 \
--volumes 10003
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I pushed up a commit to add an example in the format you suggested @Dorthu.
openapi.yaml
Outdated
- lang: Shell | ||
source: > | ||
curl -H "Authorization: Bearer $TOKEN" \ | ||
https://api.linode.com/v4/tags/example%20tag |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You could also put the entire URL in quotes to avoid having to escape the space:
https://api.linode.com/v4/tags/example%20tag | |
"https://api.linode.com/v4/tags/example tag" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good suggestion. Updated!
[Birthday] Footer Change - remove Nanode update Standard to Shared
Tagging with do-not-merge: this has some issues I couldn't figure out, and am asking for some second opinions