Skip to content

Commit 902864d

Browse files
author
ci.datadog-api-spec
committed
Regenerate client from commit 7ac842c of spec repo
1 parent fe90940 commit 902864d

13 files changed

Lines changed: 1386 additions & 47 deletions

File tree

.generator/schemas/v2/openapi.yaml

Lines changed: 154 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82113,6 +82113,77 @@ components:
8211382113
description: The title of the event.
8211482114
example: "The event title"
8211582115
type: string
82116+
ValidateAPIKeyResponse:
82117+
description: Response object for the API and application key validation status check.
82118+
properties:
82119+
status:
82120+
$ref: "#/components/schemas/ValidateAPIKeyStatus"
82121+
required:
82122+
- status
82123+
type: object
82124+
ValidateAPIKeyStatus:
82125+
description: Status of the validation. Always `ok` when both the API key and the application key are valid.
82126+
enum:
82127+
- ok
82128+
example: ok
82129+
type: string
82130+
x-enum-varnames:
82131+
- OK
82132+
ValidateV2Attributes:
82133+
description: Attributes of the API key validation response.
82134+
properties:
82135+
api_key_id:
82136+
description: The UUID of the API key.
82137+
example: "a1b2c3d4-e5f6-47a8-b9c0-d1e2f3a4b5c6"
82138+
type: string
82139+
api_key_scopes:
82140+
description: List of scope names associated with the API key.
82141+
example:
82142+
- "remote_config_read"
82143+
items:
82144+
type: string
82145+
type: array
82146+
valid:
82147+
description: Whether the API key is valid.
82148+
example: true
82149+
type: boolean
82150+
required:
82151+
- valid
82152+
- api_key_scopes
82153+
- api_key_id
82154+
type: object
82155+
ValidateV2Data:
82156+
description: Data object containing the API key validation result.
82157+
properties:
82158+
attributes:
82159+
$ref: "#/components/schemas/ValidateV2Attributes"
82160+
id:
82161+
description: The UUID of the organization associated with the API key.
82162+
example: "550e8400-e29b-41d4-a716-446655440000"
82163+
type: string
82164+
type:
82165+
$ref: "#/components/schemas/ValidateV2Type"
82166+
required:
82167+
- id
82168+
- type
82169+
- attributes
82170+
type: object
82171+
ValidateV2Response:
82172+
description: Response for the API key validation endpoint.
82173+
properties:
82174+
data:
82175+
$ref: "#/components/schemas/ValidateV2Data"
82176+
required:
82177+
- data
82178+
type: object
82179+
ValidateV2Type:
82180+
description: Resource type for the API key validation response.
82181+
enum:
82182+
- validate_v2
82183+
example: validate_v2
82184+
type: string
82185+
x-enum-varnames:
82186+
- ValidateV2
8211682187
ValidationError:
8211782188
description: Represents a single validation error, including a human-readable title and metadata.
8211882189
properties:
@@ -144598,6 +144669,89 @@ paths:
144598144669
operator: OR
144599144670
permissions:
144600144671
- teams_read
144672+
/api/v2/validate:
144673+
get:
144674+
description: Check if the API key is valid. Returns the organization UUID, API key ID, and associated scopes.
144675+
operationId: Validate
144676+
responses:
144677+
"200":
144678+
content:
144679+
application/json:
144680+
examples:
144681+
default:
144682+
value:
144683+
data:
144684+
attributes:
144685+
api_key_id: "a1b2c3d4-e5f6-47a8-b9c0-d1e2f3a4b5c6"
144686+
api_key_scopes:
144687+
- "remote_config_read"
144688+
valid: true
144689+
id: "550e8400-e29b-41d4-a716-446655440000"
144690+
type: "validate_v2"
144691+
schema:
144692+
$ref: "#/components/schemas/ValidateV2Response"
144693+
description: OK
144694+
"403":
144695+
content:
144696+
application/json:
144697+
schema:
144698+
$ref: "#/components/schemas/JSONAPIErrorResponse"
144699+
description: Forbidden
144700+
"429":
144701+
$ref: "#/components/responses/TooManyRequestsResponse"
144702+
security:
144703+
- apiKeyAuth: []
144704+
summary: Validate API key
144705+
tags:
144706+
- Key Management
144707+
"x-permission":
144708+
operator: OPEN
144709+
permissions: []
144710+
x-unstable: |-
144711+
**Note**: This endpoint is in preview and is subject to change.
144712+
If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/).
144713+
/api/v2/validate_keys:
144714+
get:
144715+
description: |-
144716+
Check that the API key and application key used for the request are both valid.
144717+
Returns `{"status": "ok"}` on success, `401` or `403` otherwise. Useful as a
144718+
lightweight authentication probe before issuing other API calls that require
144719+
full credentials.
144720+
operationId: ValidateAPIKey
144721+
responses:
144722+
"200":
144723+
content:
144724+
application/json:
144725+
examples:
144726+
default:
144727+
value:
144728+
status: ok
144729+
schema:
144730+
$ref: "#/components/schemas/ValidateAPIKeyResponse"
144731+
description: OK
144732+
"401":
144733+
content:
144734+
application/json:
144735+
schema:
144736+
$ref: "#/components/schemas/APIErrorResponse"
144737+
description: Unauthorized
144738+
"403":
144739+
content:
144740+
application/json:
144741+
schema:
144742+
$ref: "#/components/schemas/APIErrorResponse"
144743+
description: Forbidden
144744+
"429":
144745+
$ref: "#/components/responses/TooManyRequestsResponse"
144746+
security:
144747+
- apiKeyAuth: []
144748+
appKeyAuth: []
144749+
summary: Validate API and application keys
144750+
tags:
144751+
- Key Management
144752+
"x-permission":
144753+
operator: OPEN
144754+
permissions: []
144601144755
/api/v2/web-integrations/{integration_name}/accounts:
144602144756
get:
144603144757
description: List accounts for a given web integration.
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
// Validate API key returns "OK" response
2+
3+
import com.datadog.api.client.ApiClient;
4+
import com.datadog.api.client.ApiException;
5+
import com.datadog.api.client.v2.api.KeyManagementApi;
6+
import com.datadog.api.client.v2.model.ValidateV2Response;
7+
8+
public class Example {
9+
public static void main(String[] args) {
10+
ApiClient defaultClient = ApiClient.getDefaultApiClient();
11+
defaultClient.setUnstableOperationEnabled("v2.validate", true);
12+
KeyManagementApi apiInstance = new KeyManagementApi(defaultClient);
13+
14+
try {
15+
ValidateV2Response result = apiInstance.validate();
16+
System.out.println(result);
17+
} catch (ApiException e) {
18+
System.err.println("Exception when calling KeyManagementApi#validate");
19+
System.err.println("Status code: " + e.getCode());
20+
System.err.println("Reason: " + e.getResponseBody());
21+
System.err.println("Response headers: " + e.getResponseHeaders());
22+
e.printStackTrace();
23+
}
24+
}
25+
}
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
// Validate API and application keys returns "OK" response
2+
3+
import com.datadog.api.client.ApiClient;
4+
import com.datadog.api.client.ApiException;
5+
import com.datadog.api.client.v2.api.KeyManagementApi;
6+
import com.datadog.api.client.v2.model.ValidateAPIKeyResponse;
7+
8+
public class Example {
9+
public static void main(String[] args) {
10+
ApiClient defaultClient = ApiClient.getDefaultApiClient();
11+
KeyManagementApi apiInstance = new KeyManagementApi(defaultClient);
12+
13+
try {
14+
ValidateAPIKeyResponse result = apiInstance.validateAPIKey();
15+
System.out.println(result);
16+
} catch (ApiException e) {
17+
System.err.println("Exception when calling KeyManagementApi#validateAPIKey");
18+
System.err.println("Status code: " + e.getCode());
19+
System.err.println("Reason: " + e.getResponseBody());
20+
System.err.println("Response headers: " + e.getResponseHeaders());
21+
e.printStackTrace();
22+
}
23+
}
24+
}

src/main/java/com/datadog/api/client/ApiClient.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -803,6 +803,7 @@ public class ApiClient {
803803
put("v2.updateLLMObsExperiment", false);
804804
put("v2.updateLLMObsProject", false);
805805
put("v2.anonymizeUsers", false);
806+
put("v2.validate", false);
806807
put("v2.createOpenAPI", false);
807808
put("v2.deleteOpenAPI", false);
808809
put("v2.getOpenAPI", false);

0 commit comments

Comments
 (0)