Skip to content
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
100 changes: 98 additions & 2 deletions .generator/schemas/v2/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18761,6 +18761,13 @@ components:
format: date-time
readOnly: true
type: string
date_last_used:
description: Date the API Key was last used
example: '2020-11-27T10:00:00.000Z'
format: date-time
nullable: true
readOnly: true
type: string
key:
description: The API key.
readOnly: true
Expand Down Expand Up @@ -18819,6 +18826,13 @@ components:
minLength: 4
readOnly: true
type: string
last_used_at:
description: Last usage timestamp of the application key.
example: '2020-12-20T10:00:00.000Z'
format: date-time
nullable: true
readOnly: true
type: string
name:
description: Name of the application key.
example: Application Key for managing dashboards
Expand Down Expand Up @@ -34754,6 +34768,13 @@ components:
example: '2020-11-23T10:00:00.000Z'
readOnly: true
type: string
date_last_used:
description: Date the API Key was last used.
example: '2020-11-27T10:00:00.000Z'
format: date-time
nullable: true
readOnly: true
type: string
last4:
description: The last four characters of the API key.
example: abcd
Expand Down Expand Up @@ -34802,6 +34823,12 @@ components:
minLength: 4
readOnly: true
type: string
last_used_at:
description: Last usage timestamp of the application key.
example: '2020-12-20T10:00:00.000Z'
nullable: true
readOnly: true
type: string
name:
description: Name of the application key.
example: Application Key for managing dashboards
Expand Down Expand Up @@ -37778,6 +37805,7 @@ components:
- type
type: object
RoleAttributes:
additionalProperties: {}
description: Attributes of the role.
properties:
created_at:
Expand Down Expand Up @@ -56815,6 +56843,40 @@ paths:
tags:
- DORA Metrics
x-codegen-request-body-name: body
/api/v2/dora/deployment/{deployment_id}:
delete:
description: Use this API endpoint to delete a deployment event.
operationId: DeleteDORADeployment
parameters:
- description: The ID of the deployment event to delete.
in: path
name: deployment_id
required: true
schema:
type: string
responses:
'202':
description: Accepted
'400':
content:
application/json:
schema:
$ref: '#/components/schemas/JSONAPIErrorResponse'
description: Bad Request
'403':
$ref: '#/components/responses/NotAuthorizedResponse'
'429':
$ref: '#/components/responses/TooManyRequestsResponse'
security:
- apiKeyAuth: []
- appKeyAuth: []
summary: Delete a deployment event
tags:
- DORA Metrics
x-permission:
operator: OR
permissions:
- dora_metrics_write
/api/v2/dora/deployments:
post:
description: Use this API endpoint to get a list of deployment events.
Expand Down Expand Up @@ -56938,6 +57000,40 @@ paths:
tags:
- DORA Metrics
x-codegen-request-body-name: body
/api/v2/dora/failure/{failure_id}:
delete:
description: Use this API endpoint to delete a failure event.
operationId: DeleteDORAFailure
parameters:
- description: The ID of the failure event to delete.
in: path
name: failure_id
required: true
schema:
type: string
responses:
'202':
description: Accepted
'400':
content:
application/json:
schema:
$ref: '#/components/schemas/JSONAPIErrorResponse'
description: Bad Request
'403':
$ref: '#/components/responses/NotAuthorizedResponse'
'429':
$ref: '#/components/responses/TooManyRequestsResponse'
security:
- apiKeyAuth: []
- appKeyAuth: []
summary: Delete a failure event
tags:
- DORA Metrics
x-permission:
operator: OR
permissions:
- dora_metrics_write
/api/v2/dora/failures:
post:
description: Use this API endpoint to get a list of failure events.
Expand Down Expand Up @@ -75627,8 +75723,8 @@ tags:
See the [Container Monitoring page](https://docs.datadoghq.com/containers/) for
more information.
name: Containers
- description: 'Search or send events for DORA Metrics to measure and improve your
software delivery performance. See the [DORA Metrics page](https://docs.datadoghq.com/dora_metrics/)
- description: 'Search, send, or delete events for DORA Metrics to measure and improve
your software delivery performance. See the [DORA Metrics page](https://docs.datadoghq.com/dora_metrics/)
for more information.


Expand Down
154 changes: 154 additions & 0 deletions api/datadogV2/api_dora_metrics.go
Original file line number Diff line number Diff line change
Expand Up @@ -278,6 +278,160 @@ func (a *DORAMetricsApi) CreateDORAIncident(ctx _context.Context, body DORAFailu
return localVarReturnValue, localVarHTTPResponse, nil
}

// DeleteDORADeployment Delete a deployment event.
// Use this API endpoint to delete a deployment event.
func (a *DORAMetricsApi) DeleteDORADeployment(ctx _context.Context, deploymentId string) (*_nethttp.Response, error) {
var (
localVarHTTPMethod = _nethttp.MethodDelete
localVarPostBody interface{}
)

localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, "v2.DORAMetricsApi.DeleteDORADeployment")
if err != nil {
return nil, datadog.GenericOpenAPIError{ErrorMessage: err.Error()}
}

localVarPath := localBasePath + "/api/v2/dora/deployment/{deployment_id}"
localVarPath = datadog.ReplacePathParameter(localVarPath, "{deployment_id}", _neturl.PathEscape(datadog.ParameterToString(deploymentId, "")))

localVarHeaderParams := make(map[string]string)
localVarQueryParams := _neturl.Values{}
localVarFormParams := _neturl.Values{}
localVarHeaderParams["Accept"] = "*/*"

if a.Client.Cfg.DelegatedTokenConfig != nil {
err = datadog.UseDelegatedTokenAuth(ctx, &localVarHeaderParams, a.Client.Cfg.DelegatedTokenConfig)
if err != nil {
return nil, err
}
} else {
datadog.SetAuthKeys(
ctx,
&localVarHeaderParams,
[2]string{"apiKeyAuth", "DD-API-KEY"},
[2]string{"appKeyAuth", "DD-APPLICATION-KEY"},
)
}
req, err := a.Client.PrepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, nil)
if err != nil {
return nil, err
}

localVarHTTPResponse, err := a.Client.CallAPI(req)
if err != nil || localVarHTTPResponse == nil {
return localVarHTTPResponse, err
}

localVarBody, err := datadog.ReadBody(localVarHTTPResponse)
if err != nil {
return localVarHTTPResponse, err
}

if localVarHTTPResponse.StatusCode >= 300 {
newErr := datadog.GenericOpenAPIError{
ErrorBody: localVarBody,
ErrorMessage: localVarHTTPResponse.Status,
}
if localVarHTTPResponse.StatusCode == 400 {
var v JSONAPIErrorResponse
err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
if err != nil {
return localVarHTTPResponse, newErr
}
newErr.ErrorModel = v
return localVarHTTPResponse, newErr
}
if localVarHTTPResponse.StatusCode == 403 || localVarHTTPResponse.StatusCode == 429 {
var v APIErrorResponse
err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
if err != nil {
return localVarHTTPResponse, newErr
}
newErr.ErrorModel = v
}
return localVarHTTPResponse, newErr
}

return localVarHTTPResponse, nil
}

// DeleteDORAFailure Delete a failure event.
// Use this API endpoint to delete a failure event.
func (a *DORAMetricsApi) DeleteDORAFailure(ctx _context.Context, failureId string) (*_nethttp.Response, error) {
var (
localVarHTTPMethod = _nethttp.MethodDelete
localVarPostBody interface{}
)

localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, "v2.DORAMetricsApi.DeleteDORAFailure")
if err != nil {
return nil, datadog.GenericOpenAPIError{ErrorMessage: err.Error()}
}

localVarPath := localBasePath + "/api/v2/dora/failure/{failure_id}"
localVarPath = datadog.ReplacePathParameter(localVarPath, "{failure_id}", _neturl.PathEscape(datadog.ParameterToString(failureId, "")))

localVarHeaderParams := make(map[string]string)
localVarQueryParams := _neturl.Values{}
localVarFormParams := _neturl.Values{}
localVarHeaderParams["Accept"] = "*/*"

if a.Client.Cfg.DelegatedTokenConfig != nil {
err = datadog.UseDelegatedTokenAuth(ctx, &localVarHeaderParams, a.Client.Cfg.DelegatedTokenConfig)
if err != nil {
return nil, err
}
} else {
datadog.SetAuthKeys(
ctx,
&localVarHeaderParams,
[2]string{"apiKeyAuth", "DD-API-KEY"},
[2]string{"appKeyAuth", "DD-APPLICATION-KEY"},
)
}
req, err := a.Client.PrepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, nil)
if err != nil {
return nil, err
}

