Skip to content

Commit

Permalink
Regenerate client from commit d7fae3ec of spec repo
Browse files Browse the repository at this point in the history
  • Loading branch information
ci.datadog-api-spec committed Mar 26, 2024
1 parent fe83698 commit ed41f92
Show file tree
Hide file tree
Showing 33 changed files with 2,030 additions and 4 deletions.
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.6.6",
"regenerated": "2024-03-26 15:17:41.342524",
"spec_repo_commit": "46383d02"
"regenerated": "2024-03-26 16:06:02.479587",
"spec_repo_commit": "d7fae3ec"
},
"v2": {
"apigentools_version": "1.6.6",
"regenerated": "2024-03-26 15:17:41.373837",
"spec_repo_commit": "46383d02"
"regenerated": "2024-03-26 16:06:02.497643",
"spec_repo_commit": "d7fae3ec"
}
}
}
276 changes: 276 additions & 0 deletions .generator/schemas/v2/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -411,6 +411,13 @@ components:
required: true
schema:
type: string
ReportID:
description: The ID of the report job.
in: path
name: report_id
required: true
schema:
type: string
ResourceID:
description: 'Identifier, formatted as `type:id`. Supported types: `connection`,
`dashboard`, `notebook`, `security-rule`, `slo`.'
Expand Down Expand Up @@ -16487,6 +16494,92 @@ components:
type: string
x-enum-varnames:
- SAML_ASSERTION_ATTRIBUTES
SLOReportInterval:
description: The frequency at which report data is to be generated.
enum:
- weekly
- monthly
example: weekly
type: string
x-enum-varnames:
- WEEKLY
- MONTHLY
SLOReportPostRequest:
description: The SLO report request body.
properties:
data:
$ref: '#/components/schemas/SLOReportPostRequestData'
required:
- data
type: object
SLOReportPostRequestData:
description: The data portion of the SLO report request.
properties:
attributes:
$ref: '#/components/schemas/SloReportPostRequestAttributes'
required:
- attributes
type: object
SLOReportPostResponse:
description: The SLO report response.
properties:
data:
$ref: '#/components/schemas/SLOReportPostResponseData'
type: object
SLOReportPostResponseData:
description: The data portion of the SLO report response.
properties:
id:
description: The ID of the report job.
example: dc8d92aa-e0af-11ee-af21-1feeaccaa3a3
type: string
type:
description: The type of ID.
example: report_id
type: string
type: object
SLOReportStatus:
description: The status of the SLO report job.
enum:
- IN_PROGRESS
- COMPLETED
- COMPLETED_WITH_ERRORS
- FAILED
- UNKNOWN
example: COMPLETED
type: string
x-enum-varnames:
- IN_PROGRESS
- COMPLETED
- COMPLETED_WITH_ERRORS
- FAILED
- UNKNOWN
SLOReportStatusGetResponse:
description: The SLO report status response.
properties:
data:
$ref: '#/components/schemas/SLOReportStatusGetResponseData'
type: object
SLOReportStatusGetResponseAttributes:
description: The attributes portion of the SLO report status response.
properties:
status:
$ref: '#/components/schemas/SLOReportStatus'
type: object
SLOReportStatusGetResponseData:
description: The data portion of the SLO report status response.
properties:
attributes:
$ref: '#/components/schemas/SLOReportStatusGetResponseAttributes'
id:
description: The ID of the report job.
example: dc8d92aa-e0af-11ee-af21-1feeaccaa3a3
type: string
type:
description: The type of ID.
example: report_id
type: string
type: object
ScalarColumn:
description: A single column in a scalar query response.
oneOf:
Expand Down Expand Up @@ -20124,6 +20217,37 @@ components:
- channel_name
- redirect_url
type: object
SloReportPostRequestAttributes:
description: The attributes portion of the SLO report request.
properties:
from_ts:
description: The `from` timestamp for the report in epoch seconds.
example: 1690901870
format: int64
type: integer
interval:
$ref: '#/components/schemas/SLOReportInterval'
query:
description: The query string used to filter SLO results. Some examples
of queries include `service:<service-name>` and `slo-name`.
example: slo_type:metric
type: string
timezone:
description: The timezone used to determine the start and end of each interval.
For example, weekly intervals start at 12am on Sunday in the specified
timezone.
example: America/New_York
type: string
to_ts:
description: The `to` timestamp for the report in epoch seconds.
example: 1706803070
format: int64
type: integer
required:
- query
- from_ts
- to_ts
type: object
SortDirection:
default: desc
description: The direction to sort by.
Expand Down Expand Up @@ -33594,6 +33718,146 @@ paths:
- Incident Services
x-codegen-request-body-name: body
x-unstable: '**Note**: This endpoint is deprecated.'
/api/v2/slo/report:
post:
description: 'Create a job to generate an SLO report. The report job is processed
asynchronously and will eventually result in a CSV report being available
for download.


