Skip to content
Open
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
259 changes: 257 additions & 2 deletions .generator/schemas/v2/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1335,6 +1335,15 @@ components:
example: "a1b2c3d4-e5f6-7890-abcd-ef0123456789"
format: uuid
type: string
OrgGroupMembershipDeleteFilterOrgGroupId:
description: The ID of the org group the memberships belong to.
in: query
name: filter[org_group_id]
required: true
schema:
example: "a1b2c3d4-e5f6-7890-abcd-ef0123456789"
format: uuid
type: string
OrgGroupMembershipFilterOrgGroupId:
description: Filter memberships by org group ID. Required when `filter[org_uuid]` is not provided.
in: query
Expand Down Expand Up @@ -89902,14 +89911,47 @@ components:
- created_at
- modified_at
type: object
OrgGroupMembershipBulkDeleteRequest:
description: Request to delete a batch of org group memberships.
properties:
data:
description: >-
The memberships to delete, as membership resource identifiers. Between 1 and 100 unique membership IDs per request.
items:
$ref: "#/components/schemas/OrgGroupMembershipBulkDeleteRequestData"
maxItems: 100
minItems: 1
type: array
uniqueItems: true
required:
- data
type: object
OrgGroupMembershipBulkDeleteRequestData:
description: A resource identifier for an org group membership to delete.
properties:
id:
description: The ID of the org group membership.
example: "f1e2d3c4-b5a6-7890-1234-567890abcdef"
format: uuid
type: string
type:
$ref: "#/components/schemas/OrgGroupMembershipType"
required:
- id
- type
type: object
OrgGroupMembershipBulkUpdateAttributes:
description: Attributes for bulk updating org group memberships.
properties:
orgs:
description: List of organizations to move. Maximum 100 per request.
description: >-
List of organizations to move. Between 1 and 100 per request. Each `org_uuid` and `org_site` pair must be unique.
items:
$ref: "#/components/schemas/GlobalOrgIdentifier"
maxItems: 100
minItems: 1
type: array
uniqueItems: true
required:
- orgs
type: object
Expand Down Expand Up @@ -89954,6 +89996,51 @@ components:
type: string
x-enum-varnames:
- ORG_GROUP_MEMBERSHIP_BULK_UPDATES
OrgGroupMembershipCreateAttributes:
description: Attributes for adding organizations to an org group.
properties:
orgs:
description: >-
List of organizations to add. Between 1 and 100 per request. Each `org_uuid` and `org_site` pair must be unique.
items:
$ref: "#/components/schemas/GlobalOrgIdentifier"
maxItems: 100
minItems: 1
type: array
uniqueItems: true
required:
- orgs
type: object
OrgGroupMembershipCreateData:
description: Data for adding organizations to an org group.
properties:
attributes:
$ref: "#/components/schemas/OrgGroupMembershipCreateAttributes"
relationships:
$ref: "#/components/schemas/OrgGroupMembershipCreateRelationships"
type:
$ref: "#/components/schemas/OrgGroupMembershipType"
required:
- type
- attributes
- relationships
type: object
OrgGroupMembershipCreateRelationships:
description: Relationships for adding organizations to an org group.
properties:
org_group:
$ref: "#/components/schemas/OrgGroupRelationshipToOne"
required:
- org_group
type: object
OrgGroupMembershipCreateRequest:
description: Request to add organizations to an org group.
properties:
data:
$ref: "#/components/schemas/OrgGroupMembershipCreateData"
required:
- data
type: object
OrgGroupMembershipData:
description: An org group membership resource.
properties:
Expand Down Expand Up @@ -202622,10 +202709,72 @@ paths:
x-unstable: |-
**Note**: This endpoint is in preview and is subject to change.
If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/).
post:
description: >-
Add a batch of organizations to an existing org group. This is an atomic operation: either all organizations are added or none are. Between 1 and 100 organizations may be provided per request. Each organization must be identified by a unique `org_uuid` and `org_site` pair, and must be in the same site as the requesting organization. The requesting organization must own the org group.
operationId: CreateOrgGroupMemberships
requestBody:
content:
application/json:
examples:
default:
value:
data:
attributes:
orgs:
- org_site: "us1"
org_uuid: "c3d4e5f6-a7b8-9012-cdef-012345678901"
relationships:
org_group:
data:
id: "a1b2c3d4-e5f6-7890-abcd-ef0123456789"
type: org_groups
type: org_group_memberships
schema:
$ref: "#/components/schemas/OrgGroupMembershipCreateRequest"
required: true
responses:
"201":
description: Created
"400":
content:
application/json:
schema:
$ref: "#/components/schemas/JSONAPIErrorResponse"
description: Bad Request
"401":
content:
application/json:
schema:
$ref: "#/components/schemas/JSONAPIErrorResponse"
description: Unauthorized
"403":
content:
application/json:
schema:
$ref: "#/components/schemas/JSONAPIErrorResponse"
description: Forbidden
"404":
content:
application/json:
schema:
$ref: "#/components/schemas/JSONAPIErrorResponse"
description: Not Found
"429":
$ref: "#/components/responses/TooManyRequestsResponse"
summary: Create org group memberships
tags: [Org Groups]
"x-permission":
operator: OR
permissions:
- org_group_write
x-unstable: |-
**Note**: This endpoint is in preview and is subject to change.
If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/).
/api/v2/org_group_memberships/bulk:
patch:
description: >-
Move a batch of organizations from one org group to another. This is an atomic operation. Maximum 100 orgs per request.
Move a batch of organizations from one org group to another. This is an atomic operation. Between 1 and 100 organizations may be provided per request. Each organization must be identified by a unique `org_uuid` and `org_site` pair, and must be in the same site as the requesting organization.
operationId: BulkUpdateOrgGroupMemberships
requestBody:
content:
Expand Down Expand Up @@ -202710,7 +202859,113 @@ paths:
x-unstable: |-
**Note**: This endpoint is in preview and is subject to change.
If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/).
/api/v2/org_group_memberships/bulk_delete:
post:
description: >-
Delete a batch of memberships from an org group. The memberships to delete are provided as membership resource identifiers, and the org group they belong to must be provided with `filter[org_group_id]`. Between 1 and 100 unique membership IDs may be provided per request, and the requesting organization must own the org group. Membership IDs that were already deleted, do not exist, or do not belong to the org group do not cause the request to fail.
operationId: BulkDeleteOrgGroupMemberships
parameters:
- $ref: "#/components/parameters/OrgGroupMembershipDeleteFilterOrgGroupId"
requestBody:
content:
application/json:
examples:
default:
value:
data:
- id: "f1e2d3c4-b5a6-7890-1234-567890abcdef"
type: org_group_memberships
- id: "e2d3c4b5-a6f7-8901-2345-67890abcdef1"
type: org_group_memberships
- id: "d3c4b5a6-f7e8-9012-3456-7890abcdef12"
type: org_group_memberships
schema:
$ref: "#/components/schemas/OrgGroupMembershipBulkDeleteRequest"
required: true
responses:
"204":
description: No Content
"400":
content:
application/json:
schema:
$ref: "#/components/schemas/JSONAPIErrorResponse"
description: Bad Request
"401":
content:
application/json:
schema:
$ref: "#/components/schemas/JSONAPIErrorResponse"
description: Unauthorized
"403":
content:
application/json:
schema:
$ref: "#/components/schemas/JSONAPIErrorResponse"
description: Forbidden
"404":
content:
application/json:
schema:
$ref: "#/components/schemas/JSONAPIErrorResponse"
description: Not Found
"429":
$ref: "#/components/responses/TooManyRequestsResponse"
summary: Bulk delete org group memberships
tags: [Org Groups]
"x-permission":
operator: OR
permissions:
- org_group_write
x-unstable: |-
**Note**: This endpoint is in preview and is subject to change.
If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/).
/api/v2/org_group_memberships/{org_group_membership_id}:
delete:
description: >-
Remove an organization from an org group by deleting its membership. The org group the membership belongs to must be provided with `filter[org_group_id]`, and the requesting organization must own that org group. Returns `404` if the membership does not exist, was already removed, or does not belong to the org group.
operationId: DeleteOrgGroupMembership
parameters:
- $ref: "#/components/parameters/OrgGroupMembershipId"
- $ref: "#/components/parameters/OrgGroupMembershipDeleteFilterOrgGroupId"
responses:
"204":
description: No Content
"400":
content:
application/json:
schema:
$ref: "#/components/schemas/JSONAPIErrorResponse"
description: Bad Request
"401":
content:
application/json:
schema:
$ref: "#/components/schemas/JSONAPIErrorResponse"
description: Unauthorized
"403":
content:
application/json:
schema:
$ref: "#/components/schemas/JSONAPIErrorResponse"
description: Forbidden
"404":
content:
application/json:
schema:
$ref: "#/components/schemas/JSONAPIErrorResponse"
description: Not Found
"429":
$ref: "#/components/responses/TooManyRequestsResponse"
summary: Delete an org group membership
tags: [Org Groups]
"x-permission":
operator: OR
permissions:
- org_group_write
x-unstable: |-
**Note**: This endpoint is in preview and is subject to change.
If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/).
get:
description: Get a specific organization group membership by its ID.
operationId: GetOrgGroupMembership
Expand Down
36 changes: 36 additions & 0 deletions examples/v2/org-groups/BulkDeleteOrgGroupMemberships.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
/**
* Bulk delete org group memberships returns "No Content" response
*/

