Skip to content

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

Merged
merged 4 commits into from
Mar 9, 2020
Merged
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
24 changes: 24 additions & 0 deletions openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12021,6 +12021,25 @@ 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],
Copy link
Contributor Author

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.

Copy link
Collaborator

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.

"volumes": [9082,10003]
}' \
https://api.linode.com/v4/tags
- lang: CLI
source: >
linode-cli tags create \
--label 'example tag' \
--linodes 123 \
--linodes 456 \
--volumes 9082 \
--volumes 10003
/tags/{label}:
x-linode-cli-command: tags
parameters:
Expand Down Expand Up @@ -12083,6 +12102,11 @@ paths:
$ref: '#/components/schemas/PaginationEnvelope/properties/results'
default:
$ref: '#/components/responses/ErrorResponse'
x-code-samples:
- lang: Shell
source: >
curl -H "Authorization: Bearer $TOKEN" \
"https://api.linode.com/v4/tags/example tag"
delete:
summary: Delete a Tag
description: >
Expand Down