Check the status of the job and download the CSV report using the returned
`report_id`.'
operationId: CreateSLOReportJob
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/SLOReportPostRequest'
description: Create SLO report job request body.
required: true
responses:
'200':
content:
application/json:
schema:
$ref: '#/components/schemas/SLOReportPostResponse'
description: OK
'400':
content:
application/json:
schema:
$ref: '#/components/schemas/APIErrorResponse'
description: Bad Request
'403':
content:
application/json:
schema:
$ref: '#/components/schemas/APIErrorResponse'
description: Forbidden
'429':
$ref: '#/components/responses/TooManyRequestsResponse'
security:
- apiKeyAuth: []
appKeyAuth: []
- AuthZ:
- slos_read
summary: Create a new SLO report
tags:
- Service Level Objectives
x-codegen-request-body-name: body
x-unstable: '**Note: This feature is in private beta. If you are interested
in joining,

request access via [our public docs](https://docs.datadoghq.com/service_management/service_level_objectives/#slo-csv-export).**'
/api/v2/slo/report/{report_id}/download:
get:
description: 'Download an SLO report. This can only be performed after the report
job has completed.


Reports are not guaranteed to exist indefinitely. It is recommended to download
the report as soon as it is available.'
operationId: GetSLOReport
parameters:
- $ref: '#/components/parameters/ReportID'
responses:
'200':
content:
text/csv:
schema:
type: string
description: OK
'403':
content:
application/json:
schema:
$ref: '#/components/schemas/APIErrorResponse'
description: Forbidden
'404':
content:
application/json:
schema:
$ref: '#/components/schemas/APIErrorResponse'
description: Not Found
'429':
$ref: '#/components/responses/TooManyRequestsResponse'
security:
- apiKeyAuth: []
appKeyAuth: []
- AuthZ:
- slos_read
summary: Get SLO report
tags:
- Service Level Objectives
x-unstable: '**Note: This feature is in private beta. If you are interested
in joining,

request access via [our public docs](https://docs.datadoghq.com/service_management/service_level_objectives/#slo-csv-export).**'
/api/v2/slo/report/{report_id}/status:
get:
description: Get the status of the SLO report job.
operationId: GetSLOReportJobStatus
parameters:
- $ref: '#/components/parameters/ReportID'
responses:
'200':
content:
application/json:
schema:
$ref: '#/components/schemas/SLOReportStatusGetResponse'
description: OK
'400':
content:
application/json:
schema:
$ref: '#/components/schemas/APIErrorResponse'
description: Bad Request
'403':
content:
application/json:
schema:
$ref: '#/components/schemas/APIErrorResponse'
description: Forbidden
'404':
content:
application/json:
schema:
$ref: '#/components/schemas/APIErrorResponse'
description: Not Found
'429':
$ref: '#/components/responses/TooManyRequestsResponse'
security:
- apiKeyAuth: []
appKeyAuth: []
- AuthZ:
- slos_read
summary: Get SLO report status
tags:
- Service Level Objectives
x-unstable: '**Note: This feature is in private beta. If you are interested
in joining,

request access via [our public docs](https://docs.datadoghq.com/service_management/service_level_objectives/#slo-csv-export).**'
/api/v2/spans/analytics/aggregate:
post:
description: 'The API endpoint to aggregate spans into buckets and compute metrics
Expand Down Expand Up @@ -36008,6 +36272,18 @@ tags:
externalDocs:
url: https://docs.datadoghq.com/tracing/service_catalog/
name: Service Definition
- description: '[Service Level Objectives](https://docs.datadoghq.com/monitors/service_level_objectives/#configuration)

(or SLOs) are a key part of the site reliability engineering toolkit.

SLOs provide a framework for defining clear targets around application performance,

which ultimately help teams provide a consistent customer experience,

balance feature development with platform stability,

and improve communication with internal and external users.'
name: Service Level Objectives
- description: 'API to create, update scorecard rules and outcomes. See [Service Scorecards](https://docs.datadoghq.com/service_catalog/scorecards)
for more information.

Expand Down
29 changes: 29 additions & 0 deletions examples/v2_service-level-objectives_create_slo_report_job.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
// Create a new SLO report returns "OK" response
use datadog_api_client::datadog::configuration::Configuration;
use datadog_api_client::datadogV2::api::api_service_level_objectives::ServiceLevelObjectivesAPI;
use datadog_api_client::datadogV2::model::SLOReportInterval;
use datadog_api_client::datadogV2::model::SLOReportPostRequest;
use datadog_api_client::datadogV2::model::SLOReportPostRequestData;
use datadog_api_client::datadogV2::model::SloReportPostRequestAttributes;

#[tokio::main]
async fn main() {
let body = SLOReportPostRequest::new(SLOReportPostRequestData::new(
SloReportPostRequestAttributes::new(
1690901870,
r#"slo_type:metric "SLO Reporting Test""#.to_string(),
1706803070,
)
.interval(SLOReportInterval::MONTHLY)
.timezone("America/New_York".to_string()),
));
let mut configuration = Configuration::new();
configuration.set_unstable_operation_enabled("v2.CreateSLOReportJob", true);
let api = ServiceLevelObjectivesAPI::with_config(configuration);
let resp = api.create_slo_report_job(body).await;
if let Ok(value) = resp {
println!("{:#?}", value);
} else {
println!("{:#?}", resp.unwrap_err());
}
}
18 changes: 18 additions & 0 deletions examples/v2_service-level-objectives_get_slo_report.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
// Get SLO report returns "OK" response
use datadog_api_client::datadog::configuration::Configuration;
use datadog_api_client::datadogV2::api::api_service_level_objectives::ServiceLevelObjectivesAPI;

#[tokio::main]
async fn main() {
let mut configuration = Configuration::new();
configuration.set_unstable_operation_enabled("v2.GetSLOReport", true);
let api = ServiceLevelObjectivesAPI::with_config(configuration);
let resp = api
.get_slo_report("9fb2dc2a-ead0-11ee-a174-9fe3a9d7627f".to_string())
.await;
if let Ok(value) = resp {
println!("{:#?}", value);
} else {
println!("{:#?}", resp.unwrap_err());
}
}
18 changes: 18 additions & 0 deletions examples/v2_service-level-objectives_get_slo_report_job_status.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
// Get SLO report status returns "OK" response
use datadog_api_client::datadog::configuration::Configuration;
use datadog_api_client::datadogV2::api::api_service_level_objectives::ServiceLevelObjectivesAPI;

#[tokio::main]
async fn main() {
// there is a valid "report" in the system
let report_data_id = std::env::var("REPORT_DATA_ID").unwrap();
let mut configuration = Configuration::new();
configuration.set_unstable_operation_enabled("v2.GetSLOReportJobStatus", true);
let api = ServiceLevelObjectivesAPI::with_config(configuration);
let resp = api.get_slo_report_job_status(report_data_id.clone()).await;
if let Ok(value) = resp {
println!("{:#?}", value);
} else {
println!("{:#?}", resp.unwrap_err());
}
}
Loading

0 comments on commit ed41f92

Please sign in to comment.