測試遙測目的地
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 com.anthropic.example;
import com.anthropic.client.AnthropicClient;
import com.anthropic.client.okhttp.AnthropicOkHttpClient;
import com.anthropic.models.beta.organization.telemetrydestinations.BetaTelemetryDestinationTestResponse;
import com.anthropic.models.beta.organization.telemetrydestinations.TelemetryDestinationTestParams;
public final class Main {
private Main() {}
public static void main(String[] args) {
AnthropicClient client = AnthropicOkHttpClient.fromEnv();
BetaTelemetryDestinationTestResponse betaTelemetryDestinationTestResponse = client.beta().organization().telemetryDestinations().test("destination_id");
}
}Response 200
{
"result": {
"type": "success"
},
"type": "telemetry_destination_test"
}Returns Examples
Response 200
{
"result": {
"type": "success"
},
"type": "telemetry_destination_test"
}