-
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
Changes from 1 commit
ae48a8f
facdd39
c4c9e92
c957383
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -12021,6 +12021,23 @@ paths: | |
$ref: '#/components/schemas/Tag' | ||
default: | ||
$ref: '#/components/responses/ErrorResponse' | ||
x-code-samples: | ||
- lang: Shell | ||
source: > | ||
curl -H "Content-Type: application/json" \ | ||
-H "Authorization: Bearer $TOKEN" \ | ||
-X POST -d '{ | ||
"label": "example tag", | ||
"linodes": [123,456], | ||
"volumes": [9082,10003] | ||
}' \ | ||
https://api.linode.com/v4/tags | ||
- lang: CLI | ||
source: > | ||
linode-cli tags create \ | ||
--label 'example tag' \ | ||
--linodes (123 456) \ | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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:
Any tips for where I might be going wrong? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. You need to specify
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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. |
||
--volumes (9082 10003) | ||
/tags/{label}: | ||
x-linode-cli-command: tags | ||
parameters: | ||
|
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.