-
-
Notifications
You must be signed in to change notification settings - Fork 4.4k
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
lxc: add page #1371
lxc: add page #1371
Conversation
pages/linux/lxc.md
Outdated
|
||
- List all containers: | ||
|
||
`lxc list [{{remote}}:][{{filter}}]` |
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'm not sure I understand. Which of the possible combinations of these parameters are valid? Can one use either, both, or only one or the other? Or does one of them require the other, but not the other way around?
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.
This means you can use any one of:
lxc list
to list all containers locally without a filter
lxc list my-remote:
to list all containers on the my-remote
private remote
lxc list abc
to list all local containers matching the filter, abc
or
lxc list my-remote:abc
to list all containers on the my-remote
private remote matching abc
They must be in the order as written though as the value proceeding the colon is the remote.
Using the square brackets to denote optional parameters or arguments is pretty standard in Linux docs but I'm not sure how I should format this in tldr land. I'm also aware that tldr shouldn't have lengthy examples. Any advice gratefully received.
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.
Using square brackets is perfectly fine.
pages/linux/lxc.md
Outdated
@@ -0,0 +1,31 @@ | |||
# lxc | |||
|
|||
> Manages Linux containers (using the lxd REST 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.
We normally use the infinitive tense. Please change "Manages" --> "Manage".
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.
Done. Cheers.
pages/linux/lxc.md
Outdated
|
||
- List all containers: | ||
|
||
`lxc list [{{remote}}:][{{filter}}]` |
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.
What does "remote" and "filter" mean here ?
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.
See above reply for more detail but essentially your containers can be stored locally or on a remote server. If you just lxc list
you'll see all your local containers. The filter
can be used to narrow your search down.
@damianpeterson thanks for the PR! We've left some inline comments, please take a look. |
Looking through other people's page files it seems that no one else is using optional parameters. Perhaps I should give only specific examples for tldr? And clarify in the command description instead? |
@damianpeterson Thanks for the PR! Personally, I'd err on the side of caution and add them anyway (without the square brackets). It's like the |
pages/linux/lxc.md
Outdated
|
||
- List all containers (does not work on public remotes): | ||
|
||
`lxc list [{{private-remote}}:][{{filter}}]` |
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.
Is a private-remote
an IP address? What's a filter? I think that a specific example here might make all the difference.
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.
A remote is an alias to a URL. One of the first things you learn do is lxc launch ubuntu:16.04
which creates a new container locally from the default ubuntu
remote (that's mapped to https://cloud-images.ubuntu.com/releases) and pulls down the most recent 16.04
image. You can make your own remotes and list all that you know about but that might add too many examples for tldr.
How about something like:
The problem with this is that we'll only be able to fit a couple of commands in and some of the others are quite useful. I guess the idea behind tldr is to remind you of common commands you struggle to memorize and folks can always go to the man pages if they want more details. It would be kinda nice if we had some agreed way to denote an optional argument or parameter though. (as a side note, if you want to try lxd/lxc online https://linuxcontainers.org/lxd/try-it/ is a pretty awesome resource) |
Yeah, that might work. You've got the general idea right there! Take the We try to order the commands via natural progression too - i.e. in the order that you're likely to want to execute them. |
@sbrl how about this version? I've added a line to the heading that describes how the remote works and that it's always optional. That way we don't have to double the number of examples. What do you think? |
I'm a bit out of my depth here. @agnivade, @waldyrious - thoughts? |
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.
LGTM overall. Just put a minor comment.
I am okay if you want to bring back the square brackets. Just clarify that if the remote is not mentioned, then it falls back to querying locally.
pages/linux/lxc.md
Outdated
|
||
- List local containers matching a filter string. Omit the filter to list all local containers: | ||
|
||
`lxc list {{filter}}` |
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 think "filter" can be better expressed as "match_string"
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 idea. Done.
Nice one. It's good to be able to use square brackets for optional parameters. Done. Thanks. |
pages/linux/lxc.md
Outdated
# lxc | ||
|
||
> Manage Linux containers using the lxd REST API. | ||
> 'remote:' refers to the alias for a remote server (i.e. 'ubuntu:') and when omitted will apply locally. |
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 don't think the (i.e. 'ubuntu:')
is particularly elucidative here. In fact, the whole sentence is longer than I'd be comfortable with. Maybe I'd write this as:
Any container names or patterns can be prefixed with the name of a remote server.
Does that sound OK to you guys?
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.
This does not mention that by default, it applies to the local machine.
pages/linux/lxc.md
Outdated
> Manage Linux containers using the lxd REST API. | ||
> 'remote:' refers to the alias for a remote server (i.e. 'ubuntu:') and when omitted will apply locally. | ||
|
||
- List local containers matching a string. Omit string to list all local containers: |
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 prefer writing "omit the string" to make this extra clear :)
pages/linux/lxc.md
Outdated
|
||
`lxc list {{match_string}}` | ||
|
||
- List images matching a string. Omit string to list all images: |
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.
Here too: "Omit the string".
Hey all -- sorry for not replying earlier, I had a bit of a rough week. I don't feel comfortable delaying this PR further with discussion about the optional parameter notations, so I'll just add this as a side note which should not affect the mergeability of the PR. That said: as @damianpeterson pointed out, if indeed we don't have optional parameters elsewhere, then using them here is fine, but not perfectly fine IMO. We do have the downside of having to compact extensive commands because of the need to show the various combinations, but the way we've handled them in the past is by creating pages for the subcommands. In this case it may not be justified if the syntax actually doesn't change that much among subcommands (please correct me if I'm wrong @damianpeterson). So we have three solutions here:
Of the three options above, my preference would be 1, then 2, then 3, but as I said, this note is not meant as a review of this particular PR -- we could merge it as-is since it is already in a form that would clearly bring a net benefit to the project, for little or no downside (i.e. introducing the precedent of square brackets notation). |
I agree with 1 too. But as @damianpeterson said, he won't be able to contain the useful examples within the limit of 8 that we have. That's why I was OK with adding square brackets. I will leave it to him to see what is feasible. |
@waldyrious I think that it would be a bit much to have additional pages for each subcommand. For me, I turn to As far as square brackets denoting optional arguments goes, it's standard practice in documentation I come across on a daily basis (all Linux documentation, npm, MDN) and in the case of I'm also very aware that I'm only one user and new to |
Fair enough, @damianpeterson, I can agree that in this case, using the square brackers might be the most sensible approach. Thanks again for the contribution :) |
Confusingly,
lxd
useslxc
as its command. Also, I wasn't sure from the contributing guide how to format optional parameters so have gone with linux standard. I'll remove them if it's not the done thing.