Skip to content

Commit

Permalink
Provide consistent interface for Synthetics Tests API (#103)
Browse files Browse the repository at this point in the history
* Provide consistent interface for Synthetics Tests API

GetTestResults() and GetTestTrace() methods will be implemented in next
PR.

Issue: KNTK-399
  • Loading branch information
Daniel Furman authored Jun 28, 2022
1 parent d23c437 commit f7e48af
Show file tree
Hide file tree
Showing 13 changed files with 3,737 additions and 124 deletions.
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,14 +26,16 @@ Usage examples are placed in the [examples](./examples) directory. Note that exa

### Running examples

Note that examples are run against production Kentik API server, so Kentik production resources might be modified.

Run an example:

```bash
export KTAPI_AUTH_EMAIL=<Kentik API authentication email>
export KTAPI_AUTH_TOKEN=<Kentik API authentication token>

# Run from a Go module, e.g. the root of this repository
# Adjust -run parameter to filter example names
# Adjust -run parameter to filter example names, e.g. "Users", "Synthetics", "SyntheticsTestsAPI"
go test -tags examples -count 1 -parallel 1 -v -run Users github.com/kentik/community_sdk_golang/examples
```

Expand Down
7 changes: 6 additions & 1 deletion examples/cloud_export_example_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,12 @@ func demonstrateCloudAPIWithAWSExport() error {
fmt.Println("Got all cloud exports:")
PrettyPrint(getAllResp.Exports)
fmt.Println("Number of cloud exports:", len(getAllResp.Exports))
fmt.Println("Invalid cloud exports count:", getAllResp.InvalidExportsCount)
if getAllResp.InvalidExportsCount > 0 {
fmt.Printf(
"Kentik API returned %v invalid cloud exports. Please, contact Kentik support.\n",
getAllResp.InvalidExportsCount,
)
}

fmt.Println("### Creating AWS cloud export")
ce := cloud.NewAWSExport(cloud.AWSExportRequiredFields{
Expand Down
Loading

0 comments on commit f7e48af

Please sign in to comment.