Skip to content
This repository was archived by the owner on Sep 17, 2022. It is now read-only.

Commit ba72429

Browse files
committed
Added documentation
1 parent 98023e2 commit ba72429

File tree

11 files changed

+203
-36
lines changed

11 files changed

+203
-36
lines changed

docs/cli/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,4 @@ In this section we will discuss the different CLI commands available for all use
44

55
- [check](check.md)
66
- [remote](remote.md)
7+
- [cloud](cloud/README.md)

docs/cli/cloud/README.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# CLI usage
2+
3+
In this section we will discuss the different CLI commands available for communication with APId cloud.
4+
5+
- [list](list.md)
6+
- [upsert](upsert.md)
7+
- [enable](enable.md)
8+
- [disable](disable.md)

docs/cli/cloud/disable.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
# Disable
2+
3+
Disable removes the suite from the execution index so it won't be executed again until enabled.
4+
5+
## Flags
6+
7+
| Flag | Short | Required | Default | Description |
8+
| :----- | :---- | :------- | :------ | :---------------------------------------------------------------------------------------------------------------------------- |
9+
| --key | -k | yes | | [Your API key](../cloud/README.md), this can also be injected via the `APID_KEY` environment variable. Flag takes precedence. |
10+
| --name | -n | yes | | The name of the suite |
11+
12+
# Examples
13+
14+
```bash
15+
apid cloud suite disable -k <apid cloud key> -n simple-suite
16+
```

docs/cli/cloud/enable.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
# Enable
2+
3+
Enable schedules a suite for execution with the predefined schedule at the predefined locations
4+
5+
## Flags
6+
7+
| Flag | Short | Required | Default | Description |
8+
| :----- | :---- | :------- | :------ | :---------------------------------------------------------------------------------------------------------------------------- |
9+
| --key | -k | yes | | [Your API key](../cloud/README.md), this can also be injected via the `APID_KEY` environment variable. Flag takes precedence. |
10+
| --name | -n | yes | | The name of the suite |
11+
12+
# Examples
13+
14+
```bash
15+
apid cloud suite enable -k <apid cloud key> -n simple-suite
16+
```

docs/cli/cloud/list.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
# List
2+
3+
List displays all the suites associated with the provided API key.
4+
5+
## Flags
6+
7+
| Flag | Short | Required | Default | Description |
8+
| :----- | :---- | :------- | :------ | :---------------------------------------------------------------------------------------------------------------------------- |
9+
| --key | -k | yes | | [Your API key](../cloud/README.md), this can also be injected via the `APID_KEY` environment variable. Flag takes precedence. |
10+
| --name | -n | yes | | The name of the suite |
11+
12+
# Examples
13+
14+
```bash
15+
apid cloud suite list -k <apid cloud key>
16+
```

docs/cli/cloud/upsert.md

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# Upsert
2+
3+
Upsert will create a new suite in APId cloudcontaining all the transactions defined in `apid.yaml` in the current directory. If a suite with the specified name exists it will replace it instead.
4+
5+
It can optionally take a path to the config via the `-c` or `--config` flag. To get familiar with the syntax of a config file, see [here](../../cloud.md)
6+
7+
## Details
8+
9+
Suites in APId cloud use the same syntax as the locally ran configs, thus it is really easy to upload your existing tests with one command. The only difference is that you'll need to provide a couple of extra top level values - `schedule` and a list of `locations`. These are needed so APId knows when and where to execute your suite. You can learn more about these in the config [Reference](../reference/README.md) section.
10+
11+
## Flags
12+
13+
| Flag | Short | Required | Default | Description |
14+
| :------- | :---- | :------- | :---------- | :---------------------------------------------------------------------------------------------------------------------------- |
15+
| --name | -n | yes | | The name of the suite, used to later reference it (enable, replace) |
16+
| --key | -k | yes | | [Your API key](../cloud/README.md), this can also be injected via the `APID_KEY` environment variable. Flag takes precedence. |
17+
| --config | -c | no | ./apid.yaml | The config file. If a folder is provided will recursively load all `*.yaml` files |
18+
19+
# Examples
20+
21+
```bash
22+
apid cloud suite upsert -c ./tests/e2e/apid.yaml -n simple-suite -k <apid cloud key>
23+
```

docs/cloud.md

Lines changed: 23 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,10 @@ configs (suites) from a directory and multiple files contain `schedule`, it's no
1010
schedule will be used; it's not a problem if they are the same.
1111

