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

Large diffs are not rendered by default.

160 changes: 160 additions & 0 deletions features/v2/integration_accounts.feature
Original file line number Diff line number Diff line change
@@ -0,0 +1,160 @@
@endpoint(integration-accounts) @endpoint(integration-accounts-v2)
Feature: Integration Accounts
Manage accounts for Datadog integrations served by the Account Management
Service (AMS). The account payload is strongly typed per integration and
interface.

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

@generated @skip @team:DataDog/saas-integrations
Scenario: Create an integration account returns "Bad Request" response
Given operation "CreateIntegrationAccount" enabled
And new "CreateIntegrationAccount" request
And request contains "integration_id" parameter from "REPLACE.ME"
And request contains "interface_id" parameter from "REPLACE.ME"
And body with value {"data": {"attributes": {"integration": {"interface": {"authentication": {"api_key": "SKxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", "api_key_token": "your-api-key-secret", "type": "basic"}, "dataflows": [{"enabled": true, "id": "twilio-messages-logs"}], "settings": {"account_sid": "ACxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", "censor_logs": true}, "type": "twilio"}, "type": "twilio"}, "name": "twilio-prod"}, "type": "integration-account"}}
When the request is sent
Then the response status is 400 Bad Request

@generated @skip @team:DataDog/saas-integrations
Scenario: Create an integration account returns "Created" response
Given operation "CreateIntegrationAccount" enabled
And new "CreateIntegrationAccount" request
And request contains "integration_id" parameter from "REPLACE.ME"
And request contains "interface_id" parameter from "REPLACE.ME"
And body with value {"data": {"attributes": {"integration": {"interface": {"authentication": {"api_key": "SKxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", "api_key_token": "your-api-key-secret", "type": "basic"}, "dataflows": [{"enabled": true, "id": "twilio-messages-logs"}], "settings": {"account_sid": "ACxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", "censor_logs": true}, "type": "twilio"}, "type": "twilio"}, "name": "twilio-prod"}, "type": "integration-account"}}
When the request is sent
Then the response status is 201 Created

@generated @skip @team:DataDog/saas-integrations
Scenario: Create an integration account returns "Not Found" response
Given operation "CreateIntegrationAccount" enabled
And new "CreateIntegrationAccount" request
And request contains "integration_id" parameter from "REPLACE.ME"
And request contains "interface_id" parameter from "REPLACE.ME"
And body with value {"data": {"attributes": {"integration": {"interface": {"authentication": {"api_key": "SKxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", "api_key_token": "your-api-key-secret", "type": "basic"}, "dataflows": [{"enabled": true, "id": "twilio-messages-logs"}], "settings": {"account_sid": "ACxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", "censor_logs": true}, "type": "twilio"}, "type": "twilio"}, "name": "twilio-prod"}, "type": "integration-account"}}
When the request is sent
Then the response status is 404 Not Found

@generated @skip @team:DataDog/saas-integrations
Scenario: Delete an integration account returns "Bad Request" response
Given operation "DeleteIntegrationAccount" enabled
And new "DeleteIntegrationAccount" request
And request contains "integration_id" parameter from "REPLACE.ME"
And request contains "interface_id" parameter from "REPLACE.ME"
And request contains "account_id" parameter from "REPLACE.ME"
When the request is sent
Then the response status is 400 Bad Request

@generated @skip @team:DataDog/saas-integrations
Scenario: Delete an integration account returns "No Content" response
Given operation "DeleteIntegrationAccount" enabled
And new "DeleteIntegrationAccount" request
And request contains "integration_id" parameter from "REPLACE.ME"
And request contains "interface_id" parameter from "REPLACE.ME"
And request contains "account_id" parameter from "REPLACE.ME"
When the request is sent
Then the response status is 204 No Content

@generated @skip @team:DataDog/saas-integrations
Scenario: Delete an integration account returns "Not Found" response
Given operation "DeleteIntegrationAccount" enabled
And new "DeleteIntegrationAccount" request
And request contains "integration_id" parameter from "REPLACE.ME"
And request contains "interface_id" parameter from "REPLACE.ME"
And request contains "account_id" parameter from "REPLACE.ME"
When the request is sent
Then the response status is 404 Not Found

