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
280 changes: 280 additions & 0 deletions .generator/schemas/v2/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -75076,6 +75076,18 @@ components:
required:
- data
type: object
OwnershipConfidenceLevel:
description: The ownership confidence level.
enum:
- high
- medium
- low
example: high
type: string
x-enum-varnames:
- HIGH
- MEDIUM
- LOW
OwnershipEvidenceAttributes:
description: The attributes of an ownership evidence response.
properties:
Expand Down Expand Up @@ -75639,6 +75651,152 @@ components:
- TEAM
- SERVICE
- UNKNOWN
OwnershipSettingsAttributes:
description: The attributes of the ownership settings response.
properties:
auto_tag:
description: Whether automatic ownership tagging is enabled.
example: true
type: boolean
confidence_level:
$ref: "#/components/schemas/OwnershipConfidenceLevel"
version:
description: The current version of the ownership settings.
example: 1
format: int64
type: integer
required:
- version
- auto_tag
- confidence_level
type: object
OwnershipSettingsData:
description: The data wrapper for an ownership settings response.
properties:
attributes:
$ref: "#/components/schemas/OwnershipSettingsAttributes"
id:
description: The identifier of the ownership settings resource.
example: settings
type: string
type:
$ref: "#/components/schemas/OwnershipSettingsType"
required:
- id
- type
- attributes
type: object
OwnershipSettingsRequest:
description: The request body for updating ownership settings.
properties:
data:
$ref: "#/components/schemas/OwnershipSettingsRequestData"
required:
- data
type: object
OwnershipSettingsRequestAttributes:
description: The attributes of an ownership settings request.
properties:
auto_tag:
description: Whether automatic ownership tagging is enabled.
example: true
type: boolean
confidence_level:
$ref: "#/components/schemas/OwnershipConfidenceLevel"
required:
- auto_tag
- confidence_level
type: object
OwnershipSettingsRequestData:
description: The data wrapper for an ownership settings request.
properties:
attributes:
$ref: "#/components/schemas/OwnershipSettingsRequestAttributes"
type:
$ref: "#/components/schemas/OwnershipSettingsType"
required:
- type
- attributes
type: object
OwnershipSettingsResponse:
description: The response returned when retrieving or updating ownership settings.
properties:
data:
$ref: "#/components/schemas/OwnershipSettingsData"
required:
- data
type: object
OwnershipSettingsType:
default: ownership_settings
description: The type of the ownership settings resource. The value should always be `ownership_settings`.
enum:
- ownership_settings
example: ownership_settings
type: string
x-enum-varnames:
- OWNERSHIP_SETTINGS
OwnershipUntaggedFindingsAttributes:
description: The counts of findings without a team tag by ownership confidence.
properties:
high_confidence:
description: The number of high confidence findings without a team tag.
example: 30
format: int64
type: integer
low_confidence:
description: The number of low confidence findings without a team tag.
example: 42
format: int64
type: integer
medium_confidence:
description: The number of medium confidence findings without a team tag.
example: 70
format: int64
type: integer
total:
description: The total number of findings without a team tag.
example: 142
format: int64
type: integer
required:
- total
- high_confidence
- medium_confidence
- low_confidence
type: object
OwnershipUntaggedFindingsData:
description: The data wrapper for an ownership untagged findings response.
properties:
attributes:
$ref: "#/components/schemas/OwnershipUntaggedFindingsAttributes"
id:
description: The identifier of the ownership untagged findings resource.
example: untagged
type: string
type:
$ref: "#/components/schemas/OwnershipUntaggedFindingsType"
required:
- id
- type
- attributes
type: object
OwnershipUntaggedFindingsResponse:
description: The response returned when counting findings without a team tag by ownership confidence.
properties:
data:
$ref: "#/components/schemas/OwnershipUntaggedFindingsData"
required:
- data
type: object
OwnershipUntaggedFindingsType:
default: ownership_untagged_findings
description: The type of the ownership untagged findings resource. The value should always be `ownership_untagged_findings`.
enum:
- ownership_untagged_findings
example: ownership_untagged_findings
type: string
x-enum-varnames:
- OWNERSHIP_UNTAGGED_FINDINGS
PageAnnotationsAttributes:
description: Attributes of the annotations on a page.
properties:
Expand Down Expand Up @@ -132295,6 +132453,128 @@ paths:
$ref: "#/components/responses/TooManyRequestsResponse"
summary: Get all CSM Serverless Agents
tags: ["CSM Agents"]
/api/v2/csm/ownership/settings:
get:
description: Get ownership settings for the org. When settings are unset, the API returns the default opt-out configuration with `auto_tag` set to `true` and `confidence_level` set to `high`.
operationId: GetOwnershipSettings
responses:
"200":
content:
application/json:
examples:
default:
value:
data:
attributes:
auto_tag: true
confidence_level: high
version: 1
id: settings
type: ownership_settings
schema:
$ref: "#/components/schemas/OwnershipSettingsResponse"
description: OK
"401":
content:
application/json:
schema:
$ref: "#/components/schemas/JSONAPIErrorResponse"
description: Unauthorized
"429":
$ref: "#/components/responses/TooManyRequestsResponse"
summary: Get ownership settings for the org
tags: ["CSM Ownership"]
x-unstable: |-
**Note**: This endpoint is in Preview and may be subject to change.
If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/).
post:
description: Update ownership settings for the org.
operationId: PostOwnershipSettings
requestBody:
content:
application/json:
examples:
default:
value:
data:
attributes:
auto_tag: true
confidence_level: high
type: ownership_settings
schema:
$ref: "#/components/schemas/OwnershipSettingsRequest"
required: true
responses:
"200":
content:
application/json:
examples:
default:
value:
data:
attributes:
auto_tag: true
confidence_level: high
version: 1
id: settings
type: ownership_settings
schema:
$ref: "#/components/schemas/OwnershipSettingsResponse"
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
"429":
$ref: "#/components/responses/TooManyRequestsResponse"
summary: Update ownership settings for the org
tags: ["CSM Ownership"]
x-unstable: |-
**Note**: This endpoint is in Preview and may be subject to change.
If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/).
/api/v2/csm/ownership/settings/untagged:
get:
description: Count findings with no team tag, grouped by ownership confidence level.
operationId: GetOwnershipUntaggedFindings
responses:
"200":
content:
application/json:
examples:
default:
value:
data:
attributes:
high_confidence: 30
low_confidence: 42
medium_confidence: 70
total: 142
id: untagged
type: ownership_untagged_findings
schema:
$ref: "#/components/schemas/OwnershipUntaggedFindingsResponse"
description: OK
"401":
content:
application/json:
schema:
$ref: "#/components/schemas/JSONAPIErrorResponse"
description: Unauthorized
"429":
$ref: "#/components/responses/TooManyRequestsResponse"
summary: Count untagged findings by ownership confidence
tags: ["CSM Ownership"]
x-unstable: |-
**Note**: This endpoint is in Preview and may be subject to change.
If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/).
/api/v2/csm/ownership/{resource_id}:
get:
description: Get all current ownership inferences for a resource, one per owner type (`user`, `team`, `service`, `unknown`).
Expand Down
25 changes: 25 additions & 0 deletions examples/v2/csm-ownership/GetOwnershipSettings.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
// Get ownership settings for the org returns "OK" response

