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
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
8 changes: 8 additions & 0 deletions examples/v2/csm-ownership/GetOwnershipSettings.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# Get ownership settings for the org returns "OK" response

require "datadog_api_client"
DatadogAPIClient.configure do |config|
config.unstable_operations["v2.get_ownership_settings".to_sym] = true
end
api_instance = DatadogAPIClient::V2::CSMOwnershipAPI.new
p api_instance.get_ownership_settings()
8 changes: 8 additions & 0 deletions examples/v2/csm-ownership/GetOwnershipUntaggedFindings.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# Count untagged findings by ownership confidence returns "OK" response

require "datadog_api_client"
DatadogAPIClient.configure do |config|
config.unstable_operations["v2.get_ownership_untagged_findings".to_sym] = true
end
api_instance = DatadogAPIClient::V2::CSMOwnershipAPI.new
p api_instance.get_ownership_untagged_findings()
18 changes: 18 additions & 0 deletions examples/v2/csm-ownership/PostOwnershipSettings.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# Update ownership settings for the org returns "OK" response

require "datadog_api_client"
DatadogAPIClient.configure do |config|
config.unstable_operations["v2.post_ownership_settings".to_sym] = true
end
api_instance = DatadogAPIClient::V2::CSMOwnershipAPI.new

body = DatadogAPIClient::V2::OwnershipSettingsRequest.new({
data: DatadogAPIClient::V2::OwnershipSettingsRequestData.new({
attributes: DatadogAPIClient::V2::OwnershipSettingsRequestAttributes.new({
auto_tag: true,
confidence_level: DatadogAPIClient::V2::OwnershipConfidenceLevel::HIGH,
}),
type: DatadogAPIClient::V2::OwnershipSettingsType::OWNERSHIP_SETTINGS,
}),
})
p api_instance.post_ownership_settings(body)
3 changes: 3 additions & 0 deletions features/scenarios_model_mapping.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3030,6 +3030,9 @@
"query" => "String",
"order_direction" => "OrderDirection",
},
"v2.PostOwnershipSettings" => {
"body" => "OwnershipSettingsRequest",
},
"v2.ListOwnershipInferences" => {
"resource_id" => "String",
},
Expand Down
30 changes: 30 additions & 0 deletions features/v2/csm_ownership.feature
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,13 @@ Feature: CSM Ownership
And a valid "appKeyAuth" key in the system
And an instance of "CSMOwnership" API

@generated @skip @team:DataDog/k9-misconfigs
Scenario: Count untagged findings by ownership confidence returns "OK" response
Given operation "GetOwnershipUntaggedFindings" enabled
And new "GetOwnershipUntaggedFindings" request
When the request is sent
Then the response status is 200 OK

@generated @skip @team:DataDog/k9-misconfigs
Scenario: Get an ownership inference by owner type returns "Bad Request" response
Given operation "GetOwnershipInference" enabled
Expand Down Expand Up @@ -39,6 +46,13 @@ Feature: CSM Ownership
When the request is sent
Then the response status is 200 OK

@generated @skip @team:DataDog/k9-misconfigs
Scenario: Get ownership settings for the org returns "OK" response
Given operation "GetOwnershipSettings" enabled
And new "GetOwnershipSettings" request
When the request is sent
Then the response status is 200 OK

@generated @skip @team:DataDog/k9-misconfigs
Scenario: Get the evidence for an ownership inference returns "Bad Request" response
Given operation "GetOwnershipEvidence" enabled
Expand Down Expand Up @@ -163,3 +177,19 @@ Feature: CSM Ownership
And body with value {"data": {"attributes": {"action": "confirm", "actor_handle": "user@example.com", "actor_type": "user", "corrected_owner_handle": "team-b", "corrected_owner_type": "team", "inference_checksum": "abc123", "reason": "Confirmed by team lead."}, "type": "ownership_feedback"}}
When the request is sent
Then the response status is 404 Not Found

@generated @skip @team:DataDog/k9-misconfigs
Scenario: Update ownership settings for the org returns "Bad Request" response
Given operation "PostOwnershipSettings" enabled
And new "PostOwnershipSettings" request
And body with value {"data": {"attributes": {"auto_tag": true, "confidence_level": "high"}, "type": "ownership_settings"}}
When the request is sent
Then the response status is 400 Bad Request

@generated @skip @team:DataDog/k9-misconfigs
Scenario: Update ownership settings for the org returns "OK" response
Given operation "PostOwnershipSettings" enabled
And new "PostOwnershipSettings" request
And body with value {"data": {"attributes": {"auto_tag": true, "confidence_level": "high"}, "type": "ownership_settings"}}
When the request is sent
Then the response status is 200 OK
Loading
Loading