Skip to content

Commit 5d5b113

Browse files
api-clients-generation-pipeline[bot]ci.datadog-api-spec
andauthored
Create OpenAPI for HAMR endpoints (#3408)
Co-authored-by: ci.datadog-api-spec <packages@datadoghq.com>
1 parent fc3f5ca commit 5d5b113

15 files changed

+2222
-0
lines changed

.generator/schemas/v2/openapi.yaml

Lines changed: 272 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25944,6 +25944,171 @@ components:
2594425944
- type
2594525945
- value
2594625946
type: object
25947+
HamrOrgConnectionAttributesRequest:
25948+
properties:
25949+
hamr_status:
25950+
$ref: '#/components/schemas/HamrOrgConnectionStatus'
25951+
is_primary:
25952+
description: 'Indicates whether this organization is the primary organization
25953+
in the HAMR relationship.
25954+
25955+
If true, this is the primary organization. If false, this is the secondary/backup
25956+
organization.'
25957+
example: true
25958+
type: boolean
25959+
modified_by:
25960+
description: Username or identifier of the user who last modified this HAMR
25961+
connection.
25962+
example: admin@example.com
25963+
type: string
25964+
target_org_datacenter:
25965+
description: Datacenter location of the target organization (e.g., us1,
25966+
eu1, us5).
25967+
example: us1
25968+
type: string
25969+
target_org_name:
25970+
description: Name of the target organization in the HAMR relationship.
25971+
example: Production Backup Org
25972+
type: string
25973+
target_org_uuid:
25974+
description: UUID of the target organization in the HAMR relationship.
25975+
example: 660f9511-f3ac-52e5-b827-557766551111
25976+
type: string
25977+
required:
25978+
- target_org_uuid
25979+
- target_org_name
25980+
- target_org_datacenter
25981+
- hamr_status
25982+
- is_primary
25983+
- modified_by
25984+
type: object
25985+
HamrOrgConnectionAttributesResponse:
25986+
properties:
25987+
hamr_status:
25988+
$ref: '#/components/schemas/HamrOrgConnectionStatus'
25989+
is_primary:
25990+
description: 'Indicates whether this organization is the primary organization
25991+
in the HAMR relationship.
25992+
25993+
If true, this is the primary organization. If false, this is the secondary/backup
25994+
organization.'
25995+
example: true
25996+
type: boolean
25997+
modified_at:
25998+
description: Timestamp of when this HAMR connection was last modified (RFC3339
25999+
format).
26000+
example: '2026-01-13T17:26:48.830968Z'
26001+
type: string
26002+
modified_by:
26003+
description: Username or identifier of the user who last modified this HAMR
26004+
connection.
26005+
example: admin@example.com
26006+
type: string
26007+
target_org_datacenter:
26008+
description: Datacenter location of the target organization (e.g., us1,
26009+
eu1, us5).
26010+
example: us1
26011+
type: string
26012+
target_org_name:
26013+
description: Name of the target organization in the HAMR relationship.
26014+
example: Production Backup Org
26015+
type: string
26016+
target_org_uuid:
26017+
description: UUID of the target organization in the HAMR relationship.
26018+
example: 660f9511-f3ac-52e5-b827-557766551111
26019+
type: string
26020+
required:
26021+
- target_org_uuid
26022+
- target_org_name
26023+
- target_org_datacenter
26024+
- hamr_status
26025+
- is_primary
26026+
- modified_at
26027+
- modified_by
26028+
type: object
26029+
HamrOrgConnectionDataRequest:
26030+
properties:
26031+
attributes:
26032+
$ref: '#/components/schemas/HamrOrgConnectionAttributesRequest'
26033+
id:
26034+
description: The organization UUID for this HAMR connection. Must match
26035+
the authenticated organization's UUID.
26036+
example: 550e8400-e29b-41d4-a716-446655440000
26037+
type: string
26038+
type:
26039+
$ref: '#/components/schemas/HamrOrgConnectionType'
26040+
required:
26041+
- id
26042+
- type
26043+
- attributes
26044+
type: object
26045+
HamrOrgConnectionDataResponse:
26046+
properties:
26047+
attributes:
26048+
$ref: '#/components/schemas/HamrOrgConnectionAttributesResponse'
26049+
id:
26050+
description: The organization UUID for this HAMR connection.
26051+
example: 550e8400-e29b-41d4-a716-446655440000
26052+
type: string
26053+
type:
26054+
$ref: '#/components/schemas/HamrOrgConnectionType'
26055+
required:
26056+
- id
26057+
- type
26058+
- attributes
26059+
type: object
26060+
HamrOrgConnectionRequest:
26061+
properties:
26062+
data:
26063+
$ref: '#/components/schemas/HamrOrgConnectionDataRequest'
26064+
required:
26065+
- data
26066+
type: object
26067+
HamrOrgConnectionResponse:
26068+
properties:
26069+
data:
26070+
$ref: '#/components/schemas/HamrOrgConnectionDataResponse'
26071+
required:
26072+
- data
26073+
type: object
26074+
HamrOrgConnectionStatus:
26075+
description: 'Status of the HAMR connection:
26076+
26077+
- 0: UNSPECIFIED - Connection status not specified
26078+
26079+
- 1: ONBOARDING - Initial setup of HAMR connection
26080+
26081+
- 2: PASSIVE - Secondary organization in passive standby mode
26082+
26083+
- 3: FAILOVER - Liminal status between PASSIVE and ACTIVE
26084+
26085+
- 4: ACTIVE - Organization is an active failover
26086+
26087+
- 5: RECOVERY - Recovery operation in progress'
26088+
enum:
26089+
- 0
26090+
- 1
26091+
- 2
26092+
- 3
26093+
- 4
26094+
- 5
26095+
example: 4
26096+
type: integer
26097+
x-enum-varnames:
26098+
- UNSPECIFIED
26099+
- ONBOARDING
26100+
- PASSIVE
26101+
- FAILOVER
26102+
- ACTIVE
26103+
- RECOVERY
26104+
HamrOrgConnectionType:
26105+
description: Type of the HAMR organization connection resource.
26106+
enum:
26107+
- hamr_org_connections
26108+
example: hamr_org_connections
26109+
type: string
26110+
x-enum-varnames:
26111+
- HAMR_ORG_CONNECTIONS
2594726112
HourlyUsage:
2594826113
description: Hourly usage for a product family for an org.
2594926114
properties:
@@ -71733,6 +71898,105 @@ paths:
7173371898
operator: OR
7173471899
permissions:
7173571900
- events_read
71901+
/api/v2/hamr:
71902+
get:
71903+
description: 'Retrieve the High Availability Multi-Region (HAMR) organization
71904+
connection details for the authenticated organization.
71905+
71906+
This endpoint returns information about the HAMR connection configuration,
71907+
including the target organization,
71908+
71909+
datacenter, status, and whether this is the primary or secondary organization
71910+
in the HAMR relationship.'
71911+
operationId: GetHamrOrgConnection
71912+
responses:
71913+
'200':
71914+
content:
71915+
application/json:
71916+
schema:
71917+
$ref: '#/components/schemas/HamrOrgConnectionResponse'
71918+
description: OK
71919+
'400':
71920+
content:
71921+
application/json:
71922+
schema:
71923+
$ref: '#/components/schemas/JSONAPIErrorResponse'
71924+
description: Bad Request
71925+
'403':
71926+
content:
71927+
application/json:
71928+
schema:
71929+
$ref: '#/components/schemas/JSONAPIErrorResponse'
71930+
description: Forbidden
71931+
'404':
71932+
content:
71933+
application/json:
71934+
schema:
71935+
$ref: '#/components/schemas/JSONAPIErrorResponse'
71936+
description: Not Found
71937+
'429':
71938+
$ref: '#/components/responses/TooManyRequestsResponse'
71939+
security:
71940+
- apiKeyAuth: []
71941+
appKeyAuth: []
71942+
summary: Get HAMR organization connection
71943+
tags:
71944+
- High Availability MultiRegion
71945+
x-unstable: '**Note**: This endpoint is in public beta and is subject to change.
71946+
71947+
If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/).'
71948+
post:
71949+
description: 'Create or update the High Availability Multi-Region (HAMR) organization
71950+
connection.
71951+
71952+
This endpoint allows you to configure the HAMR connection between the authenticated
71953+
organization
71954+
71955+
and a target organization, including setting the connection status (ONBOARDING,
71956+
PASSIVE, FAILOVER, ACTIVE, RECOVERY)'
71957+
operationId: CreateHamrOrgConnection
71958+
requestBody:
71959+
content:
71960+
application/json:
71961+
schema:
71962+
$ref: '#/components/schemas/HamrOrgConnectionRequest'
71963+
required: true
71964+
responses:
71965+
'200':
71966+
content:
71967+
application/json:
71968+
schema:
71969+
$ref: '#/components/schemas/HamrOrgConnectionResponse'
71970+
description: OK
71971+
'400':
71972+
content:
71973+
application/json:
71974+
schema:
71975+
$ref: '#/components/schemas/JSONAPIErrorResponse'
71976+
description: Bad Request
71977+
'403':
71978+
content:
71979+
application/json:
71980+
schema:
71981+
$ref: '#/components/schemas/JSONAPIErrorResponse'
71982+
description: Forbidden
71983+
'429':
71984+
$ref: '#/components/responses/TooManyRequestsResponse'
71985+
'500':
71986+
content:
71987+
application/json:
71988+
schema:
71989+
$ref: '#/components/schemas/JSONAPIErrorResponse'
71990+
description: Internal Server Error
71991+
security:
71992+
- apiKeyAuth: []
71993+
appKeyAuth: []
71994+
summary: Create or update HAMR organization connection
71995+
tags:
71996+
- High Availability MultiRegion
71997+
x-unstable: '**Note**: This endpoint is in public beta and is subject to change.
71998+
71999+
If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/).'
7173672000
/api/v2/incidents:
7173772001
get:
7173872002
description: Get all incidents for the user's organization.
@@ -94116,6 +94380,14 @@ tags:
9411694380
externalDocs:
9411794381
url: https://docs.datadoghq.com/integrations/google_cloud_platform
9411894382
name: GCP Integration
94383+
- description: 'Configure High Availability Multi-Region (HAMR) connections between
94384+
Datadog organizations.
94385+
94386+
HAMR provides disaster recovery capabilities by maintaining synchronized data
94387+
between primary
94388+
94389+
and secondary organizations across different datacenters.'
94390+
name: High Availability MultiRegion
9411994391
- description: 'The IP allowlist API is used to manage the IP addresses that
9412094392

