測試遙測目的地
POST/v1/organizations/telemetry_destinations/{destination_id}/test
將一個名為 anthropic.test 的測試 span 連同已註冊的標頭傳送至目的地,僅傳送一次且不重試,並回報目的地的回應。無論目的地是否以 2xx 狀態回應,回應皆為 200:其 result 的類型為 success,或類型為 failure 並在 error 中附上原因。目的地的設定、state 與 delivery_health 不會變更。已停用的目的地也可以測試。對同一目的地的兩次測試之間請等待 10 秒;過早送出的請求可能會收到狀態 429。
Parameters
Returns
測試遙測目的地
package main
import (
"context"
"fmt"
"github.com/anthropics/anthropic-sdk-go"
"github.com/anthropics/anthropic-sdk-go/option"
)
func main() {
client := anthropic.NewClient(
option.WithAPIKey("my-anthropic-api-key"),
)
betaTelemetryDestinationTestResponse, err := client.Beta.Organization.TelemetryDestinations.Test(
context.TODO(),
"destination_id",
anthropic.BetaOrganizationTelemetryDestinationTestParams{},
)
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", betaTelemetryDestinationTestResponse.Result)
}Response 200
{
"result": {
"type": "success"
},
"type": "telemetry_destination_test"
}Returns Examples
Response 200
{
"result": {
"type": "success"
},
"type": "telemetry_destination_test"
}