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
9 changes: 3 additions & 6 deletions .generator/schemas/v2/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -83168,7 +83168,7 @@ paths:
- teams_read
summary: Delete team connections
tags:
- Team Connections
- Teams
x-permission:
operator: OR
permissions:
Expand Down Expand Up @@ -83247,7 +83247,7 @@ paths:
- teams_read
summary: List team connections
tags:
- Team Connections
- Teams
x-pagination:
limitParam: page[size]
pageParam: page[number]
Expand Down Expand Up @@ -83291,7 +83291,7 @@ paths:
- teams_read
summary: Create team connections
tags:
- Team Connections
- Teams
x-permission:
operator: OR
permissions:
Expand Down Expand Up @@ -86612,9 +86612,6 @@ tags:
use Datadog\u2019s API to\nmanage both test types programmatically.\n\nFor more
information about Synthetics, see the [Synthetics overview](https://docs.datadoghq.com/synthetics/)."
name: Synthetics
- description: View and manage relationships between Datadog teams and teams from
external sources, such as GitHub.
name: Team Connections
- description: View and manage teams within Datadog. See the [Teams page](https://docs.datadoghq.com/account_management/teams/)
for more information.
name: Teams
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@ import { client, v2 } from "@datadog/datadog-api-client";

const configuration = client.createConfiguration();
configuration.unstableOperations["v2.createTeamConnections"] = true;
const apiInstance = new v2.TeamConnectionsApi(configuration);
const apiInstance = new v2.TeamsApi(configuration);

// there is a valid "dd_team" in the system
const DD_TEAM_DATA_ID = process.env.DD_TEAM_DATA_ID as string;

const params: v2.TeamConnectionsApiCreateTeamConnectionsRequest = {
const params: v2.TeamsApiCreateTeamConnectionsRequest = {
body: {
data: [
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ import { client, v2 } from "@datadog/datadog-api-client";

const configuration = client.createConfiguration();
configuration.unstableOperations["v2.deleteTeamConnections"] = true;
const apiInstance = new v2.TeamConnectionsApi(configuration);
const apiInstance = new v2.TeamsApi(configuration);

const params: v2.TeamConnectionsApiDeleteTeamConnectionsRequest = {
const params: v2.TeamsApiDeleteTeamConnectionsRequest = {
body: {
data: [
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { client, v2 } from "@datadog/datadog-api-client";

const configuration = client.createConfiguration();
configuration.unstableOperations["v2.listTeamConnections"] = true;
const apiInstance = new v2.TeamConnectionsApi(configuration);
const apiInstance = new v2.TeamsApi(configuration);

apiInstance
.listTeamConnections()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ import { client, v2 } from "@datadog/datadog-api-client";

const configuration = client.createConfiguration();
configuration.unstableOperations["v2.listTeamConnections"] = true;
const apiInstance = new v2.TeamConnectionsApi(configuration);
const apiInstance = new v2.TeamsApi(configuration);

const params: v2.TeamConnectionsApiListTeamConnectionsRequest = {
const params: v2.TeamsApiListTeamConnectionsRequest = {
pageSize: 10,
filterSources: ["github"],
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { client, v2 } from "@datadog/datadog-api-client";

const configuration = client.createConfiguration();
configuration.unstableOperations["v2.listTeamConnections"] = true;
const apiInstance = new v2.TeamConnectionsApi(configuration);
const apiInstance = new v2.TeamsApi(configuration);

(async () => {
try {
Expand Down
82 changes: 41 additions & 41 deletions features/support/scenarios_model_mapping.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8908,6 +8908,47 @@ export const ScenariosModelMappings: {[key: string]: {[key: string]: any}} = {
},
"operationResponseType": "{}",
},
"v2.ListTeamConnections": {
"pageSize": {
"type": "number",
"format": "int64",
},
"pageNumber": {
"type": "number",
"format": "int64",
},
"filterSources": {
"type": "Array<string>",
"format": "",
},
"filterTeamIds": {
"type": "Array<string>",
"format": "",
},
"filterConnectedTeamIds": {
"type": "Array<string>",
"format": "",
},
"filterConnectionIds": {
"type": "Array<string>",
"format": "",
},
"operationResponseType": "TeamConnectionsResponse",
},
"v2.CreateTeamConnections": {
"body": {
"type": "TeamConnectionCreateRequest",
"format": "",
},
"operationResponseType": "TeamConnectionsResponse",
},
"v2.DeleteTeamConnections": {
"body": {
"type": "TeamConnectionDeleteRequest",
"format": "",
},
"operationResponseType": "{}",
},
"v2.GetTeamSync": {
"filterSource": {
"type": "TeamSyncAttributesSource",
Expand Down Expand Up @@ -9132,47 +9173,6 @@ export const ScenariosModelMappings: {[key: string]: {[key: string]: any}} = {
},
"operationResponseType": "UserTeamsResponse",
},
"v2.ListTeamConnections": {
"pageSize": {
"type": "number",
"format": "int64",
},
"pageNumber": {
"type": "number",
"format": "int64",
},
"filterSources": {
"type": "Array<string>",
"format": "",
},
"filterTeamIds": {
"type": "Array<string>",
"format": "",
},
"filterConnectedTeamIds": {
"type": "Array<string>",
"format": "",
},
"filterConnectionIds": {
"type": "Array<string>",
"format": "",
},
"operationResponseType": "TeamConnectionsResponse",
},
"v2.CreateTeamConnections": {
"body": {
"type": "TeamConnectionCreateRequest",
"format": "",
},
"operationResponseType": "TeamConnectionsResponse",
},
"v2.DeleteTeamConnections": {
"body": {
"type": "TeamConnectionDeleteRequest",
"format": "",
},
"operationResponseType": "{}",
},
"v2.ListIncidentTeams": {
"include": {
"type": "IncidentRelatedObject",
Expand Down
4 changes: 2 additions & 2 deletions features/v2/given.json
Original file line number Diff line number Diff line change
Expand Up @@ -350,7 +350,7 @@
"parameters": [
{
"name": "body",
"value": "{\n \"data\": {\n \"type\": \"deployment_gate\",\n \"attributes\": {\n \"service\": \"my-service\",\n \"env\": \"production\",\n \"identifier\": \"my-gate-{{ unique_lower_alnum }}\",\n \"dry_run\": false\n }\n }\n}"
"value": "{\n \"data\": {\n \"type\": \"deployment_gate\",\n \"attributes\": {\n \"service\": \"my-service\",\n \"env\": \"production\",\n \"identifier\": \"my-gate\",\n \"dry_run\": false\n }\n }\n}"
}
],
"step": "there is a valid \"deployment_gate\" in the system",
Expand Down Expand Up @@ -1209,7 +1209,7 @@
"source": "data.data[0]",
"step": "there is a valid \"team_connection\" in the system",
"key": "team_connection",
"tag": "Team Connections",
"tag": "Teams",
"operationId": "CreateTeamConnections"
},
{
Expand Down
93 changes: 0 additions & 93 deletions features/v2/team_connections.feature

This file was deleted.

84 changes: 84 additions & 0 deletions features/v2/teams.feature
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,60 @@ Feature: Teams
And the response "data.attributes.visible_modules" is equal to ["m1","m2"]
And the response "data.attributes.hidden_modules" is equal to ["m3"]

@skip @team:DataDog/aaa-omg
Scenario: Create team connections returns "Bad Request" response
Given operation "CreateTeamConnections" enabled
And new "CreateTeamConnections" request
And body with value {"data": [{"attributes": {"source": "github"}, "relationships": {"connected_team": {"data": {"id": "@MyGitHubAccount/my-team-name", "type": "github_team"}}, "team": {"data": {"type": "team"}}}, "type": "team_connection"}]}
When the request is sent
Then the response status is 400 Bad Request

@generated @skip @team:DataDog/aaa-omg
Scenario: Create team connections returns "Conflict" response
Given operation "CreateTeamConnections" enabled
And new "CreateTeamConnections" request
And body with value {"data": [{"attributes": {"managed_by": "github_sync", "source": "github"}, "relationships": {"connected_team": {"data": {"id": "@GitHubOrg/team-handle", "type": "github_team"}}, "team": {"data": {"id": "87654321-4321-8765-dcba-210987654321", "type": "team"}}}, "type": "team_connection"}]}
When the request is sent
Then the response status is 409 Conflict

@skip @team:DataDog/aaa-omg
Scenario: Create team connections returns "Created" response
Given operation "CreateTeamConnections" enabled
And new "CreateTeamConnections" request
And there is a valid "dd_team" in the system
And body with value {"data": [{"type": "team_connection", "attributes": {"source": "github", "managed_by": "datadog"}, "relationships": {"team": {"data": {"id": "{{ dd_team.data.id }}", "type": "team"}}, "connected_team": {"data": {"id": "@MyGitHubAccount/my-team-name", "type": "github_team"}}}}]}
When the request is sent
Then the response status is 201 Created
And the response "data.data[0].attributes.source" is equal to "github"
And the response "data.data[0].attributes.managed_by" is equal to "datadog"
And the response "data.data[0].relationships.team.data.id" is equal to "{{ dd_team.data.id }}"
And the response "data.data[0].relationships.connected_team.data.id" is equal to "@MyGitHubAccount/my-team-name"
And the response "data.data[0].type" is equal to "team_connection"

@skip @team:DataDog/aaa-omg
Scenario: Delete team connections returns "Bad Request" response
Given operation "DeleteTeamConnections" enabled
And new "DeleteTeamConnections" request
And body with value {"data": [{"type": "team_connection"}]}
When the request is sent
Then the response status is 400 Bad Request

@generated @skip @team:DataDog/aaa-omg
Scenario: Delete team connections returns "No Content" response
Given operation "DeleteTeamConnections" enabled
And new "DeleteTeamConnections" request
And body with value {"data": [{"id": "12345678-1234-5678-9abc-123456789012", "type": "team_connection"}]}
When the request is sent
Then the response status is 204 No Content

@generated @skip @team:DataDog/aaa-omg
Scenario: Delete team connections returns "Not Found" response
Given operation "DeleteTeamConnections" enabled
And new "DeleteTeamConnections" request
And body with value {"data": [{"id": "12345678-1234-5678-9abc-123456789012", "type": "team_connection"}]}
When the request is sent
Then the response status is 404 Not Found

@team:DataDog/aaa-omg
Scenario: Get a team hierarchy link returns "API error response." response
Given new "GetTeamHierarchyLink" request
Expand Down Expand Up @@ -341,6 +395,36 @@ Feature: Teams
When the request is sent
Then the response status is 200 OK

@generated @skip @team:DataDog/aaa-omg
Scenario: List team connections returns "Bad Request" response
Given operation "ListTeamConnections" enabled
And new "ListTeamConnections" request
When the request is sent
Then the response status is 400 Bad Request

@generated @skip @team:DataDog/aaa-omg
Scenario: List team connections returns "OK" response
Given operation "ListTeamConnections" enabled
And new "ListTeamConnections" request
When the request is sent
Then the response status is 200 OK

@generated @skip @team:DataDog/aaa-omg @with-pagination
Scenario: List team connections returns "OK" response with pagination
Given operation "ListTeamConnections" enabled
And new "ListTeamConnections" request
When the request with pagination is sent
Then the response status is 200 OK

@skip @team:DataDog/aaa-omg
Scenario: List team connections with filters returns "OK" response
Given operation "ListTeamConnections" enabled
And new "ListTeamConnections" request
And request contains "filter[sources]" parameter with value ["github"]
And request contains "page[size]" parameter with value 10
When the request is sent
Then the response status is 200 OK

@generated @skip @team:DataDog/aaa-omg
Scenario: Remove a member team returns "API error response." response
Given operation "RemoveMemberTeam" enabled
Expand Down
Loading
Loading