godo.Insights.TestLogExportDestinationConfig()

Generated on 1 Dec 2026 from godo version v1.248.0

Usage

client.Insights.TestLogExportDestinationConfig(ctx context.Context, config *godo.InsightsLogExportDestinationConfig) (*godo.InsightsLogExportTestResult, *godo.Response, error)

Description

TestLogExportDestinationConfig sends one test payload to a destination that has not been created yet, using the endpoint and headers in config without storing them. A successful test does not guarantee CreateLogExportDestination will succeed: the name, the destination limit, and endpoint uniqueness are not checked. A failed delivery returns HTTP 200 with Err nil; check InsightsLogExportTestResult.Success. The call is rate limited per team (429).

This method sends a POST request to /v2/insights/log-export/destinations/test.

Parameters

config *godo.InsightsLogExportDestinationConfig required

Fields of godo.InsightsLogExportDestinationConfig

InsightsLogExportDestinationConfig is a destination configuration to test before the destination is created. Only Endpoint and Headers are used; Name and Enabled are accepted and ignored.

Name string

Omitted from JSON when empty. JSON key: name

Endpoint string

JSON key: endpoint

Headers []godo.InsightsLogExportHeader

Omitted from JSON when empty. JSON key: headers

Enabled *bool

Omitted from JSON when empty. JSON key: enabled

Returns

*godo.InsightsLogExportTestResult
*godo.Response

The HTTP response, with pagination Links, Meta, and Rate limit information.

error

Non-nil when the request fails. API errors are returned as *godo.ErrorResponse.

Fields of godo.InsightsLogExportTestResult

InsightsLogExportTestResult is the result of sending a test payload to a destination.

A failed delivery returns HTTP 200 with Err nil. Check Success (absent in JSON means false) and Error. The endpoint is rate limited per team and may return 429.

Success bool

Success reports whether the destination accepted the test payload.
The gateway may omit false; treat a missing value as false.

JSON key: success

Error *godo.InsightsLogExportDeliveryError

Error is set only when Success is false.

Omitted from JSON when empty. JSON key: error

Request Sample

Show Request Sample
package main

import (
	"context"
	"fmt"
	"log"
	"os"

	"github.com/digitalocean/godo"
)

func main() {
	client := godo.NewFromToken(os.Getenv("DIGITALOCEAN_TOKEN"))
	ctx := context.TODO()

	result, _, err := client.Insights.TestLogExportDestinationConfig(ctx, &godo.InsightsLogExportDestinationConfig{
		Endpoint: "<your-endpoint>",
	})
	if err != nil {
		log.Fatal(err)
	}
	fmt.Printf("%+v\n", result)
}

Response Example

Show Response Example
{
  "success": true
}

More Information

See POST /v2/insights/log-export/destinations/test in the API reference for additional detail on responses, headers, parameters, and more.

See the Go package documentation for the source of this method.

We can't find any results for your search.

Try using different keywords or simplifying your search terms.