Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
250 changes: 249 additions & 1 deletion .generator/schemas/v2/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -868,6 +868,40 @@ components:
schema:
format: uuid
type: string
IncidentResponderIncludeQueryParameter:
description: Comma-separated related resource types to include. Supported values are `users` and `role_assignments`.
explode: false
in: query
name: include
required: false
schema:
example:
- users
- role_assignments
items:
$ref: "#/components/schemas/IncidentResponderRelatedObject"
type: array
style: form
IncidentResponderPageLimitParameter:
description: Maximum number of responders to return per page.
in: query
name: page[limit]
required: false
schema:
default: 25
example: 25
format: int64
maximum: 1000
type: integer
IncidentResponderPageOffsetParameter:
description: The offset of the first responder to return.
in: query
name: page[offset]
required: false
schema:
example: 0
format: int64
type: integer
IncidentRuleIDPathParameter:
description: The UUID of the incident rule.
in: path
Expand Down Expand Up @@ -63016,6 +63050,20 @@ components:
- type
- attributes
type: object
IncidentResponderIncludedItem:
description: A user or role assignment related to an incident responder.
oneOf:
- $ref: "#/components/schemas/IncidentUserData"
- $ref: "#/components/schemas/IncidentRoleAssignmentDataResponse"
IncidentResponderRelatedObject:
description: Object related to an incident responder.
enum:
- users
- role_assignments
type: string
x-enum-varnames:
- USERS
- ROLE_ASSIGNMENTS
IncidentResponderRelationships:
description: Relationships for an incident responder.
properties:
Expand Down Expand Up @@ -63115,6 +63163,53 @@ components:
- id
- type
type: object
IncidentRespondersPagination:
description: Offset-based pagination for incident responders.
properties:
first_offset:
description: The offset of the first page.
example: 0
format: int64
type: integer
last_offset:
description: The offset of the last page, if available.
example: 25
format: int64
nullable: true
type: integer
limit:
description: The maximum number of elements returned per page.
example: 25
format: int64
type: integer
next_offset:
description: The offset of the next page, if available.
example: 25
format: int64
nullable: true
type: integer
offset:
description: The index of the first element in the current page.
example: 0
format: int64
type: integer
prev_offset:
description: The offset of the previous page, if available.
example: 0
format: int64
nullable: true
type: integer
total:
description: The total number of elements, when available.
example: 1
format: int64
nullable: true
type: integer
type:
description: The pagination type.
example: offset_limit
type: string
type: object
IncidentRespondersResponse:
description: Response with a list of incident responders.
properties:
Expand All @@ -63126,12 +63221,38 @@ components:
included:
description: Included related resources.
items:
$ref: "#/components/schemas/IncidentUserData"
$ref: "#/components/schemas/IncidentResponderIncludedItem"
readOnly: true
type: array
links:
additionalProperties:
type: string
description: Links to pages of incident responders.
type: object
meta:
$ref: "#/components/schemas/IncidentRespondersResponseMeta"
required:
- data
type: object
IncidentRespondersResponseMeta:
description: Pagination metadata for the responder list.
properties:
page:
$ref: "#/components/schemas/IncidentRespondersResponseMetaPage"
pagination:
$ref: "#/components/schemas/IncidentRespondersPagination"
type: object
IncidentRespondersResponseMetaPage:
description: Total count for the responder list.
properties:
total_filtered_count:
description: Total number of responders matching the query, before pagination.
example: 1
format: int64
type: integer
required:
- total_filtered_count
type: object
IncidentRespondersType:
description: The incident responders type.
enum:
Expand Down Expand Up @@ -63358,6 +63479,8 @@ components:
$ref: "#/components/schemas/RelationshipToUser"
impacts:
$ref: "#/components/schemas/RelationshipToIncidentImpacts"
incident_type:
$ref: "#/components/schemas/RelationshipToIncidentType"
integrations:
$ref: "#/components/schemas/RelationshipToIncidentIntegrationMetadatas"
last_modified_by_user:
Expand All @@ -63367,6 +63490,128 @@ components:
user_defined_fields:
$ref: "#/components/schemas/RelationshipToIncidentUserDefinedFields"
type: object
IncidentRoleAssignmentDataAttributesResponse:
description: Attributes of an incident role assignment.
properties:
created:
description: Timestamp when the role assignment was created.
example: "2024-01-01T00:00:00.000Z"
format: date-time
type: string
deleted:
description: Timestamp when the role assignment was deleted, or the zero timestamp if it has not been deleted.
example: "0001-01-01T00:00:00Z"
format: date-time
type: string
modified:
description: Timestamp when the role assignment was last modified.
example: "2024-01-01T00:00:00.000Z"
format: date-time
type: string
responder_type:
description: The type of the responder.
example: user
type: string
role:
description: The name of the assigned role.
example: commander
type: string
required:
- role
- responder_type
- created
- modified
type: object
IncidentRoleAssignmentDataResponse:
description: Role assignment data in a response.
properties:
attributes:
$ref: "#/components/schemas/IncidentRoleAssignmentDataAttributesResponse"
id:
description: The role assignment identifier.
example: 00000000-0000-0000-0000-000000000000
format: uuid
type: string
relationships:
$ref: "#/components/schemas/IncidentRoleAssignmentRelationshipsResponse"
type:
$ref: "#/components/schemas/IncidentRoleAssignmentType"
required:
- id
- type
- attributes
type: object
IncidentRoleAssignmentRelationshipsResponse:
description: Relationships of a role assignment.
properties:
created_by_user:
$ref: "#/components/schemas/IncidentRoleAssignmentResponderRelationship"
last_modified_by_user:
$ref: "#/components/schemas/IncidentRoleAssignmentResponderRelationship"
reserved_role:
$ref: "#/components/schemas/IncidentRoleAssignmentRoleRelationship"
responder:
$ref: "#/components/schemas/IncidentRoleAssignmentResponderRelationship"
user_defined_role:
$ref: "#/components/schemas/IncidentRoleAssignmentRoleRelationship"
required:
- responder
type: object
IncidentRoleAssignmentResponderRelationship:
description: Relationship to a responder.
properties:
data:
$ref: "#/components/schemas/IncidentRoleAssignmentResponderRelationshipData"
required:
- data
type: object
IncidentRoleAssignmentResponderRelationshipData:
description: Responder relationship data.
properties:
id:
description: The responder identifier.
example: 00000000-0000-0000-0000-000000000000
format: uuid
type: string
type:
description: The responder resource type.
example: users
type: string
required:
- id
- type
type: object
IncidentRoleAssignmentRoleRelationship:
description: Relationship to a role.
properties:
data:
$ref: "#/components/schemas/IncidentRoleAssignmentRoleRelationshipData"
type: object
IncidentRoleAssignmentRoleRelationshipData:
description: Role relationship data.
nullable: true
properties:
id:
description: The role identifier.
example: 00000000-0000-0000-0000-000000000000
format: uuid
type: string
type:
description: The role resource type.
example: incident_reserved_roles
type: string
required:
- id
- type
type: object
IncidentRoleAssignmentType:
description: Incident role assignment resource type.
enum:
- incident_role_assignments
example: incident_role_assignments
type: string
x-enum-varnames:
- INCIDENT_ROLE_ASSIGNMENTS
IncidentRuleCondition:
description: A condition for an incident rule.
properties:
Expand Down Expand Up @@ -186122,6 +186367,9 @@ paths:
operationId: ListIncidentResponders
parameters:
- $ref: "#/components/parameters/IncidentIDPathParameter"
- $ref: "#/components/parameters/IncidentResponderIncludeQueryParameter"
- $ref: "#/components/parameters/IncidentResponderPageLimitParameter"
- $ref: "#/components/parameters/IncidentResponderPageOffsetParameter"
responses:
"200":
content:
Expand Down
49 changes: 49 additions & 0 deletions examples/v2/incidents/CreateIncidentResponder.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
// Create an incident responder returns "Created" response

