Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add CWS to usage metering endpoint #376

Merged
merged 2 commits into from
Jun 3, 2021
Merged
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
8 changes: 4 additions & 4 deletions .apigentools-info
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@
"spec_versions": {
"v1": {
"apigentools_version": "1.4.1.dev8",
"regenerated": "2021-06-02 15:25:51.478112",
"spec_repo_commit": "ea553b9"
"regenerated": "2021-06-03 07:59:39.584580",
"spec_repo_commit": "6c05087"
},
"v2": {
"apigentools_version": "1.4.1.dev8",
"regenerated": "2021-06-02 15:26:46.457316",
"spec_repo_commit": "ea553b9"
"regenerated": "2021-06-03 08:00:34.517713",
"spec_repo_commit": "6c05087"
}
}
}
124 changes: 124 additions & 0 deletions data/v1/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10730,6 +10730,23 @@ components:
description: The custom metrics usage by tag(s).
format: double
type: number
cws_container_percentage:
description: The percentage of Cloud Workload Security container usage by
tag(s)
format: double
type: number
cws_container_usage:
description: The Cloud Workload Security container usage by tag(s)
format: double
type: number
cws_host_percentage:
description: The percentage of Cloud Workload Security host usage by tag(s)
format: double
type: number
cws_host_usage:
description: The Cloud Workload Security host usage by tag(s)
format: double
type: number
infra_host_percentage:
description: The percentage of infrastructure host usage by tag(s).
format: double
Expand Down Expand Up @@ -10937,6 +10954,35 @@ components:
$ref: '#/components/schemas/UsageBillableSummaryHour'
type: array
type: object
UsageCWSHour:
description: Cloud Workload Security usage for a given organization for a given
hour.
properties:
cws_container_count:
description: "The total number of Cloud Workload Security container hours\
\ from the start of the given hour\u2019s month until the given hour."
format: int64
type: integer
cws_host_count:
description: "The total number of Cloud Workload Security host hours from\
\ the start of the given hour\u2019s month until the given hour."
format: int64
type: integer
hour:
description: The hour for the usage.
format: date-time
type: string
type: object
UsageCWSResponse:
description: Response containing the Cloud Workload Security usage for each
hour for a given organization.
properties:
usage:
description: Get hourly usage for Cloud Workload Security.
items:
$ref: '#/components/schemas/UsageCWSHour'
type: array
type: object
UsageCloudSecurityPostureManagementHour:
description: Cloud Security Posture Management usage for a given organization
for a given hour.
Expand Down Expand Up @@ -11691,6 +11737,16 @@ components:
hours in the current date for all organizations.
format: int64
type: integer
cws_container_count_avg:
description: Shows the average of all distinct Cloud Workload Security containers
over all hours in the current date for all organizations.
format: int64
type: integer
cws_host_top99p:
description: Shows the 99th percentile of all Cloud Workload Security hosts
over all hours in the current date for all organizations.
format: int64
type: integer
date:
description: The date for the usage.
format: date-time
Expand Down Expand Up @@ -11901,6 +11957,16 @@ components:
hours in the current date for the given org.
format: int64
type: integer
cws_container_count_avg:
description: Shows the average of all distinct Cloud Workload Security containers
over all hours in the current date for the given org.
format: int64
type: integer
cws_host_top99p:
description: Shows the 99th percentile of all Cloud Workload Security hosts
over all hours in the current date for the given org.
format: int64
type: integer
fargate_tasks_count_avg:
description: The average task count for Fargate.
format: int64
Expand Down Expand Up @@ -12115,6 +12181,16 @@ components:
hours in the current months for all organizations.
format: int64
type: integer
cws_containers_avg_sum:
description: Shows the average of all distinct Cloud Workload Security containers
over all hours in the current months for all organizations.
format: int64
type: integer
cws_host_top99p_sum:
description: Shows the 99th percentile of all Cloud Workload Security hosts
over all hours in the current months for all organizations.
format: int64
type: integer
end_date:
description: Shows the last date of usage in the current months for all
organizations.
Expand Down Expand Up @@ -20999,6 +21075,54 @@ paths:
x-menu-order: 30
x-undo:
type: safe
/api/v1/usage/cws:
get:
description: Get hourly usage for Cloud Workload Security.
operationId: GetUsageCWS
parameters:
- description: 'Datetime in ISO-8601 format, UTC, precise to hour: `[YYYY-MM-DDThh]`
for usage beginning at this hour.'
in: query
name: start_hr
required: true
schema:
format: date-time
type: string
- description: 'Datetime in ISO-8601 format, UTC, precise to hour: `[YYYY-MM-DDThh]`
for usage ending

