Skip to content
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