Skip to content

Commit

Permalink
Merge branch 'master' into unit-tests
Browse files Browse the repository at this point in the history
  • Loading branch information
deep-poharkar authored Jan 20, 2024
2 parents 103c8cc + 3bac6d7 commit d7158b1
Show file tree
Hide file tree
Showing 34 changed files with 1,062 additions and 462 deletions.
156 changes: 54 additions & 102 deletions README.md

Large diffs are not rendered by default.

164 changes: 139 additions & 25 deletions Usage_0.23.0.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@


> Notes:
>
> - For litmusctl v0.23.0 or latest
Expand Down Expand Up @@ -39,7 +37,7 @@ Next, you need to enter ChaosCenter details to login into your ChaosCenter accou

> Example, https://preview.litmuschaos.io/
**Username:** Enter your ChaosCenter username.
**Username:** Enter your ChaosCenter username.
**Password:** Enter your ChaosCenter password.

```
Expand Down Expand Up @@ -162,10 +160,10 @@ After verification of these details, you can proceed with the connection of the
```
Enter service account [Default: litmus]:
📌 Summary
📌 Summary
Chaos Infra Name: test4
Chaos EnvironmentID: test
Chaos Infra Description:
Chaos Infra Description:
Chaos Infra SSL/TLS Skip: false
Platform Name: Others
Namespace: litmuwrq (new)
Expand Down Expand Up @@ -194,15 +192,18 @@ To verify, if the connection process was successful you can view the list of con

### Steps to create a Chaos Experiment

* To setup an account with litmusctl
- To setup an account with litmusctl

```shell
litmusctl config set-account --endpoint="" --username="" --password=""
```

* To create a Chaos Experiment by passing a manifest file
> Note:
> * To get `project-id`, apply `litmusctl get projects`
> * To get `chaos-infra-id`, apply `litmusctl get chaos-infra --project-id=""`
- To create a Chaos Experiment by passing a manifest file
> Note:
>
> - To get `project-id`, apply `litmusctl get projects`
> - To get `chaos-infra-id`, apply `litmusctl get chaos-infra --project-id=""`
```shell
litmusctl create chaos-experiment -f custom-chaos-experiment.yml --project-id="" --chaos-infra-id=""
```
Expand All @@ -212,17 +213,21 @@ litmusctl create chaos-experiment -f custom-chaos-experiment.yml --project-id=""
```shell
litmusctl save chaos-experiment -f custom-litmus-experiment.yaml
```

> Note:
> * Experiment Name can also be passed through the Manifest file
>
> - Experiment Name can also be passed through the Manifest file
```shell
Enter the Project ID: eb7fc0a0-5878-4454-a9db-b67d283713bc
Enter the Chaos Infra ID: e7eb0386-085c-49c2-b550-8d85b58fd
Experiment Description:
Experiment Description:

🚀 Chaos Experiment/experiment-1 successfully created 🎉
```

- To Run a chaos Experiment:

```shell
litmusctl run chaos-experiment

Expand All @@ -233,7 +238,6 @@ Enter the Chaos Experiment ID: test_exp
🚀 Chaos Experiment running successfully 🎉
```


### Additional commands

- To view the current configuration of `.litmusconfig`, type:
Expand All @@ -254,6 +258,7 @@ accounts:
token: eyJhbGciOiJIUzUxMiIsInR5cCI6IkpXVCJ9.eyJleHAiOjE2MjY5NDQ2MDIsInJvbGUiOiJ1c2VyIiwidWlkIjoiNjFmMDY4M2YtZWY0OC00MGE1LWIzMjgtZTU2ZDA2NjM1MTE4IiwidXNlcm5hbWUiOiJyYWoifQ.pks7xjkFdJD649RjCBwQuPF1_QMoryDWixSKx4tPAqXI75ns4sc-yGhMdbEvIZ3AJSvDaqTa47XTC6c8R
username: litmus-user
endpoint: https://preview.litmuschaos.io
serverEndpoint: https://preview.litmuschaos.io
apiVersion: v1
current-account: https://preview.litmuschaos.io
current-user: litmus-user
Expand Down Expand Up @@ -282,6 +287,8 @@ litmusctl config use-account
Host endpoint where litmus is installed: https://preview.litmuschaos.io

Username: admin

✅ Successfully set the current account to 'account-name' at 'URL'
```

- To create a project, apply the following command :
Expand All @@ -290,20 +297,24 @@ Username: admin
litmusctl create project

Enter a project name: new

Project 'project-name' created successfully!🎉
```

- To create a new Environment, apply the following command :

```shell
litmusctl create environment
litmusctl create environment

Enter the Project ID: eb7fc0a0-5878-4454-a9db-b67d283713bc

Enter the Environment Name: test2

🚀New Chaos Environment creation successful!! 🎉
🚀 New Chaos Environment creation successful!! 🎉
```


- To view all the projects with the user, use the `get projects` command.