@generated @skip @team:DataDog/saas-integrations
Scenario: Get an integration account returns "Bad Request" response
Given operation "GetIntegrationAccount" enabled
And new "GetIntegrationAccount" request
And request contains "integration_id" parameter from "REPLACE.ME"
And request contains "interface_id" parameter from "REPLACE.ME"
And request contains "account_id" parameter from "REPLACE.ME"
When the request is sent
Then the response status is 400 Bad Request

@generated @skip @team:DataDog/saas-integrations
Scenario: Get an integration account returns "Not Found" response
Given operation "GetIntegrationAccount" enabled
And new "GetIntegrationAccount" request
And request contains "integration_id" parameter from "REPLACE.ME"
And request contains "interface_id" parameter from "REPLACE.ME"
And request contains "account_id" parameter from "REPLACE.ME"
When the request is sent
Then the response status is 404 Not Found

@generated @skip @team:DataDog/saas-integrations
Scenario: Get an integration account returns "OK" response
Given operation "GetIntegrationAccount" enabled
And new "GetIntegrationAccount" request
And request contains "integration_id" parameter from "REPLACE.ME"
And request contains "interface_id" parameter from "REPLACE.ME"
And request contains "account_id" parameter from "REPLACE.ME"
When the request is sent
Then the response status is 200 OK

@generated @skip @team:DataDog/saas-integrations
Scenario: List integration accounts returns "Bad Request" response
Given operation "ListIntegrationAccounts" enabled
And new "ListIntegrationAccounts" request
And request contains "integration_id" parameter from "REPLACE.ME"
And request contains "interface_id" parameter from "REPLACE.ME"
When the request is sent
Then the response status is 400 Bad Request

@generated @skip @team:DataDog/saas-integrations
Scenario: List integration accounts returns "Not Found" response
Given operation "ListIntegrationAccounts" enabled
And new "ListIntegrationAccounts" request
And request contains "integration_id" parameter from "REPLACE.ME"
And request contains "interface_id" parameter from "REPLACE.ME"
When the request is sent
Then the response status is 404 Not Found

@generated @skip @team:DataDog/saas-integrations
Scenario: List integration accounts returns "OK" response
Given operation "ListIntegrationAccounts" enabled
And new "ListIntegrationAccounts" request
And request contains "integration_id" parameter from "REPLACE.ME"
And request contains "interface_id" parameter from "REPLACE.ME"
When the request is sent
Then the response status is 200 OK

@generated @skip @team:DataDog/saas-integrations
Scenario: Update an integration account returns "Bad Request" response
Given operation "UpdateIntegrationAccount" enabled
And new "UpdateIntegrationAccount" request
And request contains "integration_id" parameter from "REPLACE.ME"
And request contains "interface_id" parameter from "REPLACE.ME"
And request contains "account_id" parameter from "REPLACE.ME"
And body with value {"data": {"attributes": {"integration": {"interface": {"authentication": {"api_key": "SKxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", "api_key_token": "your-api-key-secret", "type": "basic"}, "dataflows": [{"enabled": true, "id": "twilio-messages-logs"}], "settings": {"account_sid": "ACxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", "censor_logs": true}, "type": "twilio"}, "type": "twilio"}, "name": "twilio-prod"}, "type": "integration-account"}}
When the request is sent
Then the response status is 400 Bad Request

@generated @skip @team:DataDog/saas-integrations
Scenario: Update an integration account returns "Not Found" response
Given operation "UpdateIntegrationAccount" enabled
And new "UpdateIntegrationAccount" request
And request contains "integration_id" parameter from "REPLACE.ME"
And request contains "interface_id" parameter from "REPLACE.ME"
And request contains "account_id" parameter from "REPLACE.ME"
And body with value {"data": {"attributes": {"integration": {"interface": {"authentication": {"api_key": "SKxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", "api_key_token": "your-api-key-secret", "type": "basic"}, "dataflows": [{"enabled": true, "id": "twilio-messages-logs"}], "settings": {"account_sid": "ACxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", "censor_logs": true}, "type": "twilio"}, "type": "twilio"}, "name": "twilio-prod"}, "type": "integration-account"}}
When the request is sent
Then the response status is 404 Not Found