import com.datadog.api.client.ApiClient;
import com.datadog.api.client.ApiException;
import com.datadog.api.client.v2.api.CsmOwnershipApi;
import com.datadog.api.client.v2.model.OwnershipSettingsResponse;

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

try {
OwnershipSettingsResponse result = apiInstance.getOwnershipSettings();
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling CsmOwnershipApi#getOwnershipSettings");
System.err.println("Status code: " + e.getCode());
System.err.println("Reason: " + e.getResponseBody());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}
25 changes: 25 additions & 0 deletions examples/v2/csm-ownership/GetOwnershipUntaggedFindings.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
// Count untagged findings by ownership confidence returns "OK" response

import com.datadog.api.client.ApiClient;
import com.datadog.api.client.ApiException;
import com.datadog.api.client.v2.api.CsmOwnershipApi;
import com.datadog.api.client.v2.model.OwnershipUntaggedFindingsResponse;

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

try {
OwnershipUntaggedFindingsResponse result = apiInstance.getOwnershipUntaggedFindings();
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling CsmOwnershipApi#getOwnershipUntaggedFindings");
System.err.println("Status code: " + e.getCode());
System.err.println("Reason: " + e.getResponseBody());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}
40 changes: 40 additions & 0 deletions examples/v2/csm-ownership/PostOwnershipSettings.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
// Update ownership settings for the org returns "OK" response

import com.datadog.api.client.ApiClient;
import com.datadog.api.client.ApiException;
import com.datadog.api.client.v2.api.CsmOwnershipApi;
import com.datadog.api.client.v2.model.OwnershipConfidenceLevel;
import com.datadog.api.client.v2.model.OwnershipSettingsRequest;
import com.datadog.api.client.v2.model.OwnershipSettingsRequestAttributes;
import com.datadog.api.client.v2.model.OwnershipSettingsRequestData;
import com.datadog.api.client.v2.model.OwnershipSettingsResponse;
import com.datadog.api.client.v2.model.OwnershipSettingsType;

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

OwnershipSettingsRequest body =
new OwnershipSettingsRequest()
.data(
new OwnershipSettingsRequestData()
.attributes(
new OwnershipSettingsRequestAttributes()
.autoTag(true)
.confidenceLevel(OwnershipConfidenceLevel.HIGH))
.type(OwnershipSettingsType.OWNERSHIP_SETTINGS));

try {
OwnershipSettingsResponse result = apiInstance.postOwnershipSettings(body);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling CsmOwnershipApi#postOwnershipSettings");
System.err.println("Status code: " + e.getCode());
System.err.println("Reason: " + e.getResponseBody());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}
Loading
Loading