Skip to content

Commit e02cf77

Browse files
api-clients-generation-pipeline[bot]ci.datadog-api-spec
andauthored
Regenerate client from commit fccf269 of spec repo (#244)
Co-authored-by: ci.datadog-api-spec <[email protected]> Co-authored-by: api-clients-generation-pipeline[bot] <54105614+api-clients-generation-pipeline[bot]@users.noreply.github.com>
1 parent 2c50a81 commit e02cf77

18 files changed

+704
-4
lines changed

.apigentools-info

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,13 @@
44
"spec_versions": {
55
"v1": {
66
"apigentools_version": "1.4.1.dev11",
7-
"regenerated": "2021-08-24 09:06:27.618499",
8-
"spec_repo_commit": "67944e6"
7+
"regenerated": "2021-08-24 15:38:00.660475",
8+
"spec_repo_commit": "fccf269"
99
},
1010
"v2": {
1111
"apigentools_version": "1.4.1.dev11",
12-
"regenerated": "2021-08-24 09:07:58.075634",
13-
"spec_repo_commit": "67944e6"
12+
"regenerated": "2021-08-24 15:39:25.586489",
13+
"spec_repo_commit": "fccf269"
1414
}
1515
}
1616
}

docs/v1/UsageMeteringApi.md

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ Method | HTTP request | Description
1616
[**getUsageBillableSummary**](UsageMeteringApi.md#getUsageBillableSummary) | **GET** /api/v1/usage/billable-summary | Get billable usage across your account
1717
[**getUsageCWS**](UsageMeteringApi.md#getUsageCWS) | **GET** /api/v1/usage/cws | Get hourly usage for Cloud Workload Security
1818
[**getUsageCloudSecurityPostureManagement**](UsageMeteringApi.md#getUsageCloudSecurityPostureManagement) | **GET** /api/v1/usage/cspm | Get hourly usage for CSPM
19+
[**getUsageDBM**](UsageMeteringApi.md#getUsageDBM) | **GET** /api/v1/usage/dbm | Get hourly usage for Database Monitoring
1920
[**getUsageFargate**](UsageMeteringApi.md#getUsageFargate) | **GET** /api/v1/usage/fargate | Get hourly usage for Fargate
2021
[**getUsageHosts**](UsageMeteringApi.md#getUsageHosts) | **GET** /api/v1/usage/hosts | Get hourly usage for hosts and containers
2122
[**getUsageIndexedSpans**](UsageMeteringApi.md#getUsageIndexedSpans) | **GET** /api/v1/usage/indexed-spans | Get hourly usage for indexed spans
@@ -749,6 +750,65 @@ Name | Type | Description | Notes
749750
- **Accept**: application/json;datetime-format=rfc3339
750751

751752

753+
### HTTP response details
754+
| Status code | Description | Response headers |
755+
|-------------|-------------|------------------|
756+
**200** | OK | - |
757+
**400** | Bad Request | - |
758+
**403** | Forbidden - User is not authorized | - |
759+
760+
[[Back to top]](#) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to Model list]](README.md#documentation-for-models) [[Back to README]](README.md)
761+
762+
## **getUsageDBM**
763+
> UsageDBMResponse getUsageDBM()
764+
765+
Get hourly usage for Database Monitoring
766+
767+
### Example
768+
769+
770+
```typescript
771+
import { v1 } from '@datadog/datadog-api-client';
772+
import * as fs from 'fs';
773+
774+
const configuration = v1.createConfiguration();
775+
const apiInstance = new v1.UsageMeteringApi(configuration);
776+
777+
let params:v1.UsageMeteringApiGetUsageDBMRequest = {
778+
// Date | Datetime in ISO-8601 format, UTC, precise to hour: `[YYYY-MM-DDThh]` for usage beginning at this hour.
779+
startHr: new Date('1970-01-01T00:00:00.00Z'),
780+
// Date | Datetime in ISO-8601 format, UTC, precise to hour: `[YYYY-MM-DDThh]` for usage ending **before** this hour. (optional)
781+
endHr: new Date('1970-01-01T00:00:00.00Z'),
782+
};
783+
784+
apiInstance.getUsageDBM(params).then((data:any) => {
785+
console.log('API called successfully. Returned data: ' + JSON.stringify(data));
786+
}).catch((error:any) => console.error(error));
787+
```
788+
789+
790+
### Parameters
791+
792+
Name | Type | Description | Notes
793+
------------- | ------------- | ------------- | -------------
794+
**startHr** | [**Date**] | Datetime in ISO-8601 format, UTC, precise to hour: &#x60;[YYYY-MM-DDThh]&#x60; for usage beginning at this hour. | defaults to undefined
795+
**endHr** | [**Date**] | Datetime in ISO-8601 format, UTC, precise to hour: &#x60;[YYYY-MM-DDThh]&#x60; for usage ending **before** this hour. | (optional) defaults to undefined
796+
797+
798+
### Return type
799+
800+
**UsageDBMResponse**
801+
802+
### Authorization
803+
804+
[apiKeyAuth](README.md#apiKeyAuth), [appKeyAuth](README.md#appKeyAuth)
805+
806+
### HTTP request headers
807+
808+
- **Content-Type**: Not defined
809+
- **Accept**: application/json;datetime-format=rfc3339
810+
811+
752812
### HTTP response details
753813
| Status code | Description | Response headers |
754814
|-------------|-------------|------------------|

features/v1/undo.json

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1178,6 +1178,12 @@
11781178
"type": "safe"
11791179
}
11801180
},
1181+
"GetUsageDBM": {
1182+
"tag": "Usage Metering",
1183+
"undo": {
1184+
"type": "safe"
1185+
}
1186+
},
11811187
"GetUsageFargate": {
11821188
"tag": "Usage Metering",
11831189
"undo": {

features/v1/usage_metering.feature

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,18 @@ Feature: Usage Metering
7979
When the request is sent
8080
Then the response status is 200 OK
8181

82+
@generated @skip
83+
Scenario: Get hourly usage for Database Monitoring returns "Bad Request" response
84+
Given new "GetUsageDBM" request
85+
When the request is sent
86+
Then the response status is 400 Bad Request
87+
88+
@generated @skip
89+
Scenario: Get hourly usage for Database Monitoring returns "OK" response
90+
Given new "GetUsageDBM" request
91+
When the request is sent
92+
Then the response status is 200 OK
93+
8294
@generated @skip
8395
Scenario: Get hourly usage for Fargate returns "Bad Request" response
8496
Given new "GetUsageFargate" request

packages/datadog-api-client-v1/.openapi-generator/FILES

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -565,6 +565,8 @@ models/UsageCustomReportsData.ts
565565
models/UsageCustomReportsMeta.ts
566566
models/UsageCustomReportsPage.ts
567567
models/UsageCustomReportsResponse.ts
568+
models/UsageDBMHour.ts
569+
models/UsageDBMResponse.ts
568570
models/UsageFargateHour.ts
569571
models/UsageFargateResponse.ts
570572
models/UsageHostHour.ts

packages/datadog-api-client-v1/apis/UsageMeteringApi.ts

Lines changed: 121 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ import { UsageBillableSummaryResponse } from "../models/UsageBillableSummaryResp
1616
import { UsageCWSResponse } from "../models/UsageCWSResponse";
1717
import { UsageCloudSecurityPostureManagementResponse } from "../models/UsageCloudSecurityPostureManagementResponse";
1818
import { UsageCustomReportsResponse } from "../models/UsageCustomReportsResponse";
19+
import { UsageDBMResponse } from "../models/UsageDBMResponse";
1920
import { UsageFargateResponse } from "../models/UsageFargateResponse";
2021
import { UsageHostsResponse } from "../models/UsageHostsResponse";
2122
import { UsageIncidentManagementResponse } from "../models/UsageIncidentManagementResponse";
@@ -849,6 +850,71 @@ export class UsageMeteringApiRequestFactory extends BaseAPIRequestFactory {
849850
return requestContext;
850851
}
851852

853+
/**
854+
* Get hourly usage for Database Monitoring
855+
* Get hourly usage for Database Monitoring
856+
* @param startHr Datetime in ISO-8601 format, UTC, precise to hour: &#x60;[YYYY-MM-DDThh]&#x60; for usage beginning at this hour.
857+
* @param endHr Datetime in ISO-8601 format, UTC, precise to hour: &#x60;[YYYY-MM-DDThh]&#x60; for usage ending **before** this hour.
858+
*/
859+
public async getUsageDBM(
860+
startHr: Date,
861+
endHr?: Date,
862+
options?: Configuration
863+
): Promise<RequestContext> {
864+
const config = options || this.configuration;
865+
866+
// verify required parameter 'startHr' is not null or undefined
867+
if (startHr === null || startHr === undefined) {
868+
throw new RequiredError(
869+
"Required parameter startHr was null or undefined when calling getUsageDBM."
870+
);
871+
}
872+
873+
// Path Params
874+
const localVarPath = "/api/v1/usage/dbm";
875+
876+
// Make Request Context
877+
const requestContext = getServer(
878+
config,
879+
"UsageMeteringApi.getUsageDBM"
880+
).makeRequestContext(localVarPath, HttpMethod.GET);
881+
requestContext.setHeaderParam("Accept", "application/json, */*;q=0.8");
882+
requestContext.setHttpConfig(config.httpConfig);
883+
884+
// Query Params
885+
if (startHr !== undefined) {
886+
requestContext.setQueryParam(
887+
"start_hr",
888+
ObjectSerializer.serialize(startHr, "Date", "date-time")
889+
);
890+
}
891+
if (endHr !== undefined) {
892+
requestContext.setQueryParam(
893+
"end_hr",
894+
ObjectSerializer.serialize(endHr, "Date", "date-time")
895+
);
896+
}
897+
898+
// Header Params
899+
900+
// Form Params
901+
902+
// Body Params
903+
904+
let authMethod = null;
905+
// Apply auth methods
906+
authMethod = config.authMethods["apiKeyAuth"];
907+
if (authMethod) {
908+
await authMethod.applySecurityAuthentication(requestContext);
909+
}
910+
authMethod = config.authMethods["appKeyAuth"];
911+
if (authMethod) {
912+
await authMethod.applySecurityAuthentication(requestContext);
913+
}
914+
915+
return requestContext;
916+
}
917+
852918
/**
853919
* Get hourly usage for [Fargate](https://docs.datadoghq.com/integrations/ecs_fargate/).
854920
* Get hourly usage for Fargate
@@ -2771,6 +2837,61 @@ export class UsageMeteringApiResponseProcessor {
27712837
);
27722838
}
27732839

2840+
/**
2841+
* Unwraps the actual response sent by the server from the response context and deserializes the response content
2842+
* to the expected objects
2843+
*
2844+
* @params response Response returned by the server for a request to getUsageDBM
2845+
* @throws ApiException if the response code was not in [200, 299]
2846+
*/
2847+
public async getUsageDBM(
2848+
response: ResponseContext
2849+
): Promise<UsageDBMResponse> {
2850+
const contentType = ObjectSerializer.normalizeMediaType(
2851+
response.headers["content-type"]
2852+
);
2853+
if (isCodeInRange("200", response.httpStatusCode)) {
2854+
const body: UsageDBMResponse = ObjectSerializer.deserialize(
2855+
ObjectSerializer.parse(await response.body.text(), contentType),
2856+
"UsageDBMResponse",
2857+
""
2858+
) as UsageDBMResponse;
2859+
return body;
2860+
}
2861+
if (isCodeInRange("400", response.httpStatusCode)) {
2862+
const body: APIErrorResponse = ObjectSerializer.deserialize(
2863+
ObjectSerializer.parse(await response.body.text(), contentType),
2864+
"APIErrorResponse",
2865+
""
2866+
) as APIErrorResponse;
2867+
throw new ApiException<APIErrorResponse>(400, body);
2868+
}
2869+
if (isCodeInRange("403", response.httpStatusCode)) {
2870+
const body: APIErrorResponse = ObjectSerializer.deserialize(
2871+
ObjectSerializer.parse(await response.body.text(), contentType),
2872+
"APIErrorResponse",
2873+
""
2874+
) as APIErrorResponse;
2875+
throw new ApiException<APIErrorResponse>(403, body);
2876+
}
2877+
2878+
// Work around for missing responses in specification, e.g. for petstore.yaml
2879+
if (response.httpStatusCode >= 200 && response.httpStatusCode <= 299) {
2880+
const body: UsageDBMResponse = ObjectSerializer.deserialize(
2881+
ObjectSerializer.parse(await response.body.text(), contentType),
2882+
"UsageDBMResponse",
2883+
""
2884+
) as UsageDBMResponse;
2885+
return body;
2886+
}
2887+
2888+
const body = response.body || "";
2889+
throw new ApiException<string>(
2890+
response.httpStatusCode,
2891+
'Unknown API Status Code!\nBody: "' + body + '"'
2892+
);
2893+
}
2894+
27742895
/**
27752896
* Unwraps the actual response sent by the server from the response context and deserializes the response content
27762897
* to the expected objects

packages/datadog-api-client-v1/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -184,6 +184,7 @@ export {
184184
UsageMeteringApiGetUsageBillableSummaryRequest,
185185
UsageMeteringApiGetUsageCWSRequest,
186186
UsageMeteringApiGetUsageCloudSecurityPostureManagementRequest,
187+
UsageMeteringApiGetUsageDBMRequest,
187188
UsageMeteringApiGetUsageFargateRequest,
188189
UsageMeteringApiGetUsageHostsRequest,
189190
UsageMeteringApiGetUsageIndexedSpansRequest,

packages/datadog-api-client-v1/models/ObjectSerializer.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -375,6 +375,8 @@ import { UsageCustomReportsData } from "./UsageCustomReportsData";
375375
import { UsageCustomReportsMeta } from "./UsageCustomReportsMeta";
376376
import { UsageCustomReportsPage } from "./UsageCustomReportsPage";
377377
import { UsageCustomReportsResponse } from "./UsageCustomReportsResponse";
378+
import { UsageDBMHour } from "./UsageDBMHour";
379+
import { UsageDBMResponse } from "./UsageDBMResponse";
378380
import { UsageFargateHour } from "./UsageFargateHour";
379381
import { UsageFargateResponse } from "./UsageFargateResponse";
380382
import { UsageHostHour } from "./UsageHostHour";
@@ -991,6 +993,8 @@ const typeMap: { [index: string]: any } = {
991993
UsageCustomReportsMeta: UsageCustomReportsMeta,
992994
UsageCustomReportsPage: UsageCustomReportsPage,
993995
UsageCustomReportsResponse: UsageCustomReportsResponse,
996+
UsageDBMHour: UsageDBMHour,
997+
UsageDBMResponse: UsageDBMResponse,
994998
UsageFargateHour: UsageFargateHour,
995999
UsageFargateResponse: UsageFargateResponse,
9961000
UsageHostHour: UsageHostHour,

packages/datadog-api-client-v1/models/UsageAttributionSupportedMetrics.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,10 @@ export type UsageAttributionSupportedMetrics =
3737
| typeof PROFILED_HOST_PERCENTAGE
3838
| typeof PROFILED_CONTAINER_USAGE
3939
| typeof PROFILED_CONTAINER_PERCENTAGE
40+
| typeof DBM_HOST_USAGE
41+
| typeof DBM_HOST_PERCENTAGE
42+
| typeof DBM_QUERIES_USAGE
43+
| typeof DBM_QUERIES_PERCENTAGE
4044
| typeof ALL;
4145
export const CUSTOM_TIMESERIES_USAGE = "custom_timeseries_usage";
4246
export const CONTAINER_USAGE = "container_usage";
@@ -66,4 +70,8 @@ export const PROFILED_HOST_USAGE = "profiled_host_usage";
6670
export const PROFILED_HOST_PERCENTAGE = "profiled_host_percentage";
6771
export const PROFILED_CONTAINER_USAGE = "profiled_container_usage";
6872
export const PROFILED_CONTAINER_PERCENTAGE = "profiled_container_percentage";
73+
export const DBM_HOST_USAGE = "dbm_host_usage";
74+
export const DBM_HOST_PERCENTAGE = "dbm_host_percentage";
75+
export const DBM_QUERIES_USAGE = "dbm_queries_usage";
76+
export const DBM_QUERIES_PERCENTAGE = "dbm_queries_percentage";
6977
export const ALL = "*";

0 commit comments

Comments
 (0)