Skip to content

Commit 3cecf13

Browse files
api-clients-generation-pipeline[bot]ci.datadog-api-spec
andauthored
Add Org Groups API specification (#3880)
Co-authored-by: ci.datadog-api-spec <packages@datadoghq.com>
1 parent 4f1d512 commit 3cecf13

File tree

96 files changed

+12581
-1692
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

96 files changed

+12581
-1692
lines changed

.generator/schemas/v2/openapi.yaml

Lines changed: 3969 additions & 1692 deletions
Large diffs are not rendered by default.
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
/**
2+
* Bulk update org group memberships returns "OK" response
3+
*/
4+
5+
import { client, v2 } from "@datadog/datadog-api-client";
6+
7+
const configuration = client.createConfiguration();
8+
configuration.unstableOperations["v2.bulkUpdateOrgGroupMemberships"] = true;
9+
const apiInstance = new v2.OrgGroupsApi(configuration);
10+
11+
const params: v2.OrgGroupsApiBulkUpdateOrgGroupMembershipsRequest = {
12+
body: {
13+
data: {
14+
attributes: {
15+
orgs: [
16+
{
17+
orgSite: "datadoghq.com",
18+
orgUuid: "c3d4e5f6-a7b8-9012-cdef-012345678901",
19+
},
20+
],
21+
},
22+
relationships: {
23+
sourceOrgGroup: {
24+
data: {
25+
id: "a1b2c3d4-e5f6-7890-abcd-ef0123456789",
26+
type: "org_groups",
27+
},
28+
},
29+
targetOrgGroup: {
30+
data: {
31+
id: "a1b2c3d4-e5f6-7890-abcd-ef0123456789",
32+
type: "org_groups",
33+
},
34+
},
35+
},
36+
type: "org_group_membership_bulk_updates",
37+
},
38+
},
39+
};
40+
41+
apiInstance
42+
.bulkUpdateOrgGroupMemberships(params)
43+
.then((data: v2.OrgGroupMembershipListResponse) => {
44+
console.log(
45+
"API called successfully. Returned data: " + JSON.stringify(data)
46+
);
47+
})
48+
.catch((error: any) => console.error(error));
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
/**
2+
* Create an org group returns "Created" response
3+
*/
4+
5+
import { client, v2 } from "@datadog/datadog-api-client";
6+
7+
const configuration = client.createConfiguration();
8+
configuration.unstableOperations["v2.createOrgGroup"] = true;
9+
const apiInstance = new v2.OrgGroupsApi(configuration);
10+
11+
const params: v2.OrgGroupsApiCreateOrgGroupRequest = {
12+
body: {
13+
data: {
14+
attributes: {
15+
name: "My Org Group",
16+
},
17+
type: "org_groups",
18+
},
19+
},
20+
};
21+
22+
apiInstance
23+
.createOrgGroup(params)
24+
.then((data: v2.OrgGroupResponse) => {
25+
console.log(
26+
"API called successfully. Returned data: " + JSON.stringify(data)
27+
);
28+
})
29+
.catch((error: any) => console.error(error));
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
/**
2+
* Create an org group policy returns "Created" response
3+
*/
4+
5+
import { client, v2 } from "@datadog/datadog-api-client";
6+
7+
const configuration = client.createConfiguration();
8+
configuration.unstableOperations["v2.createOrgGroupPolicy"] = true;
9+
const apiInstance = new v2.OrgGroupsApi(configuration);
10+
11+
const params: v2.OrgGroupsApiCreateOrgGroupPolicyRequest = {
12+
body: {
13+
data: {
14+
attributes: {
15+
content: {
16+
value: "UTC",
17+
},
18+
policyName: "monitor_timezone",
19+
},
20+
relationships: {
21+
orgGroup: {
22+
data: {
23+
id: "a1b2c3d4-e5f6-7890-abcd-ef0123456789",
24+
type: "org_groups",
25+
},
26+
},
27+
},
28+
type: "org_group_policies",
29+
},
30+
},
31+
};
32+
33+
apiInstance
34+
.createOrgGroupPolicy(params)
35+
.then((data: v2.OrgGroupPolicyResponse) => {
36+
console.log(
37+
"API called successfully. Returned data: " + JSON.stringify(data)
38+
);
39+
})
40+
.catch((error: any) => console.error(error));
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
/**
2+
* Create an org group policy override returns "Created" response
3+
*/
4+
5+
import { client, v2 } from "@datadog/datadog-api-client";
6+
7+
const configuration = client.createConfiguration();
8+
configuration.unstableOperations["v2.createOrgGroupPolicyOverride"] = true;
9+
const apiInstance = new v2.OrgGroupsApi(configuration);
10+
11+
const params: v2.OrgGroupsApiCreateOrgGroupPolicyOverrideRequest = {
12+
body: {
13+
data: {
14+
attributes: {
15+
orgSite: "datadoghq.com",
16+
orgUuid: "c3d4e5f6-a7b8-9012-cdef-012345678901",
17+
},
18+
relationships: {
19+
orgGroup: {
20+
data: {
21+
id: "a1b2c3d4-e5f6-7890-abcd-ef0123456789",
22+
type: "org_groups",
23+
},
24+
},
25+
orgGroupPolicy: {
26+
data: {
27+
id: "1a2b3c4d-5e6f-7890-abcd-ef0123456789",
28+
type: "org_group_policies",
29+
},
30+
},
31+
},
32+
type: "org_group_policy_overrides",
33+
},
34+
},
35+
};
36+
37+
apiInstance
38+
.createOrgGroupPolicyOverride(params)
39+
.then((data: v2.OrgGroupPolicyOverrideResponse) => {
40+
console.log(
41+
"API called successfully. Returned data: " + JSON.stringify(data)
42+
);
43+
})
44+
.catch((error: any) => console.error(error));
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
/**
2+
* Delete an org group returns "No Content" response
3+
*/
4+
5+
import { client, v2 } from "@datadog/datadog-api-client";
6+
7+
const configuration = client.createConfiguration();
8+
configuration.unstableOperations["v2.deleteOrgGroup"] = true;
9+
const apiInstance = new v2.OrgGroupsApi(configuration);
10+
11+
const params: v2.OrgGroupsApiDeleteOrgGroupRequest = {
12+
orgGroupId: "a1b2c3d4-e5f6-7890-abcd-ef0123456789",
13+
};
14+
15+
apiInstance
16+
.deleteOrgGroup(params)
17+
.then((data: any) => {
18+
console.log(
19+
"API called successfully. Returned data: " + JSON.stringify(data)
20+
);
21+
})
22+
.catch((error: any) => console.error(error));
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
/**
2+
* Delete an org group policy returns "No Content" response
3+
*/
4+
5+
import { client, v2 } from "@datadog/datadog-api-client";
6+
7+
const configuration = client.createConfiguration();
8+
configuration.unstableOperations["v2.deleteOrgGroupPolicy"] = true;
9+
const apiInstance = new v2.OrgGroupsApi(configuration);
10+
11+
const params: v2.OrgGroupsApiDeleteOrgGroupPolicyRequest = {
12+
orgGroupPolicyId: "1a2b3c4d-5e6f-7890-abcd-ef0123456789",
13+
};
14+
15+
apiInstance
16+
.deleteOrgGroupPolicy(params)
17+
.then((data: any) => {
18+
console.log(
19+
"API called successfully. Returned data: " + JSON.stringify(data)
20+
);
21+
})
22+
.catch((error: any) => console.error(error));
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
/**
2+
* Delete an org group policy override returns "No Content" response
3+
*/
4+
5+
import { client, v2 } from "@datadog/datadog-api-client";
6+
7+
const configuration = client.createConfiguration();
8+
configuration.unstableOperations["v2.deleteOrgGroupPolicyOverride"] = true;
9+
const apiInstance = new v2.OrgGroupsApi(configuration);
10+
11+
const params: v2.OrgGroupsApiDeleteOrgGroupPolicyOverrideRequest = {
12+
orgGroupPolicyOverrideId: "9f8e7d6c-5b4a-3210-fedc-ba0987654321",
13+
};
14+
15+
apiInstance
16+
.deleteOrgGroupPolicyOverride(params)
17+
.then((data: any) => {
18+
console.log(
19+
"API called successfully. Returned data: " + JSON.stringify(data)
20+
);
21+
})
22+
.catch((error: any) => console.error(error));
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
/**
2+
* Get an org group returns "OK" response
3+
*/
4+
5+
import { client, v2 } from "@datadog/datadog-api-client";
6+
7+
const configuration = client.createConfiguration();
8+
configuration.unstableOperations["v2.getOrgGroup"] = true;
9+
const apiInstance = new v2.OrgGroupsApi(configuration);
10+
11+
const params: v2.OrgGroupsApiGetOrgGroupRequest = {
12+
orgGroupId: "a1b2c3d4-e5f6-7890-abcd-ef0123456789",
13+
};
14+
15+
apiInstance
16+
.getOrgGroup(params)
17+
.then((data: v2.OrgGroupResponse) => {
18+
console.log(
19+
"API called successfully. Returned data: " + JSON.stringify(data)
20+
);
21+
})
22+
.catch((error: any) => console.error(error));
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
/**
2+
* Get an org group membership returns "OK" response
3+
*/
4+
5+
import { client, v2 } from "@datadog/datadog-api-client";
6+
7+
const configuration = client.createConfiguration();
8+
configuration.unstableOperations["v2.getOrgGroupMembership"] = true;
9+
const apiInstance = new v2.OrgGroupsApi(configuration);
10+
11+
const params: v2.OrgGroupsApiGetOrgGroupMembershipRequest = {
12+
orgGroupMembershipId: "f1e2d3c4-b5a6-7890-1234-567890abcdef",
13+
};
14+
15+
apiInstance
16+
.getOrgGroupMembership(params)
17+
.then((data: v2.OrgGroupMembershipResponse) => {
18+
console.log(
19+
"API called successfully. Returned data: " + JSON.stringify(data)
20+
);
21+
})
22+
.catch((error: any) => console.error(error));

0 commit comments

Comments
 (0)