Create a teams ownership mapping for your organization.
Returns the teams ownership mapping object from the request body when the request is successful.
요청
Body Data (required)
The definition of the teams ownership mapping to create.
The JSON:API data envelope for a teams ownership mapping create request.
attributes [required]
object
The attributes of the teams ownership mapping to create.
application_id
uuid
The 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_type
enum
How the view_name is matched against RUM view names.
Allowed enum values: exact,prefix
default: exact
service
string
The 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_handle [required]
string
The handle of the team that owns the matched RUM views.
view_name [required]
string
The RUM view name to match, or its prefix when match_type is prefix.
type [required]
enum
The type of the resource. The value should always be teams_ownership_mappings.
Allowed enum values: teams_ownership_mappings
The response body for a single teams ownership mapping.
Expand All
항목
유형
설명
data [required]
object
The JSON:API data envelope for a teams ownership mapping.
attributes [required]
object
The attributes of a teams ownership mapping.
application_id [required]
string
The ID of the RUM application this mapping applies to.
For browser applications, this is the real application UUID.
For mobile applications, this is the nil UUID 00000000-0000-0000-0000-000000000000 (wildcard), meaning the ownership applies across all applications.
created_at [required]
date-time
Timestamp when the mapping was created.
created_by [required]
string
The UUID of the user who created the mapping.
match_type [required]
enum
How the view_name is matched against RUM view names.
Allowed enum values: exact,prefix
default: exact
org_id [required]
int64
The ID of the organization that owns this mapping.
service [required]
string
The RUM application's service name. For browser applications, may be empty. For mobile applications, this is the service that scopes the ownership.
team_handle [required]
string
The handle of the team that owns the matched RUM views.
view_name [required]
string
The RUM view name to match, or its prefix when match_type is prefix.
id [required]
string
The unique identifier of the teams ownership mapping.
type [required]
enum
The type of the resource. The value should always be teams_ownership_mappings.
Allowed enum values: teams_ownership_mappings
"""
Create a teams ownership mapping returns "Created" response
"""fromdatadog_api_clientimportApiClient,Configurationfromdatadog_api_client.v2.api.rum_teams_ownership_apiimportRumTeamsOwnershipApifromdatadog_api_client.v2.model.teams_ownership_mapping_create_dataimportTeamsOwnershipMappingCreateDatafromdatadog_api_client.v2.model.teams_ownership_mapping_create_data_attributesimport(TeamsOwnershipMappingCreateDataAttributes,)fromdatadog_api_client.v2.model.teams_ownership_mapping_create_requestimportTeamsOwnershipMappingCreateRequestfromdatadog_api_client.v2.model.teams_ownership_mapping_typeimportTeamsOwnershipMappingTypefromdatadog_api_client.v2.model.teams_ownership_match_typeimportTeamsOwnershipMatchTypefromuuidimportUUIDbody=TeamsOwnershipMappingCreateRequest(data=TeamsOwnershipMappingCreateData(attributes=TeamsOwnershipMappingCreateDataAttributes(application_id=UUID("11111111-2222-3333-4444-555555555555"),match_type=TeamsOwnershipMatchType.EXACT,service="web-checkout",team_handle="team-rum",view_name="/checkout",),type=TeamsOwnershipMappingType.TEAMS_OWNERSHIP_MAPPINGS,),)configuration=Configuration()configuration.unstable_operations["create_teams_ownership_mapping"]=TruewithApiClient(configuration)asapi_client:api_instance=RumTeamsOwnershipApi(api_client)response=api_instance.create_teams_ownership_mapping(body=body)print(response)
# Create a teams ownership mapping returns "Created" responserequire"datadog_api_client"DatadogAPIClient.configuredo|config|config.unstable_operations["v2.create_teams_ownership_mapping".to_sym]=trueendapi_instance=DatadogAPIClient::V2::RumTeamsOwnershipAPI.newbody=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,}),})papi_instance.create_teams_ownership_mapping(body)
// Create a teams ownership mapping returns "Created" responsepackagemainimport("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""github.com/google/uuid")funcmain(){body:=datadogV2.TeamsOwnershipMappingCreateRequest{Data:datadogV2.TeamsOwnershipMappingCreateData{Attributes:datadogV2.TeamsOwnershipMappingCreateDataAttributes{ApplicationId:datadog.PtrUUID(uuid.MustParse("11111111-2222-3333-4444-555555555555")),MatchType:datadogV2.TEAMSOWNERSHIPMATCHTYPE_EXACT.Ptr(),Service:datadog.PtrString("web-checkout"),TeamHandle:"team-rum",ViewName:"/checkout",},Type:datadogV2.TEAMSOWNERSHIPMAPPINGTYPE_TEAMS_OWNERSHIP_MAPPINGS,},}ctx:=datadog.NewDefaultContext(context.Background())configuration:=datadog.NewConfiguration()configuration.SetUnstableOperationEnabled("v2.CreateTeamsOwnershipMapping",true)apiClient:=datadog.NewAPIClient(configuration)api:=datadogV2.NewRumTeamsOwnershipApi(apiClient)resp,r,err:=api.CreateTeamsOwnershipMapping(ctx,body)iferr!=nil{fmt.Fprintf(os.Stderr,"Error when calling `RumTeamsOwnershipApi.CreateTeamsOwnershipMapping`: %v\n",err)fmt.Fprintf(os.Stderr,"Full HTTP response: %v\n",r)}responseContent,_:=json.MarshalIndent(resp,""," ")fmt.Fprintf(os.Stdout,"Response from `RumTeamsOwnershipApi.CreateTeamsOwnershipMapping`:\n%s\n",responseContent)}
DD_SITE="datadoghq.comus3.datadoghq.comus5.datadoghq.comdatadoghq.euap1.datadoghq.comap2.datadoghq.comuk1.datadoghq.comddog-gov.comus2.ddog-gov.com"DD_API_KEY="<API-KEY>"DD_APP_KEY="<APP-KEY>"cargo run
/**
* Create a teams ownership mapping returns "Created" response
*/import{client,v2}from"@datadog/datadog-api-client";constconfiguration=client.createConfiguration();configuration.unstableOperations["v2.createTeamsOwnershipMapping"]=true;constapiInstance=newv2.RumTeamsOwnershipApi(configuration);constparams: v2.RumTeamsOwnershipApiCreateTeamsOwnershipMappingRequest={body:{data:{attributes:{applicationId:"11111111-2222-3333-4444-555555555555",matchType:"exact",service:"web-checkout",teamHandle:"team-rum",viewName:"/checkout",},type:"teams_ownership_mappings",},},};apiInstance.createTeamsOwnershipMapping(params).then((data: v2.TeamsOwnershipMappingResponse)=>{console.log("API called successfully. Returned data: "+JSON.stringify(data));}).catch((error: any)=>console.error(error));