9412194393
can access the Datadog API and web UI. It does not block
Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
// Create or update HAMR organization connection 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.HighAvailabilityMultiRegionApi;
6+
import com.datadog.api.client.v2.model.HamrOrgConnectionAttributesRequest;
7+
import com.datadog.api.client.v2.model.HamrOrgConnectionDataRequest;
8+
import com.datadog.api.client.v2.model.HamrOrgConnectionRequest;
9+
import com.datadog.api.client.v2.model.HamrOrgConnectionResponse;
10+
import com.datadog.api.client.v2.model.HamrOrgConnectionStatus;
11+
import com.datadog.api.client.v2.model.HamrOrgConnectionType;
12+
13+
public class Example {
14+
public static void main(String[] args) {
15+
ApiClient defaultClient = ApiClient.getDefaultApiClient();
16+
defaultClient.setUnstableOperationEnabled("v2.createHamrOrgConnection", true);
17+
HighAvailabilityMultiRegionApi apiInstance = new HighAvailabilityMultiRegionApi(defaultClient);
18+
19+
HamrOrgConnectionRequest body =
20+
new HamrOrgConnectionRequest()
21+
.data(
22+
new HamrOrgConnectionDataRequest()
23+
.attributes(
24+
new HamrOrgConnectionAttributesRequest()
25+
.hamrStatus(HamrOrgConnectionStatus.ACTIVE)
26+
.isPrimary(true)
27+
.modifiedBy("admin@example.com")
28+
.targetOrgDatacenter("us1")
29+
.targetOrgName("Production Backup Org")
30+
.targetOrgUuid("660f9511-f3ac-52e5-b827-557766551111"))
31+
.id("550e8400-e29b-41d4-a716-446655440000")
32+
.type(HamrOrgConnectionType.HAMR_ORG_CONNECTIONS));
33+
34+
try {
35+
HamrOrgConnectionResponse result = apiInstance.createHamrOrgConnection(body);
36+
System.out.println(result);
37+
} catch (ApiException e) {
38+
System.err.println(
39+
"Exception when calling HighAvailabilityMultiRegionApi#createHamrOrgConnection");
40+
System.err.println("Status code: " + e.getCode());
41+
System.err.println("Reason: " + e.getResponseBody());
42+
System.err.println("Response headers: " + e.getResponseHeaders());
43+
e.printStackTrace();
44+
}
45+
}
46+
}
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
// Get HAMR organization connection 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.HighAvailabilityMultiRegionApi;
6+
import com.datadog.api.client.v2.model.HamrOrgConnectionResponse;
7+
8+
public class Example {
9+
public static void main(String[] args) {
10+
ApiClient defaultClient = ApiClient.getDefaultApiClient();
11+
defaultClient.setUnstableOperationEnabled("v2.getHamrOrgConnection", true);
12+
HighAvailabilityMultiRegionApi apiInstance = new HighAvailabilityMultiRegionApi(defaultClient);
13+
14+
try {
15+
HamrOrgConnectionResponse result = apiInstance.getHamrOrgConnection();
16+
System.out.println(result);
17+
} catch (ApiException e) {
18+
System.err.println(
19+
"Exception when calling HighAvailabilityMultiRegionApi#getHamrOrgConnection");
20+
System.err.println("Status code: " + e.getCode());
21+
System.err.println("Reason: " + e.getResponseBody());
22+
System.err.println("Response headers: " + e.getResponseHeaders());
23+
e.printStackTrace();
24+
}
25+
}
26+
}

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -815,6 +815,8 @@ public class ApiClient {
815815
put("v2.getDeploymentRule", false);
816816
put("v2.updateDeploymentGate", false);
817817
put("v2.updateDeploymentRule", false);
818+
put("v2.createHamrOrgConnection", false);
819+
put("v2.getHamrOrgConnection", false);
818820
put("v2.createIncident", false);
819821
put("v2.createIncidentAttachment", false);
820822
put("v2.createIncidentIntegration", false);

0 commit comments

Comments
 (0)