Skip to content

Commit

Permalink
docs: add command docs (#16)
Browse files Browse the repository at this point in the history
  • Loading branch information
leo220yuyaodog authored Apr 21, 2024
1 parent fea94d9 commit 26af9aa
Show file tree
Hide file tree
Showing 3 changed files with 52 additions and 0 deletions.
44 changes: 44 additions & 0 deletions docs/command/command.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
---
title: Command
description: Executing commands on multiple machines via SSH
keywords: [ssh, command, execute]
authors: [leo220yuyaodog]
---

## Overview

Casvisor provides a command feature that allows you to execute commands on multiple machines via SSH. This feature is
useful for managing multiple machines at the same time. You can execute commands on multiple machines at the same time,
and the results will be displayed in the web UI. Casvisor also exposes API for executing commands.

![command](/img/command/command.png)

## Usage

1. Click the `add` button in the command list page to add a new command.
2. Input the command in the command input box, if you want to execute multiple commands, you can input commands in multiple lines.
3. Select the assets of SSH protocol that you want to execute the command on.
4. Click the `Run All` button to execute the command on all selected assets. Or click the `Run` button to execute the command on a single asset.

## API

Casvisor provides an API for executing commands. The API is as follows:

```shell
Get /api/get-exec-output
Params:
- id: The id ( owner/name ) of the command
```

Response:

```json
{
"code": 200,
"msg": "success",
"data": {
"<asset name1>": "output",
"<asset name2>": "output"
}
}
```
8 changes: 8 additions & 0 deletions sidebars.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,5 +38,13 @@ module.exports = {
"asset/intranet",
],
},
{
type: "category",
label: "Commands",
link: {type: "generated-index"},
items: [
"command/command",
],
},
],
};
Binary file added static/img/command/command.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 26af9aa

Please sign in to comment.