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

Commit 9724c9e

Browse files
committed
Move remote command to cloud as subcommand
1 parent a8d26ac commit 9724c9e

File tree

6 files changed

+25
-30
lines changed

6 files changed

+25
-30
lines changed

docs/SUMMARY.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@
1212
- [Jenkins](integration/jenkins.md)
1313
- [CLI](cli/README.md)
1414
- [check](cli/check.md)
15-
- [remote](cli/remote.md)
1615
- [cloud](cli/cloud/README.md)
16+
- [check](cli/cloud/check.md)
1717
- [list](cli/cloud/list.md)
1818
- [upsert](cli/cloud/upsert.md)
1919
- [enable](cli/cloud/enable.md)

docs/cli/README.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,4 @@
33
In this section we will discuss the different CLI commands available for all users.
44

55
- [check](check.md)
6-
- [remote](remote.md)
76
- [cloud](cloud/README.md)

docs/cli/cloud/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
In this section we will discuss the different CLI commands available for communication with APId cloud.
44

5+
- [check](check.md)
56
- [list](list.md)
67
- [upsert](upsert.md)
78
- [enable](enable.md)
Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
# Remote
1+
# Check
22

3-
The remote command uses exactly the same configs as `check`, but executes requests from the APId cloud. This allows you to test your API from around the world. Remote will run all the transactions defined in `apid.yaml` in the current directory or optionally take a path to the config via the `-c` or `--config` flag. To get familiar with the syntax of a config file, see [Reference](../reference/README.md)
3+
The cloud check command uses exactly the same configs as `check`, but executes requests from the APId cloud. This allows you to test your API from around the world. Remote will run all the transactions defined in `apid.yaml` in the current directory or optionally take a path to the config via the `-c` or `--config` flag. To get familiar with the syntax of a config file, see [Reference](../reference/README.md)
44

55
# Details
66

7-
Remote takes all the transactions that you have specified in the yaml. The steps in each transaction are executed sequentially. If a step fails, then the whole transaction is aborted and the rest of the steps are ignored. Each step is executed on a remote server, in a location specified via the command line flags. If a transaction fails, this will be reported in the console and the next transaction will be started.
7+
Check takes all the transactions that you have specified in the yaml. The steps in each transaction are executed sequentially. If a step fails, then the whole transaction is aborted and the rest of the steps are ignored. Each step is executed on a remote server, in a location specified via the command line flags. If a transaction fails, this will be reported in the console and the next transaction will be started.
88

99
## Flags
1010

@@ -18,7 +18,7 @@ Remote takes all the transactions that you have specified in the yaml. The steps
1818
# Examples
1919

2020
```bash
21-
apid remote --key <access-key>
22-
apid remote --config ./tests/e2e/apid.yaml --key <access-key>
23-
apid remote --config ./tests/e2e/apid.yaml --key <access-key> --region washington
21+
apid cloud check --key <access-key>
22+
apid cloud check --config ./tests/e2e/apid.yaml --key <access-key>
23+
apid cloud check --config ./tests/e2e/apid.yaml --key <access-key> --region washington
2424
```

docs/cloud/remote.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ In order to use the power of the cloud you will need a personal access key. To g
1717

1818
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).
1919

20-
A reference on how use the CLI after installation for remote execution can be found [here](../cli/remote.md).
20+
A reference on how use the CLI after installation for remote execution can be found [here](../cli/cloud/check.md).
2121

2222
## Timeouts
2323

Lines changed: 16 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package cmd
1+
package cloud
22

33
import (
44
"fmt"
@@ -16,41 +16,36 @@ import (
1616
"github.com/spf13/cobra"
1717
)
1818

19-
const (
20-
apiKeyEnvKey = "APID_KEY"
21-
)
22-
2319
var (
24-
apiKey = ""
25-
region = ""
20+
region = ""
21+
showTimings = false
2622
)
2723

28-
var remoteCmd = &cobra.Command{
29-
Use: "remote",
24+
var checkCmd = &cobra.Command{
25+
Use: "check",
3026
Short: "Executes a config on apid remote infrastructure",
3127
Long: `Loads either a config file, or if a directory is provided it
3228
recursively loads all .yaml files and executes them. It will run all the
3329
transactions in you config, verify the responses, and record the time it
3430
took to action each request. Runs all steps in each transaction on a
35-
public cloud infrastructure.`,
31+
public cloud infrastructure. See https://docs.getapid.com for more inforamtion`,
3632
Example: `
37-
apid remote --key <apid access key>
38-
apid remote --config my-api.yaml --key <apid access key> --region us-east
39-
apid remote -c ./e2e-tests/ -k <apid access key>
40-
apid remote -c ./e2e-tests/ -k <apid access key> -r us-east`,
33+
apid cloud check --key <apid access key>
34+
apid cloud check --config my-api.yaml --key <apid access key> --region dublin
35+
apid cloud check -c ./e2e-tests/ -k <apid access key>
36+
apid cloud check -c ./e2e-tests/ -k <apid access key> -r dublin`,
4137
Args: cobra.NoArgs,
42-
RunE: remoteRun,
38+
RunE: remoteCheck,
4339
}
4440

4541
func init() {
46-
rootCmd.AddCommand(remoteCmd)
47-
remoteCmd.Flags().StringVarP(&configFilepath, "config", "c", "./apid.yaml", "file with config to run")
48-
remoteCmd.Flags().BoolVarP(&showTimings, "timings", "t", false, "output the durations of requests")
49-
remoteCmd.Flags().StringVarP(&apiKey, "key", "k", os.Getenv(apiKeyEnvKey), "apid access key")
50-
remoteCmd.Flags().StringVarP(&region, "region", "r", "washington", "location to run the tests from")
42+
RootCommand.AddCommand(checkCmd)
43+
checkCmd.Flags().StringVarP(&configFilepath, "config", "c", "./apid.yaml", "file with config to run")
44+
checkCmd.Flags().BoolVarP(&showTimings, "timings", "t", false, "output the durations of requests")
45+
checkCmd.Flags().StringVarP(&region, "region", "r", "washington", "location to run the tests from")
5146
}
5247

53-
func remoteRun(cmd *cobra.Command, args []string) error {
48+
func remoteCheck(cmd *cobra.Command, args []string) error {
5449
c, err := config.Load(configFilepath)
5550
if err != nil {
5651
return fmt.Errorf("could not load config file: %v", err)

0 commit comments

Comments
 (0)