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
173 changes: 173 additions & 0 deletions .generator/schemas/v2/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26647,6 +26647,100 @@ components:
required:
- data
type: object
CustomerOrgDisableRequest:
description: Request payload for disabling the authenticated customer organization.
properties:
data:
$ref: "#/components/schemas/CustomerOrgDisableRequestData"
required:
- data
type: object
CustomerOrgDisableRequestAttributes:
description: |-
Optional attributes for a customer org disable request. When supplied, `org_uuid`
must match the authenticated organization or the request is rejected.
properties:
org_uuid:
description: |-
Datadog organization UUID. If supplied, must match the authenticated
organization.
example: "abcdef01-2345-6789-abcd-ef0123456789"
type: string
type: object
CustomerOrgDisableRequestData:
description: Data object for a customer org disable request.
properties:
attributes:
$ref: "#/components/schemas/CustomerOrgDisableRequestAttributes"
id:
description: |-
Optional client-supplied identifier for the request. Useful for client-side
correlation; the server does not use this value.
example: "1"
type: string
type:
$ref: "#/components/schemas/CustomerOrgDisableType"
required:
- type
type: object
CustomerOrgDisableResponse:
description: Response describing the outcome of disabling the customer organization.
properties:
data:
$ref: "#/components/schemas/CustomerOrgDisableResponseData"
required:
- data
type: object
CustomerOrgDisableResponseAttributes:
description: Attributes describing the outcome of the disable action on the customer organization.
properties:
status:
$ref: "#/components/schemas/CustomerOrgDisableStatus"
required:
- status
type: object
CustomerOrgDisableResponseData:
description: Data object returned after disabling the customer organization.
properties:
attributes:
$ref: "#/components/schemas/CustomerOrgDisableResponseAttributes"
id:
description: Identifier of the disabled organization.
example: "abcdef01-2345-6789-abcd-ef0123456789"
type: string
type:
$ref: "#/components/schemas/CustomerOrgDisableResponseType"
required:
- type
- id
- attributes
type: object
CustomerOrgDisableResponseType:
description: JSON:API resource type for a customer org disable response.
enum:
- org_disable
example: "org_disable"
type: string
x-enum-varnames:
- ORG_DISABLE
CustomerOrgDisableStatus:
description: Resulting lifecycle status of the organization after the disable action.
enum:
- disabled
- pending_disable
example: "disabled"
type: string
x-enum-varnames:
- DISABLED
- PENDING_DISABLE
CustomerOrgDisableType:
description: JSON:API resource type for a customer org disable request.
enum:
- customer_org_disable
example: "customer_org_disable"
type: string
x-enum-varnames:
- CUSTOMER_ORG_DISABLE
DORACustomTags:
description: A list of user-defined tags. The tags must follow the `key:value` pattern. Up to 100 may be added per event.
example:
Expand Down Expand Up @@ -144869,6 +144963,81 @@ paths:
permissions:
- org_management
- org_connections_write
/api/v2/org/disable:
post:
description: |-
Disable the Datadog organization associated with the authenticated user or API key.
The request body uses JSON:API format. If `org_uuid` is supplied, it must match
the authenticated org or the request is rejected. Successful calls disable the org
and return the resulting state from the downstream service. Requires the
`org_management` permission.
operationId: DisableCustomerOrg
requestBody:
content:
application/json:
examples:
default:
value:
data:
attributes:
org_uuid: "abcdef01-2345-6789-abcd-ef0123456789"
id: "1"
type: "customer_org_disable"
schema:
$ref: "#/components/schemas/CustomerOrgDisableRequest"
required: true
responses:
"200":
content:
application/json:
examples:
default:
value:
data:
attributes:
status: "disabled"
id: "abcdef01-2345-6789-abcd-ef0123456789"
type: "org_disable"
schema:
$ref: "#/components/schemas/CustomerOrgDisableResponse"
description: OK
"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
"429":
$ref: "#/components/responses/TooManyRequestsResponse"
"500":
content:
application/json:
schema:
$ref: "#/components/schemas/JSONAPIErrorResponse"
description: Internal Server Error
security:
- apiKeyAuth: []
appKeyAuth: []
- AuthZ:
- org_management
summary: Disable the authenticated customer organization
tags:
- Customer Org
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_configs:
get:
description: Returns all Org Configs (name, description, and value).
Expand Down Expand Up @@ -178361,6 +178530,10 @@ tags:
- description: |-
The Containers API allows you to query container data for your organization. See the [Container Monitoring page](https://docs.datadoghq.com/containers/) for more information.
name: Containers
- description: |-
Programmatic management of a customer's Datadog organization. Use this API to perform
self-service organization lifecycle actions such as disabling the authenticated org.
name: Customer Org
- description: |-
Search, send, or delete events for DORA Metrics to measure and improve your software delivery performance. See the [DORA Metrics page](https://docs.datadoghq.com/dora_metrics/) for more information.

Expand Down
39 changes: 39 additions & 0 deletions examples/v2/customer-org/DisableCustomerOrg.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
// Disable the authenticated customer organization returns "OK" response

import com.datadog.api.client.ApiClient;
import com.datadog.api.client.ApiException;
import com.datadog.api.client.v2.api.CustomerOrgApi;
import com.datadog.api.client.v2.model.CustomerOrgDisableRequest;
import com.datadog.api.client.v2.model.CustomerOrgDisableRequestAttributes;
import com.datadog.api.client.v2.model.CustomerOrgDisableRequestData;
import com.datadog.api.client.v2.model.CustomerOrgDisableResponse;
import com.datadog.api.client.v2.model.CustomerOrgDisableType;

public class Example {
public static void main(String[] args) {
ApiClient defaultClient = ApiClient.getDefaultApiClient();
defaultClient.setUnstableOperationEnabled("v2.disableCustomerOrg", true);
CustomerOrgApi apiInstance = new CustomerOrgApi(defaultClient);

CustomerOrgDisableRequest body =
new CustomerOrgDisableRequest()
.data(
new CustomerOrgDisableRequestData()
.attributes(
new CustomerOrgDisableRequestAttributes()
.orgUuid("abcdef01-2345-6789-abcd-ef0123456789"))
.id("1")
.type(CustomerOrgDisableType.CUSTOMER_ORG_DISABLE));

try {
CustomerOrgDisableResponse result = apiInstance.disableCustomerOrg(body);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling CustomerOrgApi#disableCustomerOrg");
System.err.println("Status code: " + e.getCode());
System.err.println("Reason: " + e.getResponseBody());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}
1 change: 1 addition & 0 deletions src/main/java/com/datadog/api/client/ApiClient.java
Original file line number Diff line number Diff line change
Expand Up @@ -1106,6 +1106,7 @@ public class ApiClient {
put("v2.getScopesRestriction", false);
put("v2.registerOAuthClient", false);
put("v2.upsertScopesRestriction", false);
put("v2.disableCustomerOrg", false);
put("v2.bulkUpdateOrgGroupMemberships", false);
put("v2.createOrgGroup", false);
put("v2.createOrgGroupPolicy", false);
Expand Down
Loading
Loading