1212
| Field | Type | Required | Description |
13-
| :------ | :----- | :------- | :------------------------------------------------- |
13+
| :------- | :----- | :---------------- | :---------------------------------------------------------------------------- |
1414
| schedule | string | no; yes for cloud | A [valid cron expression](https://en.wikipedia.org/wiki/Cron#CRON_expression) |
15-
16-
We support `?` `/` `*` `,` `-` as well as the standard macros `@yearly` `@annually` `@monthly` `@weekly` `@daily` `@midnight` `@hourly` `@every <duration>` (`<duration>` is a sequence of numbers with time units: "ns", "us", "ms", "s", "m", "h") |
15+
16+
We support `?` `/` `*` `,` `-` as well as the standard macros `@yearly` `@annually` `@monthly` `@weekly` `@daily` `@midnight` `@hourly` `@every <duration>` (`<duration>` is a sequence of numbers with time units: "ns", "us", "ms", "s", "m", "h") |
1717

1818
All times will be interpreted in GMT+0.
1919

@@ -34,15 +34,30 @@ configs (suites) from a directory and multiple files contain `locations`, it's n
3434
set of locations will be used. It's not a problem if they are the same.
3535

3636
| Field | Type | Required | Description |
37-
| :------ | :----- | :------- | :------------------------------------------------- |
37+
| :------- | :------- | :---------------- | :------------------------------------------------------- |
3838
| schedule | []string | no; yes for cloud | A list of locations. Valid elements are to be announced. |
3939

4040
```yaml
41-
locations: ['us-east', 'europe-london']
41+
locations: ["dublin", "montreal", "saopaulo"]
42+
```
43+
44+
```yaml
45+
locations:
46+
- "dublin"
47+
- "montreal"
48+
- "sanfrancisco"
4249
```
4350

51+
## Examples
52+
4453
```yaml
45-
locations:
46-
- 'us-east'
47-
- 'europe-london'
54+
schedule: "0 0 * * *"
55+
56+
locations:
57+
- "dublin"
58+
- "montreal"
59+
- "sanfrancisco"
60+
61+
transactions:
62+
- ...
4863
```

docs/cloud/README.md

Lines changed: 12 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -2,30 +2,21 @@
22

33
Besides being able to run your tests from your local machine, APId also has the functionality to run from around the world. This functionality is powered by the APId cloud offering.
44

5-
## How it works
5+
## Scheduled execution
66

7-
The cloud offering works pretty much the same way. You need to define your transactions, as you would with the CLI, and then using the APId CLI issue a `remote` command. This works as follows:
7+
This is the most powerful mode of APId cloud. It allows you to define a set of checks, upload them and let us run them on a predefined schedule and from predefined locations for you! You'll get a notification as soon as when we detect something went wrong with your API!
88

9-
- The CLI reads the transactions from the specified directory or file, as per ususal
10-
- It will execute each transaction, sending the necessary `STEP` information to the cloud for remote execution
11-
- It will wait for each `STEP` result to come back and continue with the other steps and transactions
9+
- [more information](cloud.md)
1210

13-
One major benefit of this workflow is that all the interpolation is done locally (on the machine running the CLI), thus you have control over the environment it runs in. This means you can invoke any custom executables.
11+
## On demand remote execution
1412

15-
## Usage
13+
The remote execution offering works pretty much the same way. You need to define your transactions, as you would with the CLI, and then using the APId CLI issue a `remote` command.
1614

17-
In order to use the power of the cloud you will need a personal access key. To generate one, you will have to:
18-
19-
- Head over to https://www.getapid.com and sign up
20-
- Go to the dashboard and create a new access key
21-
22-
Once you have your key you will need to [install the APId CLI](../installation/cli.md) (if you haven't already) or use our [official docker image](../installation/docker.md).
23-
24-
A reference on how use the CLI after installation for remote execution can be found [here](../cli/remote.md).
15+
- [more information](remote.md)
2516

2617
## Regions
2718

28-
APId cloud runs in multiple regions worldwide. Below is a list of the current ones. The default region is set to Washington.
19+
APId cloud runs in multiple regions worldwide. Below is a list of the current ones.
2920

3021
| Region Name | Location |
3122
| :----------- | :------------ |
@@ -40,17 +31,15 @@ APId cloud runs in multiple regions worldwide. Below is a list of the current on
4031
| frankfurt | Frankfurt |
4132
| saopaulo | Sao Paulo |
4233

43-
## Timeouts
44-
45-
The execution timeout is set to 30 seconds. If your API does not respond within that time an error is returned.
46-
4734
## Billing
4835

49-
We've tried making the billing model as simple as possible. Each account has a quota of units they can use each month for running their tests on the cloud infrastructure.
36+
We've tried making the billing model as simple as possible. Each account has a free tier quota of units they can use each month for running their tests on the cloud infrastructure, after which there is a flat fee for each unit used.
37+
38+
Each unit corresponds to 100ms of execution time.
5039

51-
Each unit corresponds to 100ms of execution time of a step - thus the response time of the API for each step.
40+
In case of on demand remote execution, you will be billed separately for every step.
5241

53-
You are not billed for any interpolation or step preparation (which is done on the machine you're running the CLI on).
42+
When using scheduled execution you're billed for the whole duration of the suite execution.
5443

5544
### Examples
5645

docs/cloud/cloud.md

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# Scheduled execution
2+
3+
Scheduled execution works pretty much the same way. You need to define your transactions, as you would with the CLI, and then using the APId CLI upload them to APId cloud. This works as follows:
4+
5+
- The CLI reads the transactions from the specified directory or file, as per ususal\
6+
- The CLI will marshal the transactions and upload them to the APId cloud with the provided suite name. A suite is a bundle of transactions that will be executed together.
7+
- APId cloud will read the configuration you've uploaded and will execute the transactions from each of the specified locations as per the schedule.
8+
9+
There are some caveats in doing this, mainly that shell commands DO NOT work, since, well, it's a remote machine.
10+
11+
## Usage
12+
13+
In order to use the power of the cloud you will need a personal access key. To generate one, you will have to:
14+
15+
- Head over to https://console.getapid.com and sign up
16+
- Go to the settings page and create a new access key
17+
18+
Once you have your key you will need to [install the APId CLI](../installation/cli.md) (if you haven't already) or use our [official docker image](../installation/docker.md).
19+
20+
A reference on how use the CLI after installation for uploading suites can be found [here](../cli/cloud/upload.md).

docs/cloud/remote.md

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
# Remote execution
2+
3+
The remote execution offering works pretty much the same way. You need to define your transactions, as you would with the CLI, and then using the APId CLI issue a `remote` command. This works as follows:
4+
5+
- The CLI reads the transactions from the specified directory or file, as per ususal
6+
- It will execute each transaction, sending the necessary `STEP` information to the cloud for remote execution
7+
- It will wait for each `STEP` result to come back and continue with the other steps and transactions
8+
9+
One major benefit of this workflow is that all the interpolation is done locally (on the machine running the CLI), thus you have control over the environment it runs in. This means you can invoke any custom executables.
10+
11+
## Usage
12+
13+
In order to use the power of the cloud you will need a personal access key. To generate one, you will have to:
14+
15+
- Head over to https://console.getapid.com and sign up
16+
- Go to the dashboard and create a new access key
17+
18+
Once you have your key you will need to [install the APId CLI](../installation/cli.md) (if you haven't already) or use our [official docker image](../installation/docker.md).
19+
20+
A reference on how use the CLI after installation for remote execution can be found [here](../cli/remote.md).
21+
22+
## Regions
23+
24+
APId cloud runs in multiple regions worldwide. Below is a list of the current ones. The default region is set to Washington.
25+
26+
| Region Name | Location |
27+
| :----------- | :------------ |
28+
| montreal | Montreal |
29+
| washington | Washington |
30+
| sanfrancisco | San Francisco |
31+
| mumbai | Mumbai |
32+
| tokyo | Tokyo |
33+
| sydney | Sydney |
34+
| dublin | Dublin |
35+
| stockholm | Stockholm |
36+
| frankfurt | Frankfurt |
37+
| saopaulo | Sao Paulo |
38+
39+
## Timeouts
40+
41+
The execution timeout is set to 30 seconds. If your API does not respond within that time an error is returned.
42+
43+
## Billing
44+
45+
We've tried making the billing model as simple as possible. Each account has a quota of units they can use each month for running their tests on the cloud infrastructure.
46+
47+
Each unit corresponds to 100ms of execution time of a step - thus the response time of the API for each step.
48+
49+
You are not billed for any interpolation or step preparation (which is done on the machine you're running the CLI on).
50+
51+
### Examples
52+
53+
| API response time | Units billed |
54+
| :---------------- | :----------- |
55+
| 23 | 1 |
56+
| 99 | 1 |
57+
| 100 | 1 |
58+
| 105 | 2 |
59+
| 1999 | 20 |

0 commit comments

Comments
 (0)