Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Provide consistent interface for Synthetics Tests API #103

Merged
merged 14 commits into from
Jun 28, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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