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
770 changes: 770 additions & 0 deletions .generator/schemas/v2/openapi.yaml

Large diffs are not rendered by default.

21 changes: 21 additions & 0 deletions examples/v2/rum-teams-ownership/CreateTeamsOwnershipMapping.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# Create a teams ownership mapping returns "Created" response

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

body = DatadogAPIClient::V2::TeamsOwnershipMappingCreateRequest.new({
data: DatadogAPIClient::V2::TeamsOwnershipMappingCreateData.new({
attributes: DatadogAPIClient::V2::TeamsOwnershipMappingCreateDataAttributes.new({
application_id: "11111111-2222-3333-4444-555555555555",
match_type: DatadogAPIClient::V2::TeamsOwnershipMatchType::EXACT,
service: "web-checkout",
team_handle: "team-rum",
view_name: "/checkout",
}),
type: DatadogAPIClient::V2::TeamsOwnershipMappingType::TEAMS_OWNERSHIP_MAPPINGS,
}),
})
p api_instance.create_teams_ownership_mapping(body)
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# Create teams ownership mapping returns "Created" response

require "datadog_api_client"
api_instance = DatadogAPIClient::V2::RumTeamsOwnershipAPI.new

body = DatadogAPIClient::V2::TeamsOwnershipMappingCreateRequest.new({
data: DatadogAPIClient::V2::TeamsOwnershipMappingCreateData.new({
type: DatadogAPIClient::V2::TeamsOwnershipMappingType::TEAMS_OWNERSHIP_MAPPINGS,
attributes: DatadogAPIClient::V2::TeamsOwnershipMappingCreateDataAttributes.new({
team_handle: "team-rum",
view_name: "/checkout-examplerumteamsownership",
service: "web-checkout-examplerumteamsownership",
match_type: DatadogAPIClient::V2::TeamsOwnershipMatchType::EXACT,
}),
}),
})
p api_instance.create_teams_ownership_mapping(body)
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# Bulk create and remove teams ownership mappings returns "OK" response

require "datadog_api_client"
api_instance = DatadogAPIClient::V2::RumTeamsOwnershipAPI.new

body = DatadogAPIClient::V2::TeamsOwnershipMappingBatchRequest.new({
atomic_operations: [
DatadogAPIClient::V2::TeamsOwnershipMappingBatchOperation.new({
op: DatadogAPIClient::V2::TeamsOwnershipMappingBatchOperationOp::ADD,
data: DatadogAPIClient::V2::TeamsOwnershipMappingBatchOperationData.new({
type: DatadogAPIClient::V2::TeamsOwnershipMappingType::TEAMS_OWNERSHIP_MAPPINGS,
attributes: DatadogAPIClient::V2::TeamsOwnershipMappingBatchOperationDataAttributes.new({
team_handle: "team-rum",
view_name: "/checkout-examplerumteamsownership",
service: "web-checkout-examplerumteamsownership",
match_type: DatadogAPIClient::V2::TeamsOwnershipMatchType::EXACT,
}),
}),
}),
],
})
p api_instance.create_teams_ownership_mappings_batch(body)
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# Delete a teams ownership mapping returns "No Content" response

require "datadog_api_client"
api_instance = DatadogAPIClient::V2::RumTeamsOwnershipAPI.new

# there is a valid "teams_ownership_mapping" in the system
TEAMS_OWNERSHIP_MAPPING_DATA_ID = ENV["TEAMS_OWNERSHIP_MAPPING_DATA_ID"]
api_instance.delete_teams_ownership_mapping(TEAMS_OWNERSHIP_MAPPING_DATA_ID)
8 changes: 8 additions & 0 deletions examples/v2/rum-teams-ownership/GetTeamsOwnershipMapping.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# Get a teams ownership mapping returns "OK" response

require "datadog_api_client"
api_instance = DatadogAPIClient::V2::RumTeamsOwnershipAPI.new

# there is a valid "teams_ownership_mapping" in the system
TEAMS_OWNERSHIP_MAPPING_DATA_ID = ENV["TEAMS_OWNERSHIP_MAPPING_DATA_ID"]
p api_instance.get_teams_ownership_mapping(TEAMS_OWNERSHIP_MAPPING_DATA_ID)
13 changes: 13 additions & 0 deletions examples/v2/rum-teams-ownership/ListTeamsOwnershipMappings.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# List teams ownership mappings returns "OK" response

