팀 소유자 매핑 대량 생성 및 제거
https://api.datadoghq.com/api/v2/rum/config/teams-ownership/mappings/operationshttps://api.us3.datadoghq.com/api/v2/rum/config/teams-ownership/mappings/operationshttps://api.us5.datadoghq.com/api/v2/rum/config/teams-ownership/mappings/operationshttps://api.datadoghq.eu/api/v2/rum/config/teams-ownership/mappings/operationshttps://api.ap1.datadoghq.com/api/v2/rum/config/teams-ownership/mappings/operationshttps://api.ap2.datadoghq.com/api/v2/rum/config/teams-ownership/mappings/operationshttps://api.uk1.datadoghq.com/api/v2/rum/config/teams-ownership/mappings/operationshttps://api.ddog-gov.com/api/v2/rum/config/teams-ownership/mappings/operationshttps://api.us2.ddog-gov.com/api/v2/rum/config/teams-ownership/mappings/operations개요
JSON:API 원자적 작업 확장에 따라 단일 원자적 요청으로 조직의 팀 소유자 매핑을 추가 및 제거합니다. 작업은 함께 적용됩니다. 즉, 작업 중 하나라도 유효하지 않으면 어떤 작업도 적용되지 않습니다. 추가 작업이 제거 작업보다 먼저 처리되므로 결과가 요청과 동일한 순서로 나타나지 않을 수 있습니다.
요청
Body Data (required)
원자적으로 적용할 추가 및 제거 작업 목록입니다.
atomic:operations [required]팀 소유자 매핑을 대량으로 생성하고 제거하기 위한 요청 본문입니다.
dataThe mapping to add. Required when op is add.
attributes [required]The attributes of the mapping to add. team_handle and view_name are required
when op is add. At least one of service or application_id must be provided.
application_idThe ID of the RUM application this mapping applies to.
For browser applications, provide the real application UUID — the team is applied to the view regardless of service.
For mobile applications, omit this field (or set it to the nil UUID 00000000-0000-0000-0000-000000000000) — the team is applied to the view and service combination across all applications.
match_typeHow the view_name is matched against RUM view names.
exactexact, prefixserviceThe RUM application's service name. For browser applications, this is optional. For mobile applications, this is required and scopes the ownership to a specific service.
team_handleThe handle of the team that owns the matched RUM views.
view_nameThe RUM view name to match, or its prefix when match_type is prefix.
type [required]The type of the resource. The value should always be teams_ownership_mappings.
teams_ownership_mappingsteams_ownership_mappingsop [required]Whether this operation adds a new mapping or removes an existing one.
add, removerefIdentifies an existing mapping to remove. Required when op is remove.
id [required]The ID of the mapping to remove.
type [required]The type of the resource. The value should always be teams_ownership_mappings.
teams_ownership_mappingsteams_ownership_mappings{
"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"
}
}
]
}응답
OK
The response body for the bulk create and remove operation. On success, atomic:results
contains one entry per operation. Add results appear before remove results and may not match
request order. Correlate add results by their type and id rather than by array position.
On failure, no operations were applied and errors describes what went wrong.
atomic:resultsThe result of each operation. Add operations are processed first, then remove operations, so results may not appear in the same order as the request. Present only on success.
dataThe mapping created by an add operation.
attributes [required]The attributes of a mapping created by an add operation.
application_idThe ID of the RUM application, when one was provided.
created_at [required]Timestamp when the mapping was created.
created_by [required]The UUID of the user who created the mapping.
match_type [required]How the view_name is matched against RUM view names.
exactexact, prefixorg_id [required]The ID of the organization that owns this mapping.
serviceThe RUM application's service name, when one was provided.
team_handle [required]The handle of the team that owns the matched RUM views.
view_name [required]The RUM view name to match, or its prefix when match_type is prefix.
id [required]The unique identifier of the teams ownership mapping.
type [required]The type of the resource. The value should always be teams_ownership_mappings.
teams_ownership_mappingsteams_ownership_mappingserrorsThe validation or processing errors encountered. Present only when the request could not be completed.
detailA human-readable explanation specific to this error.
status [required]The HTTP status code applicable to this error.
title [required]A short, human-readable summary of the error.
{
"atomic:results": [
{
"data": {
"attributes": {
"application_id": "11111111-2222-3333-4444-555555555555",
"created_at": "2026-01-15T09:30:00.000Z",
"created_by": "aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee",
"match_type": "exact",
"org_id": 123456,
"service": "web-checkout",
"team_handle": "team-rum",
"view_name": "/checkout"
},
"id": "123",
"type": "teams_ownership_mappings"
}
}
],
"errors": [
{
"detail": "prefix match_type is not enabled for this org",
"status": "400",
"title": "Bad Request"
}
]
}Bad Request. One or more operations failed validation, so none of the operations were applied. Errors are returned in the JSON:API atomic operations error format rather than the standard error response.
API error response.
errors [required]A list of errors.
detailA human-readable explanation specific to this occurrence of the error.
metaNon-standard meta-information about the error
sourceReferences to the source of the error.
headerA string indicating the name of a single request header which caused the error.
parameterA string indicating which URI query parameter caused the error.
pointerA JSON pointer to the value in the request document that caused the error.
statusStatus code of the response.
titleShort human-readable summary of the error.
{
"errors": [
{
"detail": "Missing required attribute in body",
"meta": {},
"source": {
"header": "Authorization",
"parameter": "limit",
"pointer": "/data/attributes/title"
},
"status": "400",
"title": "Bad Request"
}
]
}Not Authorized
API error response.
errors [required]A list of errors.
{
"errors": [
"Bad Request"
]
}Not Found. One or more mappings requested for removal do not exist.
API error response.
errors [required]A list of errors.
detailA human-readable explanation specific to this occurrence of the error.
metaNon-standard meta-information about the error
sourceReferences to the source of the error.
headerA string indicating the name of a single request header which caused the error.
parameterA string indicating which URI query parameter caused the error.
pointerA JSON pointer to the value in the request document that caused the error.
statusStatus code of the response.
titleShort human-readable summary of the error.
{
"errors": [
{
"detail": "Missing required attribute in body",
"meta": {},
"source": {
"header": "Authorization",
"parameter": "limit",
"pointer": "/data/attributes/title"
},
"status": "400",
"title": "Bad Request"
}
]
}Conflict. One or more mappings requested for creation already exist.
API error response.
errors [required]A list of errors.
detailA human-readable explanation specific to this occurrence of the error.
metaNon-standard meta-information about the error
sourceReferences to the source of the error.
headerA string indicating the name of a single request header which caused the error.
parameterA string indicating which URI query parameter caused the error.
pointerA JSON pointer to the value in the request document that caused the error.
statusStatus code of the response.
titleShort human-readable summary of the error.
{
"errors": [
{
"detail": "Missing required attribute in body",
"meta": {},
"source": {
"header": "Authorization",
"parameter": "limit",
"pointer": "/data/attributes/title"
},
"status": "400",
"title": "Bad Request"
}
]
}Too many requests
API error response.
errors [required]A list of errors.
{
"errors": [
"Bad Request"
]
}코드 예시
# Set your Datadog site and credentials
export DD_SITE="datadoghq.com"
# Use a Personal Access Token or Service Access Token
export DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>"
curl -X POST "https://api.${DD_SITE}/api/v2/rum/config/teams-ownership/mappings/operations" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
"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"
},
{
"op": "remove",
"ref": {
"id": "456",
"type": "teams_ownership_mappings"
}
}
]
}
EOF# Set your Datadog site and credentials
export DD_SITE="us3.datadoghq.com"
# Use a Personal Access Token or Service Access Token
export DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>"
curl -X POST "https://api.${DD_SITE}/api/v2/rum/config/teams-ownership/mappings/operations" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
"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"
},
{
"op": "remove",
"ref": {
"id": "456",
"type": "teams_ownership_mappings"
}
}
]
}
EOF# Set your Datadog site and credentials
export DD_SITE="us5.datadoghq.com"
# Use a Personal Access Token or Service Access Token
export DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>"
curl -X POST "https://api.${DD_SITE}/api/v2/rum/config/teams-ownership/mappings/operations" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
"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"
},
{
"op": "remove",
"ref": {
"id": "456",
"type": "teams_ownership_mappings"
}
}
]
}
EOF# Set your Datadog site and credentials
export DD_SITE="datadoghq.eu"
# Use a Personal Access Token or Service Access Token
export DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>"
curl -X POST "https://api.${DD_SITE}/api/v2/rum/config/teams-ownership/mappings/operations" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
"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"
},
{
"op": "remove",
"ref": {
"id": "456",
"type": "teams_ownership_mappings"
}
}
]
}
EOF# Set your Datadog site and credentials
export DD_SITE="ap1.datadoghq.com"
# Use a Personal Access Token or Service Access Token
export DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>"
curl -X POST "https://api.${DD_SITE}/api/v2/rum/config/teams-ownership/mappings/operations" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
"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"
},
{
"op": "remove",
"ref": {
"id": "456",
"type": "teams_ownership_mappings"
}
}
]
}
EOF# Set your Datadog site and credentials
export DD_SITE="ap2.datadoghq.com"
# Use a Personal Access Token or Service Access Token
export DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>"
curl -X POST "https://api.${DD_SITE}/api/v2/rum/config/teams-ownership/mappings/operations" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
"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"
},
{
"op": "remove",
"ref": {
"id": "456",
"type": "teams_ownership_mappings"
}
}
]
}
EOF# Set your Datadog site and credentials
export DD_SITE="uk1.datadoghq.com"
# Use a Personal Access Token or Service Access Token
export DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>"
curl -X POST "https://api.${DD_SITE}/api/v2/rum/config/teams-ownership/mappings/operations" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
"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"
},
{
"op": "remove",
"ref": {
"id": "456",
"type": "teams_ownership_mappings"
}
}
]
}
EOF# Set your Datadog site and credentials
export DD_SITE="ddog-gov.com"
# Use a Personal Access Token or Service Access Token
export DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>"
curl -X POST "https://api.${DD_SITE}/api/v2/rum/config/teams-ownership/mappings/operations" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
"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"
},
{
"op": "remove",
"ref": {
"id": "456",
"type": "teams_ownership_mappings"
}
}
]
}
EOF# Set your Datadog site and credentials
export DD_SITE="us2.ddog-gov.com"
# Use a Personal Access Token or Service Access Token
export DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>"
curl -X POST "https://api.${DD_SITE}/api/v2/rum/config/teams-ownership/mappings/operations" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
"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"
},
{
"op": "remove",
"ref": {
"id": "456",
"type": "teams_ownership_mappings"
}
}
]
}
EOF// Bulk create and remove teams ownership mappings returns "OK" response
package main
import (
"context"
"encoding/json"
"fmt"
"os"
"github.com/DataDog/datadog-api-client-go/v2/api/datadog"
"github.com/DataDog/datadog-api-client-go/v2/api/datadogV2"
)
func main() {
body := datadogV2.TeamsOwnershipMappingBatchRequest{
AtomicOperations: []datadogV2.TeamsOwnershipMappingBatchOperation{
{
Op: datadogV2.TEAMSOWNERSHIPMAPPINGBATCHOPERATIONOP_ADD,
Data: &datadogV2.TeamsOwnershipMappingBatchOperationData{
Type: datadogV2.TEAMSOWNERSHIPMAPPINGTYPE_TEAMS_OWNERSHIP_MAPPINGS,
Attributes: datadogV2.TeamsOwnershipMappingBatchOperationDataAttributes{
TeamHandle: datadog.PtrString("team-rum"),
ViewName: datadog.PtrString("/checkout-examplerumteamsownership"),
Service: datadog.PtrString("web-checkout-examplerumteamsownership"),
MatchType: datadogV2.TEAMSOWNERSHIPMATCHTYPE_EXACT.Ptr(),
},
},
},
},
}
ctx := datadog.NewDefaultContext(context.Background())
ctx = context.WithValue(ctx, datadog.ContextAccessToken, os.Getenv("DD_BEARER_TOKEN"))
configuration := datadog.NewConfiguration()
apiClient := datadog.NewAPIClient(configuration)
api := datadogV2.NewRumTeamsOwnershipApi(apiClient)
resp, r, err := api.CreateTeamsOwnershipMappingsBatch(ctx, body)
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `RumTeamsOwnershipApi.CreateTeamsOwnershipMappingsBatch`: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
responseContent, _ := json.MarshalIndent(resp, "", " ")
fmt.Fprintf(os.Stdout, "Response from `RumTeamsOwnershipApi.CreateTeamsOwnershipMappingsBatch`:\n%s\n", responseContent)
}
Instructions
First install the library and its dependencies and then save the example to main.go and run following commands:
DD_SITE="datadoghq.com" DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>" go run "main.go"DD_SITE="us3.datadoghq.com" DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>" go run "main.go"DD_SITE="us5.datadoghq.com" DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>" go run "main.go"DD_SITE="datadoghq.eu" DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>" go run "main.go"DD_SITE="ap1.datadoghq.com" DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>" go run "main.go"DD_SITE="ap2.datadoghq.com" DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>" go run "main.go"DD_SITE="uk1.datadoghq.com" DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>" go run "main.go"DD_SITE="ddog-gov.com" DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>" go run "main.go"DD_SITE="us2.ddog-gov.com" DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>" go run "main.go"// Bulk create and remove teams ownership mappings returns "OK" response
import com.datadog.api.client.ApiClient;
import com.datadog.api.client.ApiException;
import com.datadog.api.client.v2.api.RumTeamsOwnershipApi;
import com.datadog.api.client.v2.model.TeamsOwnershipMappingBatchOperation;
import com.datadog.api.client.v2.model.TeamsOwnershipMappingBatchOperationData;
import com.datadog.api.client.v2.model.TeamsOwnershipMappingBatchOperationDataAttributes;
import com.datadog.api.client.v2.model.TeamsOwnershipMappingBatchOperationOp;
import com.datadog.api.client.v2.model.TeamsOwnershipMappingBatchRequest;
import com.datadog.api.client.v2.model.TeamsOwnershipMappingBatchResponse;
import com.datadog.api.client.v2.model.TeamsOwnershipMappingType;
import com.datadog.api.client.v2.model.TeamsOwnershipMatchType;
import java.util.Collections;
public class Example {
public static void main(String[] args) {
ApiClient defaultClient = ApiClient.getDefaultApiClient();
defaultClient.setAccessToken(System.getenv("DD_BEARER_TOKEN"));
RumTeamsOwnershipApi apiInstance = new RumTeamsOwnershipApi(defaultClient);
TeamsOwnershipMappingBatchRequest body =
new TeamsOwnershipMappingBatchRequest()
.atomicOperations(
Collections.singletonList(
new TeamsOwnershipMappingBatchOperation()
.op(TeamsOwnershipMappingBatchOperationOp.ADD)
.data(
new TeamsOwnershipMappingBatchOperationData()
.type(TeamsOwnershipMappingType.TEAMS_OWNERSHIP_MAPPINGS)
.attributes(
new TeamsOwnershipMappingBatchOperationDataAttributes()
.teamHandle("team-rum")
.viewName("/checkout-examplerumteamsownership")
.service("web-checkout-examplerumteamsownership")
.matchType(TeamsOwnershipMatchType.EXACT)))));
try {
TeamsOwnershipMappingBatchResponse result =
apiInstance.createTeamsOwnershipMappingsBatch(body);
System.out.println(result);
} catch (ApiException e) {
System.err.println(
"Exception when calling RumTeamsOwnershipApi#createTeamsOwnershipMappingsBatch");
System.err.println("Status code: " + e.getCode());
System.err.println("Reason: " + e.getResponseBody());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}
Instructions
First install the library and its dependencies and then save the example to Example.java and run following commands:
DD_SITE="datadoghq.com" DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>" java "Example.java"DD_SITE="us3.datadoghq.com" DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>" java "Example.java"DD_SITE="us5.datadoghq.com" DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>" java "Example.java"DD_SITE="datadoghq.eu" DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>" java "Example.java"DD_SITE="ap1.datadoghq.com" DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>" java "Example.java"DD_SITE="ap2.datadoghq.com" DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>" java "Example.java"DD_SITE="uk1.datadoghq.com" DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>" java "Example.java"DD_SITE="ddog-gov.com" DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>" java "Example.java"DD_SITE="us2.ddog-gov.com" DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>" java "Example.java""""
Bulk create and remove teams ownership mappings returns "OK" response
"""
from os import environ
from datadog_api_client import ApiClient, Configuration
from datadog_api_client.v2.api.rum_teams_ownership_api import RumTeamsOwnershipApi
from datadog_api_client.v2.model.teams_ownership_mapping_batch_operation import TeamsOwnershipMappingBatchOperation
from datadog_api_client.v2.model.teams_ownership_mapping_batch_operation_data import (
TeamsOwnershipMappingBatchOperationData,
)
from datadog_api_client.v2.model.teams_ownership_mapping_batch_operation_data_attributes import (
TeamsOwnershipMappingBatchOperationDataAttributes,
)
from datadog_api_client.v2.model.teams_ownership_mapping_batch_operation_op import TeamsOwnershipMappingBatchOperationOp
from datadog_api_client.v2.model.teams_ownership_mapping_batch_request import TeamsOwnershipMappingBatchRequest
from datadog_api_client.v2.model.teams_ownership_mapping_type import TeamsOwnershipMappingType
from datadog_api_client.v2.model.teams_ownership_match_type import TeamsOwnershipMatchType
body = TeamsOwnershipMappingBatchRequest(
atomic_operations=[
TeamsOwnershipMappingBatchOperation(
op=TeamsOwnershipMappingBatchOperationOp.ADD,
data=TeamsOwnershipMappingBatchOperationData(
type=TeamsOwnershipMappingType.TEAMS_OWNERSHIP_MAPPINGS,
attributes=TeamsOwnershipMappingBatchOperationDataAttributes(
team_handle="team-rum",
view_name="/checkout-examplerumteamsownership",
service="web-checkout-examplerumteamsownership",
match_type=TeamsOwnershipMatchType.EXACT,
),
),
),
],
)
configuration = Configuration()
configuration.access_token = environ["DD_BEARER_TOKEN"]
with ApiClient(configuration) as api_client:
api_instance = RumTeamsOwnershipApi(api_client)
response = api_instance.create_teams_ownership_mappings_batch(body=body)
print(response)
Instructions
First install the library and its dependencies and then save the example to example.py and run following commands:
DD_SITE="datadoghq.com" DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>" python3 "example.py"DD_SITE="us3.datadoghq.com" DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>" python3 "example.py"DD_SITE="us5.datadoghq.com" DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>" python3 "example.py"DD_SITE="datadoghq.eu" DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>" python3 "example.py"DD_SITE="ap1.datadoghq.com" DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>" python3 "example.py"DD_SITE="ap2.datadoghq.com" DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>" python3 "example.py"DD_SITE="uk1.datadoghq.com" DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>" python3 "example.py"DD_SITE="ddog-gov.com" DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>" python3 "example.py"DD_SITE="us2.ddog-gov.com" DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>" python3 "example.py"# Bulk create and remove teams ownership mappings returns "OK" response
require "datadog_api_client"
DatadogAPIClient.configure do |config|
config.access_token = ENV["DD_BEARER_TOKEN"]
end
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)
Instructions
First install the library and its dependencies and then save the example to example.rb and run following commands:
DD_SITE="datadoghq.com" DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>" rb "example.rb"DD_SITE="us3.datadoghq.com" DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>" rb "example.rb"DD_SITE="us5.datadoghq.com" DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>" rb "example.rb"DD_SITE="datadoghq.eu" DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>" rb "example.rb"DD_SITE="ap1.datadoghq.com" DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>" rb "example.rb"DD_SITE="ap2.datadoghq.com" DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>" rb "example.rb"DD_SITE="uk1.datadoghq.com" DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>" rb "example.rb"DD_SITE="ddog-gov.com" DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>" rb "example.rb"DD_SITE="us2.ddog-gov.com" DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>" rb "example.rb"// Bulk create and remove teams ownership mappings returns "OK" response
use datadog_api_client::datadog;
use datadog_api_client::datadogV2::api_rum_teams_ownership::RumTeamsOwnershipAPI;
use datadog_api_client::datadogV2::model::TeamsOwnershipMappingBatchOperation;
use datadog_api_client::datadogV2::model::TeamsOwnershipMappingBatchOperationData;
use datadog_api_client::datadogV2::model::TeamsOwnershipMappingBatchOperationDataAttributes;
use datadog_api_client::datadogV2::model::TeamsOwnershipMappingBatchOperationOp;
use datadog_api_client::datadogV2::model::TeamsOwnershipMappingBatchRequest;
use datadog_api_client::datadogV2::model::TeamsOwnershipMappingType;
use datadog_api_client::datadogV2::model::TeamsOwnershipMatchType;
#[tokio::main]
async fn main() {
let body =
TeamsOwnershipMappingBatchRequest::new(vec![TeamsOwnershipMappingBatchOperation::new(
TeamsOwnershipMappingBatchOperationOp::ADD,
)
.data(TeamsOwnershipMappingBatchOperationData::new(
TeamsOwnershipMappingBatchOperationDataAttributes::new()
.match_type(TeamsOwnershipMatchType::EXACT)
.service("web-checkout-examplerumteamsownership".to_string())
.team_handle("team-rum".to_string())
.view_name("/checkout-examplerumteamsownership".to_string()),
TeamsOwnershipMappingType::TEAMS_OWNERSHIP_MAPPINGS,
))]);
let configuration = datadog::Configuration::new();
let api = RumTeamsOwnershipAPI::with_config(configuration);
let resp = api.create_teams_ownership_mappings_batch(body).await;
if let Ok(value) = resp {
println!("{:#?}", value);
} else {
println!("{:#?}", resp.unwrap_err());
}
}
Instructions
First install the library and its dependencies and then save the example to src/main.rs and run following commands:
DD_SITE="datadoghq.com" DD_API_KEY="<API-KEY>" DD_APP_KEY="<APP-KEY>" cargo runDD_SITE="us3.datadoghq.com" DD_API_KEY="<API-KEY>" DD_APP_KEY="<APP-KEY>" cargo runDD_SITE="us5.datadoghq.com" DD_API_KEY="<API-KEY>" DD_APP_KEY="<APP-KEY>" cargo runDD_SITE="datadoghq.eu" DD_API_KEY="<API-KEY>" DD_APP_KEY="<APP-KEY>" cargo runDD_SITE="ap1.datadoghq.com" DD_API_KEY="<API-KEY>" DD_APP_KEY="<APP-KEY>" cargo runDD_SITE="ap2.datadoghq.com" DD_API_KEY="<API-KEY>" DD_APP_KEY="<APP-KEY>" cargo runDD_SITE="uk1.datadoghq.com" DD_API_KEY="<API-KEY>" DD_APP_KEY="<APP-KEY>" cargo runDD_SITE="ddog-gov.com" DD_API_KEY="<API-KEY>" DD_APP_KEY="<APP-KEY>" cargo runDD_SITE="us2.ddog-gov.com" DD_API_KEY="<API-KEY>" DD_APP_KEY="<APP-KEY>" cargo run/**
* Bulk create and remove teams ownership mappings returns "OK" response
*/
import { client, v2 } from "@datadog/datadog-api-client";
const configuration = client.createConfiguration({
authMethods: {
AuthZ: {
accessToken: process.env.DD_BEARER_TOKEN as string,
},
},
});
const apiInstance = new v2.RumTeamsOwnershipApi(configuration);
const params: v2.RumTeamsOwnershipApiCreateTeamsOwnershipMappingsBatchRequest =
{
body: {
atomicOperations: [
{
op: "add",
data: {
type: "teams_ownership_mappings",
attributes: {
teamHandle: "team-rum",
viewName: "/checkout-examplerumteamsownership",
service: "web-checkout-examplerumteamsownership",
matchType: "exact",
},
},
},
],
},
};
apiInstance
.createTeamsOwnershipMappingsBatch(params)
.then((data: v2.TeamsOwnershipMappingBatchResponse) => {
console.log(
"API called successfully. Returned data: " + JSON.stringify(data)
);
})
.catch((error: any) => console.error(error));
Instructions
First install the library and its dependencies and then save the example to example.ts and run following commands:
DD_SITE="datadoghq.com" DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>" tsc "example.ts"DD_SITE="us3.datadoghq.com" DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>" tsc "example.ts"DD_SITE="us5.datadoghq.com" DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>" tsc "example.ts"DD_SITE="datadoghq.eu" DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>" tsc "example.ts"DD_SITE="ap1.datadoghq.com" DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>" tsc "example.ts"DD_SITE="ap2.datadoghq.com" DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>" tsc "example.ts"DD_SITE="uk1.datadoghq.com" DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>" tsc "example.ts"DD_SITE="ddog-gov.com" DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>" tsc "example.ts"DD_SITE="us2.ddog-gov.com" DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>" tsc "example.ts"