```shell
litmusctl get projects
```
Expand All @@ -314,6 +325,7 @@ litmusctl get projects
PROJECT ID PROJECT NAME CREATEDAT
50addd40-8767-448c-a91a-5071543a2d8e Developer Project 2021-07-21 14:38:51 +0530 IST
7a4a259a-1ae5-4204-ae83-89a8838eaec3 DevOps Project 2021-07-21 14:39:14 +0530 IST
Press Enter to show the next page (or type 'q' to quit): q
```

- To get an overview of the Chaos Infrastructures available within a project, issue the following command.
Expand All @@ -327,13 +339,13 @@ Enter the Project ID: 50addd40-8767-448c-a91a-5071543a2d8e
**Output:**

```
CHAOS Infrastructure ID CHAOS Infrastructure NAME STATUS
55ecc7f2-2754-43aa-8e12-6903e4c6183a chaos-infra-1 ACTIVE
13dsf3d1-5324-54af-4g23-5331g5v2364f chaos-infra-2 INACTIVE
CHAOS Infrastructure ID CHAOS Infrastructure NAME STATUS
55ecc7f2-2754-43aa-8e12-6903e4c6183a chaos-infra-1 ACTIVE
13dsf3d1-5324-54af-4g23-5331g5v2364f chaos-infra-2 INACTIVE
```

- To disconnect an Chaos Infrastructure, issue the following command..

* To disconnect an Chaos Infrastructure, issue the following command..
```shell
litmusctl disconnect chaos-infra <chaos-infra-id> --project-id=""
```
Expand All @@ -344,12 +356,24 @@ litmusctl disconnect chaos-infra <chaos-infra-id> --project-id=""
🚀 Chaos Infrastructure successfully disconnected.
```

- To list the created Chaos Experiments within a project, issue the following command.

Using Flag :

* To list the created Chaos Experiments within a project, issue the following command.
```shell
litmusctl get chaos-experiment --project-id=""
```

Using UI :

```shell
Enter the Project ID: "project-id"
Select an output format:
table
json
yaml
```

**Output:**

```
Expand All @@ -359,10 +383,22 @@ litmusctl get chaos-experiment --project-id=""
Showing 1 of 1 Chaos Experiments
```

- To list all the Chaos Experiment runs within a project, issue the following command.

```shell
litmusctl get chaos-experiment-runs --project-id=""
```

- To list all the Chaos Experiment runs within a specific experiment, issue the following command.

* To list all the Chaos Experiment runs within a project, issue the following command.
```shell
litmusctl get chaos-experiments-runs --project-id=""
litmusctl get chaos-experiment-runs --project-id="" --experiment-id=""
```

- To list the Chaos Experiment run with a specific experiment-run-id , issue the following command.

```shell
litmusctl get chaos-experiment-runs --project-id="" --experiment-run-id=""
```

**Output:**
Expand All @@ -374,12 +410,25 @@ CHAOS EXPERIMENT RUN ID STATUS RESILIENCY SCORE CHAOS EXPERIMENT ID CHAOS
Showing 1 of 1 Chaos Experiments runs
```

- To describe a particular Chaos Experiment, issue the following command.

Using Flag :

* To describe a particular Chaos Experiment, issue the following command.
```shell
litmusctl describe chaos-experiment <chaos-experiment-id> --project-id=""
```

Using UI :

```shell
litmusctl describe chaos-experiment
Enter the Project ID: "project-id"
Enter the Chaos Experiment ID: "chaos-experiment-id"
Select an output format :
yaml
json
```

**Output:**

```
Expand All @@ -398,18 +447,83 @@ spec:
...
```

- To delete a particular Chaos Experiment, issue the following commands.

Using Flag :

* To delete a particular Chaos Experiment, issue the following command.
```shell
litmusctl delete chaos-experiment <chaos-experiment-id> --project-id=""
```

Using UI :

```shell
litmusctl delete chaos-experiment
Enter the Project ID: "project-id"
Enter the Chaos Experiment ID: "chaos-experiment-id"
Are you sure you want to delete this Chaos Experiment? (y/n): y
```

**Output:**

```
🚀 Chaos Experiment successfully deleted.
```

- To get the Chaos Environment, issue the following command.

Using Flag :

```shell
litmusctl get chaos-environment --project-id="" --environment-id=""
```

Using UI :

```shell
litmusctl get chaos-environment
Enter the Project ID: "project-id"
Enter the Environment ID: "chaos-experiment-id"
```

**Output:**

```
CHAOS ENVIRONMENT ID shivamenv
CHAOS ENVIRONMENT NAME shivamenv
CHAOS ENVIRONMENT Type NON_PROD
CREATED AT 55908-04-03 16:42:51 +0530 IST
CREATED BY admin
UPDATED AT 55908-04-03 16:42:51 +0530 IST
UPDATED BY admin
CHAOS INFRA IDs d99c7d14-56ef-4836-8537-423f28ceac4e
```

- To list the Chaos Environments, issue the following command.

Using Flag :

```shell
litmusctl list chaos-environments --project-id=""
```

Using UI :

```shell
litmusctl list chaos-environment
Enter the Project ID: "project-id"
```

**Output:**

```
CHAOS ENVIRONMENT ID CHAOS ENVIRONMENT NAME CREATED AT CREATED BY
testenv testenv 55985-01-15 01:42:33 +0530 IST admin
shivamnewenv shivamnewenv 55962-10-01 15:05:45 +0530 IST admin
newenvironmenttest newenvironmenttest 55912-12-01 10:55:23 +0530 IST admin
shivamenv shivamenv 55908-04-03 16:42:51 +0530 IST admin
```
---

## Flag details
Expand Down
Loading

0 comments on commit d7158b1

Please sign in to comment.