localVarHTTPResponse, err := a.Client.CallAPI(req)
if err != nil || localVarHTTPResponse == nil {
return localVarHTTPResponse, err
}

localVarBody, err := datadog.ReadBody(localVarHTTPResponse)
if err != nil {
return localVarHTTPResponse, err
}

if localVarHTTPResponse.StatusCode >= 300 {
newErr := datadog.GenericOpenAPIError{
ErrorBody: localVarBody,
ErrorMessage: localVarHTTPResponse.Status,
}
if localVarHTTPResponse.StatusCode == 400 {
var v JSONAPIErrorResponse
err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
if err != nil {
return localVarHTTPResponse, newErr
}
newErr.ErrorModel = v
return localVarHTTPResponse, newErr
}
if localVarHTTPResponse.StatusCode == 403 || localVarHTTPResponse.StatusCode == 429 {
var v APIErrorResponse
err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
if err != nil {
return localVarHTTPResponse, newErr
}
newErr.ErrorModel = v
}
return localVarHTTPResponse, newErr
}

return localVarHTTPResponse, nil
}

// GetDORADeployment Get a deployment event.
// Use this API endpoint to get a deployment event.
func (a *DORAMetricsApi) GetDORADeployment(ctx _context.Context, deploymentId string) (DORAFetchResponse, *_nethttp.Response, error) {
Expand Down
2 changes: 2 additions & 0 deletions api/datadogV2/doc.go
Original file line number Diff line number Diff line change
Expand Up @@ -174,6 +174,8 @@
// - [DORAMetricsApi.CreateDORADeployment]
// - [DORAMetricsApi.CreateDORAFailure]
// - [DORAMetricsApi.CreateDORAIncident]
// - [DORAMetricsApi.DeleteDORADeployment]
// - [DORAMetricsApi.DeleteDORAFailure]
// - [DORAMetricsApi.GetDORADeployment]
// - [DORAMetricsApi.GetDORAFailure]
// - [DORAMetricsApi.ListDORADeployments]
Expand Down
Loading
Loading