import com.datadog.api.client.ApiClient;
import com.datadog.api.client.ApiException;
import com.datadog.api.client.v2.api.IncidentsApi;
import com.datadog.api.client.v2.model.IncidentResponderDataRequest;
import com.datadog.api.client.v2.model.IncidentResponderRelationshipsRequest;
import com.datadog.api.client.v2.model.IncidentResponderRequest;
import com.datadog.api.client.v2.model.IncidentResponderResponse;
import com.datadog.api.client.v2.model.IncidentResponderType;
import com.datadog.api.client.v2.model.IncidentResponderUserRelationship;
import com.datadog.api.client.v2.model.IncidentResponderUserRelationshipData;
import java.util.UUID;

public class Example {
public static void main(String[] args) {
ApiClient defaultClient = ApiClient.getDefaultApiClient();
defaultClient.setAccessToken(System.getenv("DD_BEARER_TOKEN"));
defaultClient.setUnstableOperationEnabled("v2.createIncidentResponder", true);
IncidentsApi apiInstance = new IncidentsApi(defaultClient);

IncidentResponderRequest body =
new IncidentResponderRequest()
.data(
new IncidentResponderDataRequest()
.relationships(
new IncidentResponderRelationshipsRequest()
.user(
new IncidentResponderUserRelationship()
.data(
new IncidentResponderUserRelationshipData()
.id(
UUID.fromString(
"00000000-0000-0000-0000-000000000000"))
.type("users"))))
.type(IncidentResponderType.INCIDENT_RESPONDERS));

try {
IncidentResponderResponse result = apiInstance.createIncidentResponder("incident_id", body);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling IncidentsApi#createIncidentResponder");
System.err.println("Status code: " + e.getCode());
System.err.println("Reason: " + e.getResponseBody());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}
26 changes: 26 additions & 0 deletions examples/v2/incidents/DeleteIncidentResponder.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
// Delete an incident responder returns "No Content" response

import com.datadog.api.client.ApiClient;
import com.datadog.api.client.ApiException;
import com.datadog.api.client.v2.api.IncidentsApi;
import java.util.UUID;

public class Example {
public static void main(String[] args) {
ApiClient defaultClient = ApiClient.getDefaultApiClient();
defaultClient.setAccessToken(System.getenv("DD_BEARER_TOKEN"));
defaultClient.setUnstableOperationEnabled("v2.deleteIncidentResponder", true);
IncidentsApi apiInstance = new IncidentsApi(defaultClient);

try {
apiInstance.deleteIncidentResponder(
"incident_id", UUID.fromString("9b1deb4d-3b7d-4bad-9bdd-2b0d7b3dcb6d"));
} catch (ApiException e) {
System.err.println("Exception when calling IncidentsApi#deleteIncidentResponder");
System.err.println("Status code: " + e.getCode());
System.err.println("Reason: " + e.getResponseBody());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}
Loading
Loading