|
1 | 1 | --- |
| 2 | + |
2 | 3 | id: additional-commands |
3 | 4 | title: Additional Commands |
4 | 5 | sidebar_label: Additional Commands |
| 6 | +---------------------------------- |
| 7 | + |
| 8 | +This guide covers additional litmusctl commands for managing your ChaosCenter account, projects, environments, and chaos infrastructures. |
| 9 | + |
| 10 | +Follow this [guide](https://github.com/litmuschaos/litmusctl/blob/master/Usage_0.23.0.md#additional-commands) to learn more about litmusctl commands. |
| 11 | + |
5 | 12 | --- |
6 | 13 |
|
| 14 | +## Account and Configuration Commands |
7 | 15 |
|
| 16 | +### View Current Configuration |
8 | 17 |
|
9 | | -This guide covers additional litmusctl commands for managing your ChaosCenter account, projects, environments, and chaos infrastructures. |
| 18 | +Displays the current configuration from `.litmusconfig`. |
10 | 19 |
|
11 | | -Follow this [guide](https://github.com/litmuschaos/litmusctl/blob/master/Usage_0.23.0.md#additional-commands) to learn more about litmusctl commands. |
| 20 | +```bash |
| 21 | +litmusctl config view |
| 22 | +``` |
| 23 | + |
| 24 | +**Example Output:** |
| 25 | + |
| 26 | +``` |
| 27 | +accounts: |
| 28 | +- users: |
| 29 | + - username: admin |
| 30 | + expires_in: "1626897027" |
| 31 | + token: eyJhbGciOi... |
| 32 | + endpoint: https://preview.litmuschaos.io |
| 33 | +apiVersion: v1 |
| 34 | +current-account: https://preview.litmuschaos.io |
| 35 | +current-user: admin |
| 36 | +kind: Config |
| 37 | +``` |
| 38 | + |
| 39 | +### List Accounts |
| 40 | + |
| 41 | +Shows all accounts configured in `.litmusconfig`. |
| 42 | + |
| 43 | +```bash |
| 44 | +litmusctl config get-accounts |
| 45 | +``` |
| 46 | + |
| 47 | +**Example Output:** |
| 48 | + |
| 49 | +``` |
| 50 | +CURRENT ENDPOINT USERNAME EXPIRESIN |
| 51 | + https://preview.litmuschaos.io admin 2021-07-22 01:20:27 +0530 IST |
| 52 | +* https://preview.litmuschaos.io raj 2021-07-22 14:33:22 +0530 IST |
| 53 | +``` |
| 54 | + |
| 55 | +### Switch Account |
| 56 | + |
| 57 | +Switch between multiple configured accounts. |
| 58 | + |
| 59 | +```bash |
| 60 | +litmusctl config use-account |
| 61 | +``` |
| 62 | + |
| 63 | +**Example:** |
| 64 | + |
| 65 | +``` |
| 66 | +Host endpoint where litmus is installed: https://preview.litmuschaos.io |
| 67 | +Username: admin |
| 68 | +Successfully set the current account to 'admin' at 'https://preview.litmuschaos.io' |
| 69 | +``` |
| 70 | + |
| 71 | +### Update Password |
| 72 | + |
| 73 | +Change your ChaosCenter account password. |
| 74 | + |
| 75 | +```bash |
| 76 | +litmusctl update password |
| 77 | +``` |
| 78 | + |
| 79 | +**Example:** |
| 80 | + |
| 81 | +``` |
| 82 | +Username: admin |
| 83 | +Old Password: ******** |
| 84 | +New Password: ******** |
| 85 | +Confirm Password: ******** |
| 86 | +Password updated successfully! |
| 87 | +``` |
| 88 | + |
| 89 | +--- |
| 90 | + |
| 91 | +## Project and Environment Management |
| 92 | + |
| 93 | +### Create a Project |
| 94 | + |
| 95 | +Creates a new project in ChaosCenter. |
| 96 | + |
| 97 | +```bash |
| 98 | +litmusctl create project |
| 99 | +``` |
| 100 | + |
| 101 | +**Example:** |
| 102 | + |
| 103 | +``` |
| 104 | +Enter a project name: new |
| 105 | +Project 'new' created successfully! |
| 106 | +``` |
| 107 | + |
| 108 | +### Create an Environment |
| 109 | + |
| 110 | +Creates a new environment within a project. |
| 111 | + |
| 112 | +```bash |
| 113 | +litmusctl create environment |
| 114 | +``` |
| 115 | + |
| 116 | +**Example:** |
| 117 | + |
| 118 | +``` |
| 119 | +Enter the Project ID: eb7fc0a0-5878-4454-a9db-b67d283713bc |
| 120 | +Enter the Environment Name: test2 |
| 121 | +New Chaos Environment creation successful! |
| 122 | +``` |
| 123 | + |
| 124 | +### Delete an Environment |
| 125 | + |
| 126 | +Deletes an existing environment from a project. |
| 127 | + |
| 128 | +```bash |
| 129 | +litmusctl delete chaos-environment |
| 130 | +``` |
| 131 | + |
| 132 | +**Example:** |
| 133 | + |
| 134 | +``` |
| 135 | +Enter the Project ID: eb7fc0a0-5878-4454-a9db-b67d283713bc |
| 136 | +Enter the Environment ID: testenv |
| 137 | +Are you sure you want to delete this Chaos Environment? (y/n): y |
| 138 | +Chaos Environment deleted successfully. |
| 139 | +``` |
| 140 | + |
| 141 | +### List Projects |
| 142 | + |
| 143 | +View all available projects. |
| 144 | + |
| 145 | +```bash |
| 146 | +litmusctl get projects |
| 147 | +``` |
| 148 | + |
| 149 | +**Example:** |
| 150 | + |
| 151 | +``` |
| 152 | +PROJECT ID PROJECT NAME CREATEDAT |
| 153 | +50addd40-8767-448c-a91a-5071543a2d8e Developer Project 2021-07-21 14:38:51 +0530 IST |
| 154 | +7a4a259a-1ae5-4204-ae83-89a8838eaec3 DevOps Project 2021-07-21 14:39:14 +0530 IST |
| 155 | +``` |
| 156 | + |
| 157 | +### List Environments |
| 158 | + |
| 159 | +List all environments within a project. |
| 160 | + |
| 161 | +```bash |
| 162 | +litmusctl list chaos-environments --project-id="" |
| 163 | +``` |
| 164 | + |
| 165 | +**Example:** |
| 166 | + |
| 167 | +``` |
| 168 | +CHAOS ENVIRONMENT ID CHAOS ENVIRONMENT NAME CREATED AT CREATED BY |
| 169 | +testenv testenv 55985-01-15 01:42:33 +0530 IST admin |
| 170 | +shivamnewenv shivamnewenv 55962-10-01 15:05:45 +0530 IST admin |
| 171 | +``` |
| 172 | + |
| 173 | +--- |
| 174 | + |
| 175 | +## Chaos Infrastructure Management |
| 176 | + |
| 177 | +### Get Chaos Infrastructures |
| 178 | + |
| 179 | +List all Chaos Infrastructures in a project. |
| 180 | + |
| 181 | +```bash |
| 182 | +litmusctl get chaos-infra |
| 183 | +``` |
| 184 | + |
| 185 | +**Example:** |
| 186 | + |
| 187 | +``` |
| 188 | +CHAOS INFRASTRUCTURE ID CHAOS INFRASTRUCTURE NAME STATUS |
| 189 | +55ecc7f2-2754-43aa-8e12-6903e4c6183a chaos-infra-1 ACTIVE |
| 190 | +13dsf3d1-5324-54af-4g23-5331g5v2364f chaos-infra-2 INACTIVE |
| 191 | +``` |
| 192 | + |
| 193 | +### Disconnect Chaos Infrastructure |
| 194 | + |
| 195 | +Disconnect a Chaos Infrastructure from a project. |
| 196 | + |
| 197 | +```bash |
| 198 | +litmusctl disconnect chaos-infra <chaos-infra-id> --project-id="" |
| 199 | +``` |
| 200 | + |
| 201 | +**Example Output:** |
| 202 | + |
| 203 | +``` |
| 204 | +Chaos Infrastructure successfully disconnected. |
| 205 | +``` |
| 206 | + |
| 207 | +--- |
| 208 | + |
| 209 | +## Chaos Experiment Management |
| 210 | + |
| 211 | +### List Experiments |
| 212 | + |
| 213 | +Get all Chaos Experiments in a project. |
| 214 | + |
| 215 | +```bash |
| 216 | +litmusctl get chaos-experiment --project-id="" |
| 217 | +``` |
| 218 | + |
| 219 | +### Describe a Chaos Experiment |
| 220 | + |
| 221 | +View details of a specific Chaos Experiment. |
| 222 | + |
| 223 | +```bash |
| 224 | +litmusctl describe chaos-experiment <chaos-experiment-id> --project-id="" |
| 225 | +``` |
| 226 | + |
| 227 | +### Delete a Chaos Experiment |
| 228 | + |
| 229 | +Remove a specific Chaos Experiment. |
| 230 | + |
| 231 | +```bash |
| 232 | +litmusctl delete chaos-experiment <chaos-experiment-id> --project-id="" |
| 233 | +``` |
| 234 | + |
| 235 | +**Example Output:** |
| 236 | + |
| 237 | +``` |
| 238 | +Chaos Experiment successfully deleted. |
| 239 | +``` |
| 240 | + |
| 241 | +### List Experiment Runs |
| 242 | + |
| 243 | +Get all Chaos Experiment runs within a project. |
| 244 | + |
| 245 | +```bash |
| 246 | +litmusctl get chaos-experiment-runs --project-id="" |
| 247 | +``` |
| 248 | + |
| 249 | +### Get Experiment Run by ID |
| 250 | + |
| 251 | +Get details of a specific Chaos Experiment run. |
| 252 | + |
| 253 | +```bash |
| 254 | +litmusctl get chaos-experiment-runs --project-id="" --experiment-run-id="" |
| 255 | +``` |
| 256 | + |
| 257 | +--- |
| 258 | + |
| 259 | +## Flag Reference |
| 260 | + |
| 261 | +| Flag | Short | Type | Description | |
| 262 | +| ----------- | ----- | ------ | ---------------------------------------------------------------- | |
| 263 | +| `--cacert` | | string | Custom CA certificate used by litmusctl for portal communication | |
| 264 | +| `--config` | | string | Configuration file path (default `$HOME/.litmusctl`) | |
| 265 | +| `--skipSSL` | | bool | Skip SSL/TLS verification | |
| 266 | +| `--help` | `-h` | | Display help for command | |
| 267 | + |
| 268 | +--- |
| 269 | + |
| 270 | +This update aligns the `additional-command.md` documentation with `litmusctl v0.23.0+`, ensuring users have access to the latest command syntax, examples, and flag information. |
0 commit comments