Skip to content

Commit

Permalink
Enhance docs (#85)
Browse files Browse the repository at this point in the history
* upgrade to v1.1.11

* update doc

* add update browser

* patch doc

* create doc

* enhance docs

* update readme

* add metavar for --remaining-days-check option

---------

Co-authored-by: rongzhus <[email protected]>
  • Loading branch information
swethalohith2 and rongzhus authored May 28, 2024
1 parent 15baf43 commit dc96813
Show file tree
Hide file tree
Showing 15 changed files with 192 additions and 67 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ Synthetic smart alert management:
- [synctl delete alert](docs/synctl-delete-alert.md) - Delete smart alert.

Synthetic credentials management:
- [synctl create/update/delete cred](docs/synctl-credential.md) - Manage credentials.
- [synctl get/create/update/delete cred](docs/synctl-credential.md) - Manage credentials.

Others:
- [synctl get application](docs/synctl-get-app.md) - Display Instana application.
Expand Down
2 changes: 1 addition & 1 deletion docs/synctl-config.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ synctl config remove --name pink
```
**Note:** By default, configuration file is under `~/.synthetic/config.json`.

### Run command with options --host <host> and --token <token>
### Run command with options --host \<host\> and --token \<token\>

Get all tests with options
```
Expand Down
2 changes: 1 addition & 1 deletion docs/synctl-create-alert.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ synctl create alert [options]

## Examples

Create Smart Alert for Synthetic test.
Create Smart Alert for Synthetic test
```
synctl create alert --name "Smart-alert" \
--alert-channel "$ALERT_CHANNEL" \
Expand Down
85 changes: 55 additions & 30 deletions docs/synctl-create-test.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ synctl create test [options]
```

## Options
### Common options
```
-h, --help show this help message and exit
Expand All @@ -17,41 +18,65 @@ synctl create test [options]
--description, -d <string> the description of Synthetic test
--frequency <int> the range is from 1 to 120 minute, default is 15
--app-id, --application-id <id> application id
--retries <int> retry times, value is from [0, 2]
--retry-interval <int> retry interval, range is [1, 10]
--timeout <num>ms|s|m set timeout, accept <number>(ms|s|m)
--custom-properties <string> An object with name/value pairs to provide additional information of the Synthetic test
--use-env <name>, -e <name> use a specified configuration
--host <host> set hostname
--token <token> set token
```
### Options for API Simple test
```
--url <url> HTTP request URL
--operation <method> HTTP request methods, GET, POST, HEAD, PUT, etc
--headers <json> HTTP headers
--body <string> HTTP body
-f, --from-file <file> Synthetic script, support js file, e.g, script.js
--bundle <bundle> Synthetic bundle test script, support zip file, zip file encoded with base64
--script-file <file-name> Synthetic bundle test entry file, e.g, myscript.js
--retries <int> retry times, value is from [0, 2]
--retry-interval <int> retry interval, range is [1, 10]
--follow-redirect <boolean> to allow redirect, true by default
--timeout <num>ms|s|m set timeout, accept <number>(ms|s|m)
--expect-status <int> expected status code, Synthetic test will fail if response status is not equal to it, default 200
--expect-json <string> An optional object to be used to check against the test response object
--expect-match <string> An optional regular expression string to be used to check the test response
--expect-exists <string> An optional list of property labels used to check if they are present in the test response object
--expect-not-empty <string> An optional list of property labels used to check if they are present in the test response object with a non-empty value
--allow-insecure <boolean> if set to true then allow insecure certificates
--custom-properties <string> An object with name/value pairs to provide additional information of the Synthetic test
```
### Options for API Script test
```
-f, --from-file <file> Synthetic script, support js file, e.g, script.js
--bundle <bundle> Synthetic bundle test script, support zip file, zip file encoded with base64
--script-file <file-name> Synthetic bundle test entry file, e.g, myscript.js
```
### Options for Browser Script test
```
--browser <string> browser type, support chrome and firefox
--record-video <boolean> set true to record video
--from-json <json> full Synthetic test payload, support json file
```
### Options for Webpage Script test
```
-f, --from-file <file> Synthetic script, support js file, e.g, script.js
--record-video <boolean> enable/disable record video, false by default
--browser <string> browser type, support chrome and firefox
```
### Options for Webpage Simple test
```
--url <url> HTTP URL
--record-video <boolean> enable/disable record video, false by default
--browser <string> browser type, support chrome and firefox
```
### Options for SSLCertificate test
```
--hostname <host> set hostname for ssl test
--port <int> set port, default is 443
--remaining-days-check <int> set remaining days before expiration of SSL certificate
--use-env <name>, -e <name> use a specified configuration
--host <host> set hostname
--token <token> set token
```

## Examples

### Create API Simple test
### Create API Simple test example

Create API Simple test, test frequency is 5min. Use command `synctl get lo` to get location id.
Create API Simple test, test frequency is 5min. Use command `synctl get lo` to get location id
```
synctl create test -t 0 \
--label "simple-ping" \
Expand All @@ -60,14 +85,15 @@ synctl create test -t 0 \
--frequency 5
```

Create API Simple test and specify multiple location id.
Create API Simple test and specify multiple location id
```
synctl create test -t 0 \
--label "simple-ping" \
--url "https://httpbin.org/get" \
--location "$LOCATION1" "$LOCATION2" "$LOCATION3" ...
```
Create API Simple test and specify application id, retry, headers, and timeout.

Create API Simple test and specify application id, retry, headers, and timeout
```
synctl create test -t 0 \
--label "API-simple-test" \
Expand All @@ -85,7 +111,7 @@ synctl create test -t 0 \
--allow-insecure true
```

Expect Status example.
Expect status example
```
synctl create test -t 0 \
--label "ping-expect-status-200" \
Expand All @@ -94,7 +120,7 @@ synctl create test -t 0 \
--expect-status 200
```

Expect Json example.
Expect json example
```
synctl create test -t 0 \
--label "ping-expect-json" \
Expand Down Expand Up @@ -123,7 +149,7 @@ synctl create test -t 0 \
}'
```

Expect Match example
Expect match example
```
synctl create test -t 0 \
--label expect-match-test \
Expand All @@ -133,7 +159,7 @@ synctl create test -t 0 \
```


Expect esists example
Expect exists example
```
synctl create test -t 0 \
--label expect-exists-test \
Expand All @@ -149,12 +175,11 @@ synctl create test -t 0 \
--url https://httpbin.org/json \
--location "$LOCATION1" \
--expect-not-empty '["slideshow"]'
```

### Create API Script test Examples
### Create API Script test example

Create a simple API script from file.
Create a simple API script from file
```
synctl create test -t 1 \
--label "simple-api-script" \
Expand Down Expand Up @@ -201,7 +226,7 @@ synctl create test -t 1 --label "syn-bundle-test" \
--frequency 5
```

### Create Browser Script test examples
### Create Browser Script test example

create a browser script test
```
Expand Down Expand Up @@ -233,7 +258,7 @@ synctl create test -t 2 \
--bundle "UEsDBAoAAAAAAHltFlUAAAAAAAAAAAAAAAAEABwAbGliL1VUCQADlRcDY2izBGN1eAsAAQToAwAABOgDAABQSwMEFAAI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AAP+BPgAAAGxpYi9teXNjcmlwdC5qc1VUBQADoJcFY3V4CwABBOgDAAAE6AMAAFBLAQIeAxQACAAIAHltFlUOc5IPjgAAABEBAAAJABgAAAAAAAEAAAD/gRoCAABteXRlc3QuanNVVAUAA5UXA2N1eAsAAQToAwAABOgDAABQSwUGAAAAAAMAAwDuAAAA+wIAAAAA"
```

#### Create Webpage Script test
### Create Webpage Script test example

```
synctl create test -t 3 \
Expand All @@ -243,27 +268,27 @@ synctl create test -t 3 \
--browser chrome
```

#### Create Webpage Action test
### Create Webpage Simple test example
```
synctl create test -t 4 \
--label "browser-test-webpageaction" \
--label "browser-test-webpage-action" \
--url "https://httpbin.org/get" \
--location "$LOCATION" --frequency 5 \
--record-video true \
--browser chrome
```

#### Create SSLCertificate test
### Create SSLCertificate test example
```
synctl create test -t 5 \
--label "ssl-certificate-test" \
--hostname "httpbin.org" \
--hostname "www.ibm.com" \
--port 443 \
--remaining-days-check 30 \
--lo "$LOCATION"
--lo "$LOCATION"
```

#### Create Synthetic test with json payload
### Create Synthetic test with json payload example

```
synctl create test -t <type> --from-json payload/api-script.json
Expand Down
2 changes: 1 addition & 1 deletion docs/synctl-delete-alert.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ Delete a smart alert
synctl delete alert <alert-id>
```

Delete several smart alert
Delete several smart alerts
```
synctl delete alert <alert-id-1> <alert-id-2> <alert-id-3> ...
```
1 change: 0 additions & 1 deletion docs/synctl-delete-loc.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ Delete Synthetic location.
synctl delete location <location-id>
```


## Examples

Delete a Synthetic location
Expand Down
8 changes: 4 additions & 4 deletions docs/synctl-delete-test.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,22 +22,22 @@ synctl delete test [id...] [options]

## Examples

Delete Synthetic with id:
Delete Synthetic with id
```
synctl delete test <synthetic-id>
```

Delete several Synthetic tests:
Delete several Synthetic tests
```
synctl delete test <id-1> <-id-2> <id-3> ...
```

Delete test whose label match regex, refer [regular expression operations](https://docs.python.org/3/library/re.html). Delete all tests which label match regex `^ping-test-*`:
Delete test whose label match regex, refer [regular expression operations](https://docs.python.org/3/library/re.html). Delete all tests which label match regex `^ping-test-*`
```
synctl delete test --match-regex "^ping-test-*"
```

Delete all tests:
Delete all tests
```
synctl delete test --match-regex ".*"
```
Expand Down
4 changes: 2 additions & 2 deletions docs/synctl-get-alert.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,12 @@ Get Smart Alert
synctl get alert
```

Show smart alert details.
Show smart alert details
```
synctl get alert <id> --show-details
```

Show smart alert payload in json format.
Show smart alert payload in json format
```
synctl get alert <id> --show-json
```
2 changes: 1 addition & 1 deletion docs/synctl-get-app.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ List Instana Application, application can be used to create Synthetic test.

## Syntax
```
synctl get test [id] [options]
synctl get app [id] [options]
```

## Options
Expand Down
4 changes: 2 additions & 2 deletions docs/synctl-get-result.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ Show result details, note that time window need to be same with result list
synctl get result <id> --test <test-id> --window-size 6h
```

Save HAR to local
Save HAR file to local
```
synctl get result <id> --test <test-id> --har
```
```
1 change: 0 additions & 1 deletion docs/synctl-get-size.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ synctl get pop-size|size

## Examples

Estimate size of Self-hosted PoP
```
synctl get pop-size
```
Expand Down
Loading

0 comments on commit dc96813

Please sign in to comment.