-
Notifications
You must be signed in to change notification settings - Fork 58
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Regenerate client from commit 432578c of spec repo
- Loading branch information
ci.datadog-api-spec
committed
Jan 11, 2022
1 parent
bfc09fe
commit 3716c5c
Showing
8 changed files
with
108 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
// Get Usage Attribution returns "OK" response | ||
|
||
package main | ||
|
||
import ( | ||
"context" | ||
"encoding/json" | ||
"fmt" | ||
"os" | ||
"time" | ||
|
||
datadog "github.com/DataDog/datadog-api-client-go/api/v1/datadog" | ||
) | ||
|
||
func main() { | ||
ctx := datadog.NewDefaultContext(context.Background()) | ||
configuration := datadog.NewConfiguration() | ||
configuration.SetUnstableOperationEnabled("GetUsageAttribution", true) | ||
apiClient := datadog.NewAPIClient(configuration) | ||
resp, r, err := apiClient.UsageMeteringApi.GetUsageAttribution(ctx, time.Now().AddDate(0, 0, -3), datadog.USAGEATTRIBUTIONSUPPORTEDMETRICS_ALL, *datadog.NewGetUsageAttributionOptionalParameters().WithOffset(0).WithLimit(1)) | ||
|
||
if err != nil { | ||
fmt.Fprintf(os.Stderr, "Error when calling `UsageMeteringApi.GetUsageAttribution`: %v\n", err) | ||
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) | ||
} | ||
|
||
responseContent, _ := json.MarshalIndent(resp, "", " ") | ||
fmt.Fprintf(os.Stdout, "Response from `UsageMeteringApi.GetUsageAttribution`:\n%s\n", responseContent) | ||
} |
1 change: 1 addition & 0 deletions
1
...arios/v1/Feature_Usage_Metering/Scenario_Get_Usage_Attribution_returns_OK_response.freeze
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
2022-01-11T15:18:06.776Z |
21 changes: 21 additions & 0 deletions
21
...enarios/v1/Feature_Usage_Metering/Scenario_Get_Usage_Attribution_returns_OK_response.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
interactions: | ||
- request: | ||
body: '' | ||
form: {} | ||
headers: | ||
Accept: | ||
- application/json;datetime-format=rfc3339 | ||
method: GET | ||
url: https://api.datadoghq.com/api/v1/usage/attribution?start_month=2022-01-08T15%3A18%3A06.776Z&fields=%2A&offset=0&limit=1 | ||
response: | ||
body: '{"usage":[{"org_name":"DD Integration Tests (321813)","public_id":"fasjyydbcgwwc2uc","tag_config_source":"DD | ||
Integration Tests (321813):::project","tags":{"project":[]},"updated_at":"2022-01-10T14","month":"2022-01-01T00:00:00+00:00","values":{"lambda_percentage":0.0,"apm_host_usage":11,"api_usage":1524624,"dbm_hosts_percentage":0.0,"custom_timeseries_percentage":100.0,"fargate_usage":0.0,"cws_containers_usage":0.0,"profiled_host_percentage":0.0,"cws_hosts_usage":0,"cspm_hosts_percentage":0.0,"cws_hosts_percentage":0.0,"lambda_invocations_percentage":0.0,"infra_host_usage":5,"infra_host_percentage":27.78,"cspm_hosts_usage":0,"container_percentage":100.0,"profiled_host_usage":0,"dbm_queries_usage":0.0,"browser_usage":0,"snmp_percentage":0.0,"profiled_container_usage":0.0,"lambda_functions_usage":0.0,"snmp_usage":0,"api_percentage":100.0,"dbm_hosts_usage":0,"container_usage":1.02,"lambda_usage":0.0,"cspm_containers_usage":0.0,"cspm_containers_percentage":0.0,"npm_host_usage":0,"apm_host_percentage":100.0,"lambda_functions_percentage":0.0,"dbm_queries_percentage":0.0,"profiled_container_percentage":0.0,"npm_host_percentage":0.0,"lambda_invocations_usage":0,"fargate_percentage":0.0,"browser_percentage":0.0,"cws_containers_percentage":0.0,"custom_timeseries_usage":77.08}},{"org_name":"DD | ||
Integration Tests (321813)","public_id":"fasjyydbcgwwc2uc","tag_config_source":"DD | ||
Integration Tests (321813):::project","tags":{"project":["datadog-integrations-lab"]},"updated_at":"2022-01-10T14","month":"2022-01-01T00:00:00+00:00","values":{"lambda_percentage":0.0,"apm_host_usage":0,"api_usage":0,"dbm_hosts_percentage":0.0,"custom_timeseries_percentage":0.0,"fargate_usage":0.0,"cws_containers_usage":0.0,"profiled_host_percentage":0.0,"cws_hosts_usage":0,"cspm_hosts_percentage":0.0,"cws_hosts_percentage":0.0,"lambda_invocations_percentage":0.0,"infra_host_usage":13,"infra_host_percentage":72.22,"cspm_hosts_usage":0,"container_percentage":0.0,"profiled_host_usage":0,"dbm_queries_usage":0.0,"browser_usage":0,"snmp_percentage":0.0,"profiled_container_usage":0.0,"lambda_functions_usage":0.0,"snmp_usage":0,"api_percentage":0.0,"dbm_hosts_usage":0,"container_usage":0.0,"lambda_usage":0.0,"cspm_containers_usage":0.0,"cspm_containers_percentage":0.0,"npm_host_usage":0,"apm_host_percentage":0.0,"lambda_functions_percentage":0.0,"dbm_queries_percentage":0.0,"profiled_container_percentage":0.0,"npm_host_percentage":0.0,"lambda_invocations_usage":0,"fargate_percentage":0.0,"browser_percentage":0.0,"cws_containers_percentage":0.0,"custom_timeseries_usage":0.0}}],"metadata":{"pagination":{"sort_direction":"DESC","sort_name":"custom_timeseries_usage","limit":5000,"total_number_of_records":2,"offset":0},"aggregates":[{"field":"custom_timeseries_usage","value":77.08,"agg_type":"sum"},{"field":"container_usage","value":1.02,"agg_type":"sum"},{"field":"snmp_percentage","value":0.0,"agg_type":"sum"},{"field":"apm_host_usage","value":11.0,"agg_type":"sum"},{"field":"browser_usage","value":0.0,"agg_type":"sum"},{"field":"npm_host_percentage","value":0.0,"agg_type":"sum"},{"field":"infra_host_usage","value":18.0,"agg_type":"sum"},{"field":"custom_timeseries_percentage","value":100.0,"agg_type":"sum"},{"field":"container_percentage","value":100.0,"agg_type":"sum"},{"field":"lambda_usage","value":0.0,"agg_type":"sum"},{"field":"api_usage","value":1524624.0,"agg_type":"sum"},{"field":"apm_host_percentage","value":100.0,"agg_type":"sum"},{"field":"infra_host_percentage","value":100.0,"agg_type":"sum"},{"field":"snmp_usage","value":0.0,"agg_type":"sum"},{"field":"browser_percentage","value":0.0,"agg_type":"sum"},{"field":"api_percentage","value":100.0,"agg_type":"sum"},{"field":"lambda_percentage","value":0.0,"agg_type":"sum"},{"field":"npm_host_usage","value":0.0,"agg_type":"sum"},{"field":"lambda_functions_usage","value":0.0,"agg_type":"sum"},{"field":"lambda_functions_percentage","value":0.0,"agg_type":"sum"},{"field":"lambda_invocations_usage","value":0.0,"agg_type":"sum"},{"field":"lambda_invocations_percentage","value":0.0,"agg_type":"sum"},{"field":"fargate_usage","value":0.0,"agg_type":"sum"},{"field":"fargate_percentage","value":0.0,"agg_type":"sum"},{"field":"profiled_host_usage","value":0.0,"agg_type":"sum"},{"field":"profiled_host_percentage","value":0.0,"agg_type":"sum"},{"field":"profiled_container_usage","value":0.0,"agg_type":"sum"},{"field":"profiled_container_percentage","value":0.0,"agg_type":"sum"},{"field":"cws_hosts_usage","value":0.0,"agg_type":"sum"},{"field":"cws_hosts_percentage","value":0.0,"agg_type":"sum"},{"field":"cws_containers_usage","value":0.0,"agg_type":"sum"},{"field":"cws_containers_percentage","value":0.0,"agg_type":"sum"},{"field":"cspm_hosts_usage","value":0.0,"agg_type":"sum"},{"field":"cspm_hosts_percentage","value":0.0,"agg_type":"sum"},{"field":"cspm_containers_usage","value":0.0,"agg_type":"sum"},{"field":"cspm_containers_percentage","value":0.0,"agg_type":"sum"},{"field":"dbm_hosts_usage","value":0.0,"agg_type":"sum"},{"field":"dbm_hosts_percentage","value":0.0,"agg_type":"sum"},{"field":"dbm_queries_usage","value":0.0,"agg_type":"sum"},{"field":"dbm_queries_percentage","value":0.0,"agg_type":"sum"}]}}' | ||
code: 200 | ||
duration: '' | ||
headers: | ||
Content-Type: | ||
- application/json | ||
status: 200 OK | ||
version: 1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters