Skip to content

Commit e07d954

Browse files
api-clients-generation-pipeline[bot]ci.datadog-api-spec
andauthored
Regenerate client from commit 6c05087 of spec repo (#155)
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 093d466 commit e07d954

17 files changed

+538
-5
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.dev8",
7-
"regenerated": "2021-06-02 15:26:34.547345",
8-
"spec_repo_commit": "ea553b9"
7+
"regenerated": "2021-06-03 07:58:28.779340",
8+
"spec_repo_commit": "6c05087"
99
},
1010
"v2": {
1111
"apigentools_version": "1.4.1.dev8",
12-
"regenerated": "2021-06-02 15:27:31.226128",
13-
"spec_repo_commit": "ea553b9"
12+
"regenerated": "2021-06-03 07:59:08.538870",
13+
"spec_repo_commit": "6c05087"
1414
}
1515
}
1616
}

docs/v1/UsageMeteringApi.md

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ Method | HTTP request | Description
1515
[**getUsageAttribution**](UsageMeteringApi.md#getUsageAttribution) | **GET** /api/v1/usage/attribution | Get Usage Attribution
1616
[**getUsageAuditLogs**](UsageMeteringApi.md#getUsageAuditLogs) | **GET** /api/v1/usage/audit_logs | Get hourly usage for audit logs
1717
[**getUsageBillableSummary**](UsageMeteringApi.md#getUsageBillableSummary) | **GET** /api/v1/usage/billable-summary | Get billable usage across your account
18+
[**getUsageCWS**](UsageMeteringApi.md#getUsageCWS) | **GET** /api/v1/usage/cws | Get hourly usage for Cloud Workload Security
1819
[**getUsageCloudSecurityPostureManagement**](UsageMeteringApi.md#getUsageCloudSecurityPostureManagement) | **GET** /api/v1/usage/cspm | Get hourly usage for CSPM
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
@@ -688,6 +689,65 @@ Name | Type | Description | Notes
688689
- **Accept**: application/json;datetime-format=rfc3339
689690

690691

692+
### HTTP response details
693+
| Status code | Description | Response headers |
694+
|-------------|-------------|------------------|
695+
**200** | OK | - |
696+
**400** | Bad Request | - |
697+
**403** | Forbidden - User is not authorized | - |
698+
699+
[[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)
700+
701+
## **getUsageCWS**
702+
> UsageCWSResponse getUsageCWS()
703+
704+
Get hourly usage for Cloud Workload Security.
705+
706+
### Example
707+
708+
709+
```typescript
710+
import { v1 } from 'datadog-api-client';
711+
import * as fs from 'fs';
712+
713+
const configuration = v1.createConfiguration();
714+
const apiInstance = new v1.UsageMeteringApi(configuration);
715+
716+
let params:v1.UsageMeteringApiGetUsageCWSRequest = {
717+
// Date | Datetime in ISO-8601 format, UTC, precise to hour: `[YYYY-MM-DDThh]` for usage beginning at this hour.
718+
startHr: new Date('1970-01-01T00:00:00.00Z'),
719+
// Date | Datetime in ISO-8601 format, UTC, precise to hour: `[YYYY-MM-DDThh]` for usage ending **before** this hour. (optional)
720+
endHr: new Date('1970-01-01T00:00:00.00Z'),
721+
};
722+
723+
apiInstance.getUsageCWS(params).then((data:any) => {
724+
console.log('API called successfully. Returned data: ' + data);
725+
}).catch((error:any) => console.error(error));
726+
```
727+
728+
729+
### Parameters
730+
731+
Name | Type | Description | Notes
732+
------------- | ------------- | ------------- | -------------
733+
**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
734+
**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
735+
736+
737+
### Return type
738+
739+
**UsageCWSResponse**
740+
741+
### Authorization
742+
743+
[apiKeyAuth](README.md#apiKeyAuth), [appKeyAuth](README.md#appKeyAuth)
744+
745+
### HTTP request headers
746+
747+
- **Content-Type**: Not defined
748+
- **Accept**: application/json;datetime-format=rfc3339
749+
750+
691751
### HTTP response details
692752
| Status code | Description | Response headers |
693753
|-------------|-------------|------------------|

features/v1/undo.json

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1093,6 +1093,12 @@
10931093
"type": "safe"
10941094
}
10951095
},
1096+
"GetUsageCWS": {
1097+
"tag": "Usage Metering",
1098+
"undo": {
1099+
"type": "safe"
1100+
}
1101+
},
10961102
"GetUsageFargate": {
10971103
"tag": "Usage Metering",
10981104
"undo": {

features/v1/usage_metering.feature

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

70+
@generated @skip
71+
Scenario: Get hourly usage for Cloud Workload Security returns "Bad Request" response
72+
Given new "GetUsageCWS" request
73+
When the request is sent
74+
Then the response status is 400 Bad Request
75+
76+
@generated @skip
77+
Scenario: Get hourly usage for Cloud Workload Security returns "OK" response
78+
Given new "GetUsageCWS" request
79+
When the request is sent
80+
Then the response status is 200 OK
81+
7082
@generated @skip
7183
Scenario: Get hourly usage for Fargate returns "Bad Request" response
7284
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
@@ -532,6 +532,8 @@ models/UsageBillableSummaryBody.ts
532532
models/UsageBillableSummaryHour.ts
533533
models/UsageBillableSummaryKeys.ts
534534
models/UsageBillableSummaryResponse.ts
535+
models/UsageCWSHour.ts
536+
models/UsageCWSResponse.ts
535537
models/UsageCloudSecurityPostureManagementHour.ts
536538
models/UsageCloudSecurityPostureManagementResponse.ts
537539
models/UsageCustomReportsAttributes.ts

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

Lines changed: 98 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ import { UsageAttributionSort } from '../models/UsageAttributionSort';
1414
import { UsageAttributionSupportedMetrics } from '../models/UsageAttributionSupportedMetrics';
1515
import { UsageAuditLogsResponse } from '../models/UsageAuditLogsResponse';
1616
import { UsageBillableSummaryResponse } from '../models/UsageBillableSummaryResponse';
17+
import { UsageCWSResponse } from '../models/UsageCWSResponse';
1718
import { UsageCloudSecurityPostureManagementResponse } from '../models/UsageCloudSecurityPostureManagementResponse';
1819
import { UsageCustomReportsResponse } from '../models/UsageCustomReportsResponse';
1920
import { UsageFargateResponse } from '../models/UsageFargateResponse';
@@ -637,6 +638,59 @@ export class UsageMeteringApiRequestFactory extends BaseAPIRequestFactory {
637638
return requestContext;
638639
}
639640

641+
/**
642+
* Get hourly usage for Cloud Workload Security.
643+
* Get hourly usage for Cloud Workload Security
644+
* @param startHr Datetime in ISO-8601 format, UTC, precise to hour: &#x60;[YYYY-MM-DDThh]&#x60; for usage beginning at this hour.
645+
* @param endHr Datetime in ISO-8601 format, UTC, precise to hour: &#x60;[YYYY-MM-DDThh]&#x60; for usage ending **before** this hour.
646+
*/
647+
public async getUsageCWS(startHr: Date, endHr?: Date, options?: Configuration): Promise<RequestContext> {
648+
let config = options || this.configuration;
649+
650+
// verify required parameter 'startHr' is not null or undefined
651+
if (startHr === null || startHr === undefined) {
652+
throw new RequiredError('Required parameter startHr was null or undefined when calling getUsageCWS.');
653+
}
654+
655+
656+
657+
// Path Params
658+
const localVarPath = '/api/v1/usage/cws';
659+
660+
// Make Request Context
661+
const requestContext = getServer(config, 'UsageMeteringApi.getUsageCWS').makeRequestContext(localVarPath, HttpMethod.GET);
662+
requestContext.setHeaderParam("Accept", "application/json, */*;q=0.8")
663+
requestContext.setHttpConfig(config.httpConfig);
664+
665+
// Query Params
666+
if (startHr !== undefined) {
667+
requestContext.setQueryParam("start_hr", ObjectSerializer.serialize(startHr, "Date", "date-time"));
668+
}
669+
if (endHr !== undefined) {
670+
requestContext.setQueryParam("end_hr", ObjectSerializer.serialize(endHr, "Date", "date-time"));
671+
}
672+
673+
// Header Params
674+
675+
// Form Params
676+
677+
678+
// Body Params
679+
680+
let authMethod = null;
681+
// Apply auth methods
682+
authMethod = config.authMethods["apiKeyAuth"]
683+
if (authMethod) {
684+
await authMethod.applySecurityAuthentication(requestContext);
685+
}
686+
authMethod = config.authMethods["appKeyAuth"]
687+
if (authMethod) {
688+
await authMethod.applySecurityAuthentication(requestContext);
689+
}
690+
691+
return requestContext;
692+
}
693+
640694
/**
641695
* Get hourly usage for Cloud Security Posture Management (CSPM).
642696
* Get hourly usage for CSPM
@@ -2249,6 +2303,50 @@ export class UsageMeteringApiResponseProcessor {
22492303
throw new ApiException<string>(response.httpStatusCode, "Unknown API Status Code!\nBody: \"" + body + "\"");
22502304
}
22512305

2306+
/**
2307+
* Unwraps the actual response sent by the server from the response context and deserializes the response content
2308+
* to the expected objects
2309+
*
2310+
* @params response Response returned by the server for a request to getUsageCWS
2311+
* @throws ApiException if the response code was not in [200, 299]
2312+
*/
2313+
public async getUsageCWS(response: ResponseContext): Promise<UsageCWSResponse > {
2314+
const contentType = ObjectSerializer.normalizeMediaType(response.headers["content-type"]);
2315+
if (isCodeInRange("200", response.httpStatusCode)) {
2316+
const body: UsageCWSResponse = ObjectSerializer.deserialize(
2317+
ObjectSerializer.parse(await response.body.text(), contentType),
2318+
"UsageCWSResponse", ""
2319+
) as UsageCWSResponse;
2320+
return body;
2321+
}
2322+
if (isCodeInRange("400", response.httpStatusCode)) {
2323+
const body: APIErrorResponse = ObjectSerializer.deserialize(
2324+
ObjectSerializer.parse(await response.body.text(), contentType),
2325+
"APIErrorResponse", ""
2326+
) as APIErrorResponse;
2327+
throw new ApiException<APIErrorResponse>(400, body);
2328+
}
2329+
if (isCodeInRange("403", response.httpStatusCode)) {
2330+
const body: APIErrorResponse = ObjectSerializer.deserialize(
2331+
ObjectSerializer.parse(await response.body.text(), contentType),
2332+
"APIErrorResponse", ""
2333+
) as APIErrorResponse;
2334+
throw new ApiException<APIErrorResponse>(403, body);
2335+
}
2336+
2337+
// Work around for missing responses in specification, e.g. for petstore.yaml
2338+
if (response.httpStatusCode >= 200 && response.httpStatusCode <= 299) {
2339+
const body: UsageCWSResponse = ObjectSerializer.deserialize(
2340+
ObjectSerializer.parse(await response.body.text(), contentType),
2341+
"UsageCWSResponse", ""
2342+
) as UsageCWSResponse;
2343+
return body;
2344+
}
2345+
2346+
let body = response.body || "";
2347+
throw new ApiException<string>(response.httpStatusCode, "Unknown API Status Code!\nBody: \"" + body + "\"");
2348+
}
2349+
22522350
/**
22532351
* Unwraps the actual response sent by the server from the response context and deserializes the response content
22542352
* to the expected objects

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

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -464,6 +464,8 @@ import { UsageBillableSummaryBody } from './UsageBillableSummaryBody';
464464
import { UsageBillableSummaryHour } from './UsageBillableSummaryHour';
465465
import { UsageBillableSummaryKeys } from './UsageBillableSummaryKeys';
466466
import { UsageBillableSummaryResponse } from './UsageBillableSummaryResponse';
467+
import { UsageCWSHour } from './UsageCWSHour';
468+
import { UsageCWSResponse } from './UsageCWSResponse';
467469
import { UsageCloudSecurityPostureManagementHour } from './UsageCloudSecurityPostureManagementHour';
468470
import { UsageCloudSecurityPostureManagementResponse } from './UsageCloudSecurityPostureManagementResponse';
469471
import { UsageCustomReportsAttributes } from './UsageCustomReportsAttributes';
@@ -1092,6 +1094,8 @@ let typeMap: {[index: string]: any} = {
10921094
"UsageBillableSummaryHour": UsageBillableSummaryHour,
10931095
"UsageBillableSummaryKeys": UsageBillableSummaryKeys,
10941096
"UsageBillableSummaryResponse": UsageBillableSummaryResponse,
1097+
"UsageCWSHour": UsageCWSHour,
1098+
"UsageCWSResponse": UsageCWSResponse,
10951099
"UsageCloudSecurityPostureManagementHour": UsageCloudSecurityPostureManagementHour,
10961100
"UsageCloudSecurityPostureManagementResponse": UsageCloudSecurityPostureManagementResponse,
10971101
"UsageCustomReportsAttributes": UsageCustomReportsAttributes,

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

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,22 @@ export class UsageAttributionValues {
5757
*/
5858
'customTimeseriesUsage'?: number;
5959
/**
60+
* The percentage of Cloud Workload Security container usage by tag(s)
61+
*/
62+
'cwsContainerPercentage'?: number;
63+
/**
64+
* The Cloud Workload Security container usage by tag(s)
65+
*/
66+
'cwsContainerUsage'?: number;
67+
/**
68+
* The percentage of Cloud Workload Security host usage by tag(s)
69+
*/
70+
'cwsHostPercentage'?: number;
71+
/**
72+
* The Cloud Workload Security host usage by tag(s)
73+
*/
74+
'cwsHostUsage'?: number;
75+
/**
6076
* The percentage of infrastructure host usage by tag(s).
6177
*/
6278
'infraHostPercentage'?: number;
@@ -174,6 +190,26 @@ export class UsageAttributionValues {
174190
"type": "number",
175191
"format": "double"
176192
},
193+
"cwsContainerPercentage": {
194+
"baseName": "cws_container_percentage",
195+
"type": "number",
196+
"format": "double"
197+
},
198+
"cwsContainerUsage": {
199+
"baseName": "cws_container_usage",
200+
"type": "number",
201+
"format": "double"
202+
},
203+
"cwsHostPercentage": {
204+
"baseName": "cws_host_percentage",
205+
"type": "number",
206+
"format": "double"
207+
},
208+
"cwsHostUsage": {
209+
"baseName": "cws_host_usage",
210+
"type": "number",
211+
"format": "double"
212+
},
177213
"infraHostPercentage": {
178214
"baseName": "infra_host_percentage",
179215
"type": "number",
@@ -282,6 +318,14 @@ export class UsageAttributionValues {
282318

283319
res.customTimeseriesUsage = ObjectSerializer.deserialize(data.custom_timeseries_usage, "number", "double")
284320

321+
res.cwsContainerPercentage = ObjectSerializer.deserialize(data.cws_container_percentage, "number", "double")
322+
323+
res.cwsContainerUsage = ObjectSerializer.deserialize(data.cws_container_usage, "number", "double")
324+
325+
res.cwsHostPercentage = ObjectSerializer.deserialize(data.cws_host_percentage, "number", "double")
326+
327+
res.cwsHostUsage = ObjectSerializer.deserialize(data.cws_host_usage, "number", "double")
328+
285329
res.infraHostPercentage = ObjectSerializer.deserialize(data.infra_host_percentage, "number", "double")
286330

287331
res.infraHostUsage = ObjectSerializer.deserialize(data.infra_host_usage, "number", "double")
@@ -346,6 +390,14 @@ export class UsageAttributionValues {
346390

347391
res.custom_timeseries_usage = ObjectSerializer.serialize(data.customTimeseriesUsage, "number", "double")
348392

393+
res.cws_container_percentage = ObjectSerializer.serialize(data.cwsContainerPercentage, "number", "double")
394+
395+
res.cws_container_usage = ObjectSerializer.serialize(data.cwsContainerUsage, "number", "double")
396+
397+
res.cws_host_percentage = ObjectSerializer.serialize(data.cwsHostPercentage, "number", "double")
398+
399+
res.cws_host_usage = ObjectSerializer.serialize(data.cwsHostUsage, "number", "double")
400+
349401
res.infra_host_percentage = ObjectSerializer.serialize(data.infraHostPercentage, "number", "double")
350402

351403
res.infra_host_usage = ObjectSerializer.serialize(data.infraHostUsage, "number", "double")

0 commit comments

Comments
 (0)