**before** this hour.'
in: query
name: end_hr
required: false
schema:
format: date-time
type: string
responses:
'200':
content:
application/json;datetime-format=rfc3339:
schema:
$ref: '#/components/schemas/UsageCWSResponse'
description: OK
'400':
content:
application/json;datetime-format=rfc3339:
schema:
$ref: '#/components/schemas/APIErrorResponse'
description: Bad Request
'403':
content:
application/json;datetime-format=rfc3339:
schema:
$ref: '#/components/schemas/APIErrorResponse'
description: Forbidden - User is not authorized
summary: Get hourly usage for Cloud Workload Security
tags:
- Usage Metering
x-menu-order: 31
x-undo:
type: safe
/api/v1/usage/fargate:
get:
description: Get hourly usage for [Fargate](https://docs.datadoghq.com/integrations/ecs_fargate/).
Expand Down
3 changes: 3 additions & 0 deletions docs/v1/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -198,6 +198,7 @@ Class | Method | HTTP request | Description
*DatadogAPIClient::V1::UsageMeteringAPI* | [**get_usage_audit_logs**](UsageMeteringAPI.md#get_usage_audit_logs) | **GET** /api/v1/usage/audit_logs | Get hourly usage for audit logs
*DatadogAPIClient::V1::UsageMeteringAPI* | [**get_usage_billable_summary**](UsageMeteringAPI.md#get_usage_billable_summary) | **GET** /api/v1/usage/billable-summary | Get billable usage across your account
*DatadogAPIClient::V1::UsageMeteringAPI* | [**get_usage_cloud_security_posture_management**](UsageMeteringAPI.md#get_usage_cloud_security_posture_management) | **GET** /api/v1/usage/cspm | Get hourly usage for CSPM
*DatadogAPIClient::V1::UsageMeteringAPI* | [**get_usage_cws**](UsageMeteringAPI.md#get_usage_cws) | **GET** /api/v1/usage/cws | Get hourly usage for Cloud Workload Security
*DatadogAPIClient::V1::UsageMeteringAPI* | [**get_usage_fargate**](UsageMeteringAPI.md#get_usage_fargate) | **GET** /api/v1/usage/fargate | Get hourly usage for Fargate
*DatadogAPIClient::V1::UsageMeteringAPI* | [**get_usage_hosts**](UsageMeteringAPI.md#get_usage_hosts) | **GET** /api/v1/usage/hosts | Get hourly usage for hosts and containers
*DatadogAPIClient::V1::UsageMeteringAPI* | [**get_usage_indexed_spans**](UsageMeteringAPI.md#get_usage_indexed_spans) | **GET** /api/v1/usage/indexed-spans | Get hourly usage for indexed spans
Expand Down Expand Up @@ -693,6 +694,8 @@ Class | Method | HTTP request | Description
- [DatadogAPIClient::V1::UsageBillableSummaryHour](UsageBillableSummaryHour.md)
- [DatadogAPIClient::V1::UsageBillableSummaryKeys](UsageBillableSummaryKeys.md)
- [DatadogAPIClient::V1::UsageBillableSummaryResponse](UsageBillableSummaryResponse.md)
- [DatadogAPIClient::V1::UsageCWSHour](UsageCWSHour.md)
- [DatadogAPIClient::V1::UsageCWSResponse](UsageCWSResponse.md)
- [DatadogAPIClient::V1::UsageCloudSecurityPostureManagementHour](UsageCloudSecurityPostureManagementHour.md)
- [DatadogAPIClient::V1::UsageCloudSecurityPostureManagementResponse](UsageCloudSecurityPostureManagementResponse.md)
- [DatadogAPIClient::V1::UsageCustomReportsAttributes](UsageCustomReportsAttributes.md)
Expand Down
8 changes: 8 additions & 0 deletions docs/v1/UsageAttributionValues.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,10 @@
| **container_usage** | **Float** | The container usage by tag(s). | [optional] |
| **custom_timeseries_percentage** | **Float** | The percentage of custom metrics usage by tag(s). | [optional] |
| **custom_timeseries_usage** | **Float** | The custom metrics usage by tag(s). | [optional] |
| **cws_container_percentage** | **Float** | The percentage of Cloud Workload Security container usage by tag(s) | [optional] |
| **cws_container_usage** | **Float** | The Cloud Workload Security container usage by tag(s) | [optional] |
| **cws_host_percentage** | **Float** | The percentage of Cloud Workload Security host usage by tag(s) | [optional] |
| **cws_host_usage** | **Float** | The Cloud Workload Security host usage by tag(s) | [optional] |
| **infra_host_percentage** | **Float** | The percentage of infrastructure host usage by tag(s). | [optional] |
| **infra_host_usage** | **Float** | The infrastructure host usage by tag(s). | [optional] |
| **lambda_functions_percentage** | **Float** | The percentage of Lambda function usage by tag(s). | [optional] |
Expand Down Expand Up @@ -47,6 +51,10 @@ instance = DatadogAPIClient::V1::UsageAttributionValues.new(
container_usage: null,
custom_timeseries_percentage: null,
custom_timeseries_usage: null,
cws_container_percentage: null,
cws_container_usage: null,
cws_host_percentage: null,
cws_host_usage: null,
infra_host_percentage: null,
infra_host_usage: null,
lambda_functions_percentage: null,
Expand Down
22 changes: 22 additions & 0 deletions docs/v1/UsageCWSHour.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# DatadogAPIClient::V1::UsageCWSHour

## Properties

| Name | Type | Description | Notes |
| ---- | ---- | ----------- | ----- |
| **cws_container_count** | **Integer** | The total number of Cloud Workload Security container hours from the start of the given hour’s month until the given hour. | [optional] |
| **cws_host_count** | **Integer** | The total number of Cloud Workload Security host hours from the start of the given hour’s month until the given hour. | [optional] |
| **hour** | **Time** | The hour for the usage. | [optional] |

## Example

```ruby
require 'datadog_api_client/v1'

instance = DatadogAPIClient::V1::UsageCWSHour.new(
cws_container_count: null,
cws_host_count: null,
hour: null
)
```

18 changes: 18 additions & 0 deletions docs/v1/UsageCWSResponse.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# DatadogAPIClient::V1::UsageCWSResponse

## Properties

| Name | Type | Description | Notes |
| ---- | ---- | ----------- | ----- |
| **usage** | [**Array<UsageCWSHour>**](UsageCWSHour.md) | Get hourly usage for Cloud Workload Security. | [optional] |

## Example

```ruby
require 'datadog_api_client/v1'

instance = DatadogAPIClient::V1::UsageCWSResponse.new(
usage: null
)
```

67 changes: 67 additions & 0 deletions docs/v1/UsageMeteringAPI.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ All URIs are relative to *https://api.datadoghq.com*
| [**get_usage_audit_logs**](UsageMeteringAPI.md#get_usage_audit_logs) | **GET** /api/v1/usage/audit_logs | Get hourly usage for audit logs |
| [**get_usage_billable_summary**](UsageMeteringAPI.md#get_usage_billable_summary) | **GET** /api/v1/usage/billable-summary | Get billable usage across your account |
| [**get_usage_cloud_security_posture_management**](UsageMeteringAPI.md#get_usage_cloud_security_posture_management) | **GET** /api/v1/usage/cspm | Get hourly usage for CSPM |
| [**get_usage_cws**](UsageMeteringAPI.md#get_usage_cws) | **GET** /api/v1/usage/cws | Get hourly usage for Cloud Workload Security |
| [**get_usage_fargate**](UsageMeteringAPI.md#get_usage_fargate) | **GET** /api/v1/usage/fargate | Get hourly usage for Fargate |
| [**get_usage_hosts**](UsageMeteringAPI.md#get_usage_hosts) | **GET** /api/v1/usage/hosts | Get hourly usage for hosts and containers |
| [**get_usage_indexed_spans**](UsageMeteringAPI.md#get_usage_indexed_spans) | **GET** /api/v1/usage/indexed-spans | Get hourly usage for indexed spans |
Expand Down Expand Up @@ -859,6 +860,72 @@ end
- **Accept**: application/json;datetime-format=rfc3339


## get_usage_cws

> <UsageCWSResponse> get_usage_cws(start_hr, opts)

Get hourly usage for Cloud Workload Security

Get hourly usage for Cloud Workload Security.

### Examples

```ruby
require 'datadog_api_client'
api_instance = DatadogAPIClient::V1::UsageMeteringAPI.new
start_hr = Time.parse('2013-10-20T19:20:30+01:00') # Time | Datetime in ISO-8601 format, UTC, precise to hour: `[YYYY-MM-DDThh]` for usage beginning at this hour.
opts = {
end_hr: Time.parse('2013-10-20T19:20:30+01:00') # Time | Datetime in ISO-8601 format, UTC, precise to hour: `[YYYY-MM-DDThh]` for usage ending **before** this hour.
}

begin
# Get hourly usage for Cloud Workload Security
result = api_instance.get_usage_cws(start_hr, opts)
p result
rescue DatadogAPIClient::V1::APIError => e
puts "Error when calling UsageMeteringAPI->get_usage_cws: #{e}"
end
```

#### Using the get_usage_cws_with_http_info variant

This returns an Array which contains the response data, status code and headers.

> <Array(<UsageCWSResponse>, Integer, Hash)> get_usage_cws_with_http_info(start_hr, opts)

```ruby
begin
# Get hourly usage for Cloud Workload Security
data, status_code, headers = api_instance.get_usage_cws_with_http_info(start_hr, opts)
p status_code # => 2xx
p headers # => { ... }
p data # => <UsageCWSResponse>
rescue DatadogAPIClient::V1::APIError => e
puts "Error when calling UsageMeteringAPI->get_usage_cws_with_http_info: #{e}"
end
```

### Parameters

| Name | Type | Description | Notes |
| ---- | ---- | ----------- | ----- |
| **start_hr** | **Time** | Datetime in ISO-8601 format, UTC, precise to hour: &#x60;[YYYY-MM-DDThh]&#x60; for usage beginning at this hour. | |
| **end_hr** | **Time** | Datetime in ISO-8601 format, UTC, precise to hour: &#x60;[YYYY-MM-DDThh]&#x60; for usage ending **before** this hour. | [optional] |

### Return type

[**UsageCWSResponse**](UsageCWSResponse.md)

### Authorization

[apiKeyAuth](README.md#apiKeyAuth), [appKeyAuth](README.md#appKeyAuth)

### HTTP request headers

- **Content-Type**: Not defined
- **Accept**: application/json;datetime-format=rfc3339


## get_usage_fargate

> <UsageFargateResponse> get_usage_fargate(start_hr, opts)
Expand Down
4 changes: 4 additions & 0 deletions docs/v1/UsageSummaryDate.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@
| **cspm_container_hwm** | **Integer** | Shows the high-water mark of Cloud Security Posture Management containers over all hours in the current date for all organizations. | [optional] |
| **cspm_host_top99p** | **Integer** | Shows the 99th percentile of all Cloud Security Posture Management hosts over all hours in the current date for all organizations. | [optional] |
| **custom_ts_avg** | **Integer** | Shows the average number of distinct custom metrics over all hours in the current date for all organizations. | [optional] |
| **cws_container_count_avg** | **Integer** | Shows the average of all distinct Cloud Workload Security containers over all hours in the current date for all organizations. | [optional] |
| **cws_host_top99p** | **Integer** | Shows the 99th percentile of all Cloud Workload Security hosts over all hours in the current date for all organizations. | [optional] |
| **date** | **Time** | The date for the usage. | [optional] |
| **fargate_tasks_count_avg** | **Integer** | Shows the high-watermark of all Fargate tasks over all hours in the current date for all organizations. | [optional] |
| **fargate_tasks_count_hwm** | **Integer** | Shows the average of all Fargate tasks over all hours in the current date for all organizations. | [optional] |
Expand Down Expand Up @@ -67,6 +69,8 @@ instance = DatadogAPIClient::V1::UsageSummaryDate.new(
cspm_container_hwm: null,
cspm_host_top99p: null,
custom_ts_avg: null,
cws_container_count_avg: null,
cws_host_top99p: null,
date: null,
fargate_tasks_count_avg: null,
fargate_tasks_count_hwm: null,
Expand Down
4 changes: 4 additions & 0 deletions docs/v1/UsageSummaryDateOrg.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@
| **cspm_container_hwm** | **Integer** | Shows the high-water mark of Cloud Security Posture Management containers over all hours in the current date for the given org. | [optional] |
| **cspm_host_top99p** | **Integer** | Shows the 99th percentile of all Cloud Security Posture Management hosts over all hours in the current date for the given org. | [optional] |
| **custom_ts_avg** | **Integer** | Shows the average number of distinct custom metrics over all hours in the current date for the given org. | [optional] |
| **cws_container_count_avg** | **Integer** | Shows the average of all distinct Cloud Workload Security containers over all hours in the current date for the given org. | [optional] |
| **cws_host_top99p** | **Integer** | Shows the 99th percentile of all Cloud Workload Security hosts over all hours in the current date for the given org. | [optional] |
| **fargate_tasks_count_avg** | **Integer** | The average task count for Fargate. | [optional] |
| **fargate_tasks_count_hwm** | **Integer** | Shows the high-water mark of all Fargate tasks over all hours in the current date for the given org. | [optional] |
| **gcp_host_top99p** | **Integer** | Shows the 99th percentile of all GCP hosts over all hours in the current date for the given org. | [optional] |
Expand Down Expand Up @@ -68,6 +70,8 @@ instance = DatadogAPIClient::V1::UsageSummaryDateOrg.new(
cspm_container_hwm: null,
cspm_host_top99p: null,
custom_ts_avg: null,
cws_container_count_avg: null,
cws_host_top99p: null,
fargate_tasks_count_avg: null,
fargate_tasks_count_hwm: null,
gcp_host_top99p: null,
Expand Down
Loading