-
Notifications
You must be signed in to change notification settings - Fork 45
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
DOCS-3430: Add viam machines part cp command #3905
Merged
Merged
Changes from 5 commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
b2301be
DOCS-3430: Add viam machines part cp command
npentrel 66237fc
Update cli.md
npentrel 107950c
Update docs/dev/tools/cli.md
npentrel 61f8b40
Address feedback
npentrel 202684c
Update docs/dev/tools/cli.md
npentrel 1bae232
Update docs/dev/tools/cli.md
npentrel 9bb8c57
Update docs/dev/tools/cli.md
npentrel File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -1160,6 +1160,7 @@ viam machines part status --organization=<org name> --location=<location name> - | |
viam machines part run --organization=<org name> --location=<location name> --machine=<machine id> [--stream] --data <meth> | ||
viam machines part shell --organization=<org name> --location=<location name> --machine=<machine id> | ||
viam machines part restart --machine=<machine id> --part=<part id> | ||
viam machines part cp --organization=<org name> --location=<location name> --machine=<machine id> --part=<part name> <file name> machine:/path/to/file | ||
``` | ||
|
||
Examples: | ||
|
@@ -1190,6 +1191,24 @@ viam.service.vision.v1.VisionService.GetClassificationsFromCamera | |
|
||
# restart a part of a specified machine | ||
viam machines part restart --machine=123 --part=456 | ||
|
||
# Copy and a single file to a machine and change the file's name: | ||
viam machine part cp --organization=my_org --location=my_ocation --machine=my_machine --part=m1-main my_file machine:/home/user/ | ||
npentrel marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
# Recursively copy a directory to a machine: | ||
viam machine part cp --machine=123 --part=123 -r my_dir machine:/home/user/ | ||
|
||
# Copy multiple files to a machine with recursion and keep original permissions and metadata for the files: | ||
viam machine part cp --machine=123 --part=123 -r -p my_dir my_file machine:/home/user/some/existing/dir/ | ||
|
||
# Copy a single file from a machine to a local destination: | ||
viam machine part cp --machine=123 --part=123 machine:my_file ~/Downloads/ | ||
|
||
# Recursively copy a directory from a machine to a local destination: | ||
viam machine part cp --machine=123 --part=123 -r machine:my_dir ~/Downloads/ | ||
|
||
# Copy multiple files from the machine to a local destination with recursion and keep original permissions and metadata for the files: | ||
viam machine part cp --machine=123 --part=123 -r -p machine:my_dir machine:my_file ~/some/existing/dir/ | ||
``` | ||
|
||
#### Command options | ||
|
@@ -1201,7 +1220,7 @@ viam machines part restart --machine=123 --part=456 | |
| `api-key` | Work with an api-key for your machine | `create` (see [positional arguments: api-key](#positional-arguments-api-key)) | | ||
| `status` | Retrieve machine status for a specified machine | - | | ||
| `logs` | Retrieve logs for a specified machine | - | | ||
| `part` | Manage a specified machine part | `status`, `run`, `logs`, `shell`, `restart` (see [positional arguments: part](#positional-arguments-part)) | | ||
| `part` | Manage a specified machine part | `status`, `run`, `logs`, `shell`, `restart`, `cp` (see [positional arguments: part](#positional-arguments-part)) | | ||
| `--help` | Return help | - | | ||
|
||
##### Positional arguments: `api-key` | ||
|
@@ -1222,6 +1241,7 @@ viam machines part restart --machine=123 --part=456 | |
| `logs` | Get logs for the specified machine part | | ||
| `shell` | Access a machine part securely using a secure shell. To use this feature you must add the [`ViamShellDanger` fragment](https://app.viam.com/fragment/b511adfa-80ab-4a70-9bd5-fbb14696b17e/json) to your machine. | | ||
| `restart` | Restart a machine part. | | ||
| `cp` | Copy files to and from a machine part. | | ||
| `--help` | Return help | | ||
|
||
##### Named arguments | ||
|
@@ -1231,7 +1251,7 @@ viam machines part restart --machine=123 --part=456 | |
| -------- | ----------- | ------------------- | --------- | | ||
| `--organization` | Organization name or ID that the machine belongs to | `list`, `status`, `logs`, `part` | **Required** | | ||
| `--location` | Location name or ID that the machine belongs to or to list machines in | `list`, `status`, `logs`, `part` | **Required** | | ||
| `--machine` | Machine name or ID for which the command is being issued | `status`, `logs`, `part`, `part restart` | **Required** | | ||
| `--machine` | Machine name or ID for which the command is being issued. If machine name is used instead of ID, `--organization` and `--location` are required. | `status`, `logs`, `part` | **Required** | | ||
| `--errors` | Boolean, return only errors (default: false) | `logs` | Optional | | ||
| `--levels` | Filter logs by levels (debug, info, warn, error). Accepts multiple inputs in comma-separated list. | `logs` | Optional | | ||
| `--part` | Part name or ID for which the command is being issued | `logs`, `part` | Optional | | ||
|
@@ -1247,6 +1267,8 @@ viam machines part restart --machine=123 --part=456 | |
| `--machine-id` | The machine to create an API key for | `api-key` | **Required** | | ||
| `--name` | The optional name of the API key | `api-key` | Optional | | ||
| `--org-id` | The optional organization ID to attach the key to | `api-key` | Optional | | ||
| `--recursive`, `-r` | Preserve modification times and file mode bits from the source files. Default: `false`. | `part cp` | Optional | | ||
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. It looks like these two descriptions are swapped 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. good spot |
||
| `--preserve`, `-p` | Recursively copy files. Default: `false`. | `part cp` | Optional | | ||
npentrel marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
##### Using the `--stream` and `--data` arguments | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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 there a reason these examples use a space and not an
=
like the other examples in this code block? Seems they should be consistent with above as well as with the template where you have=<>
if both work?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.
changed