require "datadog_api_client"
api_instance = DatadogAPIClient::V2::RumTeamsOwnershipAPI.new

# there is a valid "teams_ownership_mapping" in the system
TEAMS_OWNERSHIP_MAPPING_DATA_ATTRIBUTES_VIEW_NAME = ENV["TEAMS_OWNERSHIP_MAPPING_DATA_ATTRIBUTES_VIEW_NAME"]
opts = {
filter_view_name: [
TEAMS_OWNERSHIP_MAPPING_DATA_ATTRIBUTES_VIEW_NAME,
],
}
p api_instance.list_teams_ownership_mappings(opts)
13 changes: 13 additions & 0 deletions examples/v2/rum-teams-ownership/ListTeamsOwnershipRules.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# List teams ownership rules returns "OK" response

require "datadog_api_client"
api_instance = DatadogAPIClient::V2::RumTeamsOwnershipAPI.new

# there is a valid "teams_ownership_mapping" in the system
TEAMS_OWNERSHIP_MAPPING_DATA_ATTRIBUTES_VIEW_NAME = ENV["TEAMS_OWNERSHIP_MAPPING_DATA_ATTRIBUTES_VIEW_NAME"]
opts = {
filter_view_name: [
TEAMS_OWNERSHIP_MAPPING_DATA_ATTRIBUTES_VIEW_NAME,
],
}
p api_instance.list_teams_ownership_rules(opts)
24 changes: 24 additions & 0 deletions features/scenarios_model_mapping.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5505,6 +5505,30 @@
"scope_id" => "String",
"body" => "RumRetentionQuotaConfigUpdateRequest",
},
"v2.ListTeamsOwnershipMappings" => {
"filter_view_name" => "Array<String>",
"filter_team_handle" => "Array<String>",
"filter_application_id" => "Array<UUID>",
"filter_service" => "Array<String>",
},
"v2.CreateTeamsOwnershipMapping" => {
"body" => "TeamsOwnershipMappingCreateRequest",
},
"v2.CreateTeamsOwnershipMappingsBatch" => {
"body" => "TeamsOwnershipMappingBatchRequest",
},
"v2.DeleteTeamsOwnershipMapping" => {
"id" => "String",
},
"v2.GetTeamsOwnershipMapping" => {
"id" => "String",
},
"v2.ListTeamsOwnershipRules" => {
"filter_view_name" => "Array<String>",
"filter_team_handle" => "Array<String>",
"filter_application_id" => "Array<UUID>",
"filter_service" => "Array<String>",
},
"v2.CreateRUMOperation" => {
"body" => "RUMOperationCreateRequest",
},
Expand Down
12 changes: 12 additions & 0 deletions features/v2/given.json
Original file line number Diff line number Diff line change
Expand Up @@ -1330,6 +1330,18 @@
"tag": "Rum Metrics",
"operationId": "CreateRumMetric"
},
{
"parameters": [
{
"name": "body",
"value": "{\"data\":{\"type\":\"teams_ownership_mappings\",\"attributes\":{\"team_handle\":\"team-rum\",\"view_name\":\"/checkout-{{ unique_lower_alnum }}\",\"service\":\"web-checkout-{{ unique_lower_alnum }}\",\"match_type\":\"exact\"}}}"
}
],
"step": "there is a valid \"teams_ownership_mapping\" in the system",
"key": "teams_ownership_mapping",
"tag": "Rum Teams Ownership",
"operationId": "CreateTeamsOwnershipMapping"
},
{
"parameters": [
{
Expand Down
168 changes: 168 additions & 0 deletions features/v2/rum_teams_ownership.feature
Original file line number Diff line number Diff line change
@@ -0,0 +1,168 @@
@endpoint(rum-teams-ownership) @endpoint(rum-teams-ownership-v2)
Feature: Rum Teams Ownership
Manage teams ownership mappings between RUM views and the teams that own
them. See
<https://docs.datadoghq.com/real_user_monitoring/ownership_of_views/>.

Background:
Given a valid "apiKeyAuth" key in the system
And a valid "appKeyAuth" key in the system
And an instance of "RumTeamsOwnership" API

@skip @team:DataDog/rum-backend
Scenario: Bulk create and remove teams ownership mappings returns "Bad Request" response
Given new "CreateTeamsOwnershipMappingsBatch" request
And body with value {"atomic:operations":[{"op":"add","data":{"type":"teams_ownership_mappings","attributes":{"team_handle":"team-rum","view_name":"/checkout","service":"web-checkout","application_id":"invalid-uuid","match_type":"exact"}}}]}
When the request is sent
Then the response status is 400 Bad Request

@skip @team:DataDog/rum-backend
Scenario: Bulk create and remove teams ownership mappings returns "Bad Request. One or more operations failed validation, so none of the operations were applied." response
Given operation "CreateTeamsOwnershipMappingsBatch" enabled
And new "CreateTeamsOwnershipMappingsBatch" request
And body with value {"atomic:operations": [{"data": {"attributes": {"application_id": "11111111-2222-3333-4444-555555555555", "match_type": "exact", "service": "web-checkout", "team_handle": "team-rum", "view_name": "/checkout"}, "type": "teams_ownership_mappings"}, "op": "add", "ref": {"id": "{{ unique }}", "type": "teams_ownership_mappings"}}]}
When the request is sent
Then the response status is 400 Bad Request. One or more operations failed validation, so none of the operations were applied.

@generated @skip @team:DataDog/rum-backend
Scenario: Bulk create and remove teams ownership mappings returns "Conflict. One or more mappings requested for creation already exist." response
Given operation "CreateTeamsOwnershipMappingsBatch" enabled
And new "CreateTeamsOwnershipMappingsBatch" request
And body with value {"atomic:operations": [{"data": {"attributes": {"application_id": "11111111-2222-3333-4444-555555555555", "match_type": "exact", "service": "web-checkout", "team_handle": "team-rum", "view_name": "/checkout"}, "type": "teams_ownership_mappings"}, "op": "add", "ref": {"id": "456", "type": "teams_ownership_mappings"}}]}
When the request is sent
Then the response status is 409 Conflict. One or more mappings requested for creation already exist.

@generated @skip @team:DataDog/rum-backend
Scenario: Bulk create and remove teams ownership mappings returns "Not Found. One or more mappings requested for removal do not exist." response
Given operation "CreateTeamsOwnershipMappingsBatch" enabled
And new "CreateTeamsOwnershipMappingsBatch" request
And body with value {"atomic:operations": [{"data": {"attributes": {"application_id": "11111111-2222-3333-4444-555555555555", "match_type": "exact", "service": "web-checkout", "team_handle": "team-rum", "view_name": "/checkout"}, "type": "teams_ownership_mappings"}, "op": "add", "ref": {"id": "456", "type": "teams_ownership_mappings"}}]}
When the request is sent
Then the response status is 404 Not Found. One or more mappings requested for removal do not exist.

@skip @team:DataDog/rum-backend
Scenario: Bulk create and remove teams ownership mappings returns "OK" response
Given new "CreateTeamsOwnershipMappingsBatch" request
And body with value {"atomic:operations":[{"op":"add","data":{"type":"teams_ownership_mappings","attributes":{"team_handle":"team-rum","view_name":"/checkout-{{ unique_lower_alnum }}","service":"web-checkout-{{ unique_lower_alnum }}","match_type":"exact"}}}]}
When the request is sent
Then the response status is 200 OK
And the response "atomic:results[0].data.type" is equal to "teams_ownership_mappings"
And the response "atomic:results[0].data.attributes.team_handle" is equal to "team-rum"
And the response "atomic:results[0].data.attributes.match_type" is equal to "exact"

@skip @team:DataDog/rum-backend
Scenario: Bulk create teams ownership mappings without a service or application ID returns "Bad Request" response
Given new "CreateTeamsOwnershipMappingsBatch" request
And body with value {"atomic:operations":[{"op":"add","data":{"type":"teams_ownership_mappings","attributes":{"team_handle":"team-rum","view_name":"/checkout-{{ unique_lower_alnum }}","match_type":"exact"}}}]}
When the request is sent
Then the response status is 400 Bad Request

@generated @skip @team:DataDog/rum-backend
Scenario: Create a teams ownership mapping returns "Bad Request" response
Given operation "CreateTeamsOwnershipMapping" enabled
And new "CreateTeamsOwnershipMapping" request
And body with value {"data": {"attributes": {"application_id": "11111111-2222-3333-4444-555555555555", "match_type": "exact", "service": "web-checkout", "team_handle": "team-rum", "view_name": "/checkout"}, "type": "teams_ownership_mappings"}}
When the request is sent
Then the response status is 400 Bad Request

@generated @skip @team:DataDog/rum-backend
Scenario: Create a teams ownership mapping returns "Created" response
Given operation "CreateTeamsOwnershipMapping" enabled
And new "CreateTeamsOwnershipMapping" request
And body with value {"data": {"attributes": {"application_id": "11111111-2222-3333-4444-555555555555", "match_type": "exact", "service": "web-checkout", "team_handle": "team-rum", "view_name": "/checkout"}, "type": "teams_ownership_mappings"}}
When the request is sent
Then the response status is 201 Created

@skip @team:DataDog/rum-backend
Scenario: Create teams ownership mapping returns "Bad Request" response
Given new "CreateTeamsOwnershipMapping" request
And body with value {"data":{"type":"teams_ownership_mappings","attributes":{"team_handle":"team-rum","view_name":"/checkout","service":"web-checkout","application_id":"invalid-uuid","match_type":"exact"}}}
When the request is sent
Then the response status is 400 Bad Request

@skip @team:DataDog/rum-backend
Scenario: Create teams ownership mapping returns "Created" response
Given new "CreateTeamsOwnershipMapping" request
And body with value {"data":{"type":"teams_ownership_mappings","attributes":{"team_handle":"team-rum","view_name":"/checkout-{{ unique_lower_alnum }}","service":"web-checkout-{{ unique_lower_alnum }}","match_type":"exact"}}}
When the request is sent
Then the response status is 201 Created
And the response "data.type" is equal to "teams_ownership_mappings"
And the response "data.attributes.team_handle" is equal to "team-rum"
And the response "data.attributes.view_name" is equal to "/checkout-{{ unique_lower_alnum }}"
And the response "data.attributes.service" is equal to "web-checkout-{{ unique_lower_alnum }}"
And the response "data.attributes.match_type" is equal to "exact"

@skip @team:DataDog/rum-backend
Scenario: Delete a teams ownership mapping returns "No Content" response
Given there is a valid "teams_ownership_mapping" in the system
And new "DeleteTeamsOwnershipMapping" request
And request contains "id" parameter from "teams_ownership_mapping.data.id"
When the request is sent
Then the response status is 204 No Content

@skip @team:DataDog/rum-backend
Scenario: Delete a teams ownership mapping returns "Not Found" response
Given new "DeleteTeamsOwnershipMapping" request
And request contains "id" parameter with value "{{ unique }}"
When the request is sent
Then the response status is 404 Not Found

@skip @team:DataDog/rum-backend
Scenario: Get a teams ownership mapping returns "Not Found" response
Given new "GetTeamsOwnershipMapping" request
And request contains "id" parameter with value "{{ unique }}"
When the request is sent
Then the response status is 404 Not Found

@skip @team:DataDog/rum-backend
Scenario: Get a teams ownership mapping returns "OK" response
Given there is a valid "teams_ownership_mapping" in the system
And new "GetTeamsOwnershipMapping" request
And request contains "id" parameter from "teams_ownership_mapping.data.id"
When the request is sent
Then the response status is 200 OK
And the response "data.id" is equal to "{{ teams_ownership_mapping.data.id }}"
And the response "data.type" is equal to "teams_ownership_mappings"
And the response "data.attributes.team_handle" is equal to "team-rum"
And the response "data.attributes.view_name" is equal to "{{ teams_ownership_mapping.data.attributes.view_name }}"
And the response "data.attributes.match_type" is equal to "exact"

@generated @skip @team:DataDog/rum-backend
Scenario: List teams ownership mappings returns "Bad Request" response
Given operation "ListTeamsOwnershipMappings" enabled
And new "ListTeamsOwnershipMappings" request
When the request is sent
Then the response status is 400 Bad Request

@skip @team:DataDog/rum-backend
Scenario: List teams ownership mappings returns "OK" response
Given there is a valid "teams_ownership_mapping" in the system
And new "ListTeamsOwnershipMappings" request
And request contains "filter[view_name]" parameter with value ["{{ teams_ownership_mapping.data.attributes.view_name }}"]
When the request is sent
Then the response status is 200 OK
And the response "data" has length 1
And the response "data[0].type" is equal to "teams_ownership_mappings"
And the response "data[0].attributes.team_handle" is equal to "team-rum"
And the response "data[0].attributes.view_name" is equal to "{{ teams_ownership_mapping.data.attributes.view_name }}"
And the response "data[0].attributes.service" is equal to "{{ teams_ownership_mapping.data.attributes.service }}"
And the response "data[0].attributes.match_type" is equal to "exact"

@generated @skip @team:DataDog/rum-backend
Scenario: List teams ownership rules returns "Bad Request" response
Given operation "ListTeamsOwnershipRules" enabled
And new "ListTeamsOwnershipRules" request
When the request is sent
Then the response status is 400 Bad Request

@skip @team:DataDog/rum-backend
Scenario: List teams ownership rules returns "OK" response
Given there is a valid "teams_ownership_mapping" in the system
And new "ListTeamsOwnershipRules" request
And request contains "filter[view_name]" parameter with value ["{{ teams_ownership_mapping.data.attributes.view_name }}"]
When the request is sent
Then the response status is 200 OK
And the response "data" has length 1
And the response "data[0].type" is equal to "teams_ownership_grouped_mappings"
And the response "data[0].attributes.view_name" is equal to "{{ teams_ownership_mapping.data.attributes.view_name }}"
And the response "data[0].attributes.match_type" is equal to "exact"
50 changes: 50 additions & 0 deletions features/v2/undo.json
Original file line number Diff line number Diff line change
Expand Up @@ -7164,6 +7164,56 @@
"type": "idempotent"
}
},
"ListTeamsOwnershipMappings": {
"tag": "Rum Teams Ownership",
"undo": {
"type": "safe"
}
},
"CreateTeamsOwnershipMapping": {
"tag": "Rum Teams Ownership",
"undo": {
"operationId": "DeleteTeamsOwnershipMapping",
"parameters": [
{
"name": "id",
"source": "data.id"
}
],
"type": "unsafe"
}
},
"CreateTeamsOwnershipMappingsBatch": {
"tag": "Rum Teams Ownership",
"undo": {
"operationId": "DeleteTeamsOwnershipMapping",
"parameters": [
{
"name": "id",
"source": "atomic:results[0].data.id"
}
],
"type": "unsafe"
}
},
"DeleteTeamsOwnershipMapping": {
"tag": "Rum Teams Ownership",
"undo": {
"type": "idempotent"
}
},
"GetTeamsOwnershipMapping": {
"tag": "Rum Teams Ownership",
"undo": {
"type": "safe"
}
},
"ListTeamsOwnershipRules": {
"tag": "Rum Teams Ownership",
"undo": {
"type": "safe"
}
},
"ListRUMEvents": {
"tag": "RUM",
"undo": {
Expand Down
6 changes: 6 additions & 0 deletions lib/datadog_api_client/configuration.rb
Original file line number Diff line number Diff line change
Expand Up @@ -690,6 +690,12 @@ def initialize
"v2.create_rum_config": false,
"v2.get_rum_config": false,
"v2.update_rum_config": false,
"v2.create_teams_ownership_mapping": false,
"v2.create_teams_ownership_mappings_batch": false,
"v2.delete_teams_ownership_mapping": false,
"v2.get_teams_ownership_mapping": false,
"v2.list_teams_ownership_mappings": false,
"v2.list_teams_ownership_rules": false,
"v2.create_rum_operation": false,
"v2.create_rum_operation_strong_link": false,
"v2.delete_rum_operation": false,
Expand Down
Loading
Loading