@generated @skip @team:DataDog/saas-integrations
Scenario: Update an integration account returns "OK" response
Given operation "UpdateIntegrationAccount" enabled
And new "UpdateIntegrationAccount" request
And request contains "integration_id" parameter from "REPLACE.ME"
And request contains "interface_id" parameter from "REPLACE.ME"
And request contains "account_id" parameter from "REPLACE.ME"
And body with value {"data": {"attributes": {"integration": {"interface": {"authentication": {"api_key": "SKxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", "api_key_token": "your-api-key-secret", "type": "basic"}, "dataflows": [{"enabled": true, "id": "twilio-messages-logs"}], "settings": {"account_sid": "ACxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", "censor_logs": true}, "type": "twilio"}, "type": "twilio"}, "name": "twilio-prod"}, "type": "integration-account"}}
When the request is sent
Then the response status is 200 OK
45 changes: 45 additions & 0 deletions features/v2/undo.json
Original file line number Diff line number Diff line change
Expand Up @@ -4349,6 +4349,51 @@
"type": "idempotent"
}
},
"ListIntegrationAccounts": {
"tag": "Integration Accounts",
"undo": {
"type": "safe"
}
},
"CreateIntegrationAccount": {
"tag": "Integration Accounts",
"undo": {
"operationId": "DeleteIntegrationAccount",
"parameters": [
{
"name": "integration_id",
"source": "integration_id"
},
{
"name": "interface_id",
"source": "interface_id"
},
{
"name": "account_id",
"source": "data.id"
}
],
"type": "unsafe"
}
},
"DeleteIntegrationAccount": {
"tag": "Integration Accounts",
"undo": {
"type": "idempotent"
}
},
"GetIntegrationAccount": {
"tag": "Integration Accounts",
"undo": {
"type": "safe"
}
},
"UpdateIntegrationAccount": {
"tag": "Integration Accounts",
"undo": {
"type": "idempotent"
}
},
"GetIPAllowlist": {
"tag": "IP Allowlist",
"undo": {
Expand Down
1 change: 1 addition & 0 deletions packages/datadog-api-client/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -412,6 +412,7 @@ apiInstance
| Hosts | @datadog/datadog-api-client-hosts | [README.md](../../services/hosts/README.md) |
| Identity Providers | @datadog/datadog-api-client-identity-providers | [README.md](../../services/identity-providers/README.md) |
| Incidents | @datadog/datadog-api-client-incidents | [README.md](../../services/incidents/README.md) |
| Integration Accounts | @datadog/datadog-api-client-integration-accounts | [README.md](../../services/integration-accounts/README.md) |
| Integrations | @datadog/datadog-api-client-integrations | [README.md](../../services/integrations/README.md) |
| IP Allowlist | @datadog/datadog-api-client-ip-allowlist | [README.md](../../services/ip-allowlist/README.md) |
| IP Ranges | @datadog/datadog-api-client-ip-ranges | [README.md](../../services/ip-ranges/README.md) |
Expand Down
75 changes: 75 additions & 0 deletions private/bdd_runner/src/support/scenarios_model_mapping.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11598,6 +11598,81 @@ export const ScenariosModelMappings: { [key: string]: OperationMapping } = {
},
operationResponseType: "OktaAccountResponse",
},
"IntegrationAccountsApi.V2.ListIntegrationAccounts": {
integrationId: {
type: "IntegrationAccountIntegrationId",
format: "",
},
interfaceId: {
type: "IntegrationAccountInterfaceId",
format: "",
},
operationResponseType: "IntegrationAccountsResponse",
},
"IntegrationAccountsApi.V2.CreateIntegrationAccount": {
integrationId: {
type: "IntegrationAccountIntegrationId",
format: "",
},
interfaceId: {
type: "IntegrationAccountInterfaceId",
format: "",
},
body: {
type: "IntegrationAccountRequest",
format: "",
},
operationResponseType: "IntegrationAccountResponse",
},
"IntegrationAccountsApi.V2.GetIntegrationAccount": {
integrationId: {
type: "IntegrationAccountIntegrationId",
format: "",
},
interfaceId: {
type: "IntegrationAccountInterfaceId",
format: "",
},
accountId: {
type: "string",
format: "",
},
operationResponseType: "IntegrationAccountResponse",
},
"IntegrationAccountsApi.V2.DeleteIntegrationAccount": {
integrationId: {
type: "IntegrationAccountIntegrationId",
format: "",
},
interfaceId: {
type: "IntegrationAccountInterfaceId",
format: "",
},
accountId: {
type: "string",
format: "",
},
operationResponseType: "{}",
},
"IntegrationAccountsApi.V2.UpdateIntegrationAccount": {
integrationId: {
type: "IntegrationAccountIntegrationId",
format: "",
},
interfaceId: {
type: "IntegrationAccountInterfaceId",
format: "",
},
accountId: {
type: "string",
format: "",
},
body: {
type: "IntegrationAccountUpdateRequest",
format: "",
},
operationResponseType: "IntegrationAccountResponse",
},
"IPAllowlistApi.V2.GetIPAllowlist": {
operationResponseType: "IPAllowlistResponse",
},
Expand Down
8 changes: 0 additions & 8 deletions services/ddsql/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,14 +28,6 @@ import { DDSQLApiV2 } from "@datadog/datadog-api-client-ddsql";
import { v2 } from "@datadog/datadog-api-client-ddsql";

const configuration = createConfiguration();
// Enable unstable operations
const configurationOpts = {
unstableOperations: {
"DDSQLApi.v2.executeDdsqlTabularQuery": true
}
}

const configuration = createConfiguration(configurationOpts);
const apiInstance = new DDSQLApiV2(configuration);
const params = {/* parameters */};

Expand Down
12 changes: 0 additions & 12 deletions services/ddsql/src/v2/DDSQLApi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,12 +44,6 @@ export class DDSQLApiRequestFactory extends BaseAPIRequestFactory {
): Promise<RequestContext> {
const _config = _options || this.configuration;

if (!_config.unstableOperations["DDSQLApi.v2.executeDdsqlTabularQuery"]) {
throw new Error(
"Unstable operation 'executeDdsqlTabularQuery' is disabled. Enable it by setting `configuration.unstableOperations['DDSQLApi.v2.executeDdsqlTabularQuery'] = true`",
);
}

// verify required parameter 'body' is not null or undefined
if (body === null || body === undefined) {
throw new RequiredError("body", "executeDdsqlTabularQuery");
Expand Down Expand Up @@ -100,12 +94,6 @@ export class DDSQLApiRequestFactory extends BaseAPIRequestFactory {
): Promise<RequestContext> {
const _config = _options || this.configuration;

if (!_config.unstableOperations["DDSQLApi.v2.fetchDdsqlTabularQuery"]) {
throw new Error(
"Unstable operation 'fetchDdsqlTabularQuery' is disabled. Enable it by setting `configuration.unstableOperations['DDSQLApi.v2.fetchDdsqlTabularQuery'] = true`",
);
}

// verify required parameter 'body' is not null or undefined
if (body === null || body === undefined) {
throw new RequiredError("body", "fetchDdsqlTabularQuery");
Expand Down
14 changes: 11 additions & 3 deletions services/ddsql/src/v2/models/DdsqlTabularQueryColumn.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,17 @@ export class DdsqlTabularQueryColumn {
*/
"type": string;
/**
* Column values in row order. The element type matches the column's `type`;
* for example a `VARCHAR` column carries strings, a `TIMESTAMP` column carries
* Unix-millisecond integers. `null` is allowed for missing values.
* Column values in row order, one entry per result row. The element type
* follows the column's `type`. The following serialization rules should be
* taken into account:
*
* - `BIGINT` values are encoded as JSON numbers in the signed 64-bit integer range.
* - `DECIMAL` values are encoded as JSON numbers with 64-bit double precision.
* - `TIMESTAMP` and `DATE` values are encoded as Unix-millisecond integers; a
* `DATE` resolves to midnight UTC.
* - `JSON` values are returned as a JSON-encoded string.
*
* `null` is allowed for any column type where a value is missing.
*/
"values": Array<any>;
/**
Expand Down
1 change: 1 addition & 0 deletions services/integration_accounts/.yarnrc.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
nodeLinker: node-modules
Loading
Loading