import { client, v2 } from "@datadog/datadog-api-client";

const configuration = client.createConfiguration({
authMethods: {
AuthZ: {
accessToken: process.env.DD_BEARER_TOKEN as string,
},
},
});
configuration.unstableOperations["v2.bulkDeleteOrgGroupMemberships"] = true;
const apiInstance = new v2.OrgGroupsApi(configuration);

const params: v2.OrgGroupsApiBulkDeleteOrgGroupMembershipsRequest = {
body: {
data: [
{
id: "f1e2d3c4-b5a6-7890-1234-567890abcdef",
type: "org_group_memberships",
},
],
},
filterOrgGroupId: "a1b2c3d4-e5f6-7890-abcd-ef0123456789",
};

apiInstance
.bulkDeleteOrgGroupMemberships(params)
.then((data: any) => {
console.log(
"API called successfully. Returned data: " + JSON.stringify(data)
);
})
.catch((error: any) => console.error(error));
48 changes: 48 additions & 0 deletions examples/v2/org-groups/CreateOrgGroupMemberships.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
/**
* Create org group memberships returns "Created" response
*/

import { client, v2 } from "@datadog/datadog-api-client";

const configuration = client.createConfiguration({
authMethods: {
AuthZ: {
accessToken: process.env.DD_BEARER_TOKEN as string,
},
},
});
configuration.unstableOperations["v2.createOrgGroupMemberships"] = true;
const apiInstance = new v2.OrgGroupsApi(configuration);

const params: v2.OrgGroupsApiCreateOrgGroupMembershipsRequest = {
body: {
data: {
attributes: {
orgs: [
{
orgSite: "us1",
orgUuid: "c3d4e5f6-a7b8-9012-cdef-012345678901",
},
],
},
relationships: {
orgGroup: {
data: {
id: "a1b2c3d4-e5f6-7890-abcd-ef0123456789",
type: "org_groups",
},
},
},
type: "org_group_memberships",
},
},
};

apiInstance
.createOrgGroupMemberships(params)
.then((data: any) => {
console.log(
"API called successfully. Returned data: " + JSON.stringify(data)
);
})
.catch((error: any) => console.error(error));
Loading
Loading