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
71 changes: 34 additions & 37 deletions .generator/schemas/v2/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28815,12 +28815,12 @@ components:
- "department:engineering"
- "region:us-east-1"
env: "production"
finished_at: 1693491984000000000
finished_at: "2023-08-31T14:26:24Z"
git:
commit_sha: "66adc9350f2cc9b250b69abddab733dd55e1a588"
repository_id: "github.com/organization/example-repository"
service: "shopist"
started_at: 1693491974000000000
started_at: "2023-08-31T14:26:14Z"
team: "backend"
version: "v1.12.07"
id: "4242fcdd31586083"
Expand All @@ -28844,21 +28844,21 @@ components:
example: production
type: string
finished_at:
description: Unix timestamp when the deployment finished.
example: 1693491984000000000
format: int64
type: integer
description: The time when the deployment finished.
example: "2023-08-31T14:26:24Z"
format: date-time
type: string
git:
$ref: "#/components/schemas/DORAGitInfoResponse"
service:
description: Service name.
example: shopist
type: string
started_at:
description: Unix timestamp when the deployment started.
example: 1693491974000000000
format: int64
type: integer
description: The time when the deployment started.
example: "2023-08-31T14:26:14Z"
format: date-time
type: string
team:
description: Name of the team owning the deployed service.
example: backend
Expand All @@ -28870,7 +28870,6 @@ components:
required:
- service
- started_at
- finished_at
type: object
DORADeploymentPatchRemediation:
description: Remediation details for the deployment. Optional, but required to calculate failed deployment recovery time.
Expand Down Expand Up @@ -29048,12 +29047,12 @@ components:
- "department:engineering"
- "region:us-east-1"
env: "production"
finished_at: 1693491984000000000
finished_at: "2023-08-31T14:26:24Z"
git:
commit_sha: "66adc9350f2cc9b250b69abddab733dd55e1a588"
repository_id: "github.com/organization/example-repository"
service: "shopist"
started_at: 1693491974000000000
started_at: "2023-08-31T14:26:14Z"
team: "backend"
version: "v1.12.07"
id: "4242fcdd31586083"
Expand All @@ -29063,12 +29062,12 @@ components:
- "language:go"
- "department:platform"
env: "production"
finished_at: 1693492084000000000
finished_at: "2023-08-31T14:28:04Z"
git:
commit_sha: "77bdc9350f2cc9b250b69abddab733dd55e1a599"
repository_id: "github.com/organization/api-service"
service: "api-service"
started_at: 1693492074000000000
started_at: "2023-08-31T14:27:54Z"
team: "backend"
version: "v2.1.0"
id: "4242fcdd31586084"
Expand Down Expand Up @@ -29190,12 +29189,12 @@ components:
- "incident_type:database"
- "department:engineering"
env: "production"
finished_at: 1693492274000000000
finished_at: "2023-08-31T14:31:14Z"
name: "Database outage"
services:
- "shopist"
severity: "SEV-1"
started_at: 1693492174000000000
started_at: "2023-08-31T14:29:34Z"
team: "backend"
id: "4242fcdd31586085"
type: "dora_incident"
Expand All @@ -29204,13 +29203,13 @@ components:
- "incident_type:service_down"
- "department:platform"
env: "production"
finished_at: 1693492474000000000
finished_at: "2023-08-31T14:34:34Z"
name: "API service outage"
services:
- "api-service"
- "payment-service"
severity: "SEV-2"
started_at: 1693492374000000000
started_at: "2023-08-31T14:32:54Z"
team: "backend"
id: "4242fcdd31586086"
type: "dora_incident"
Expand Down Expand Up @@ -29251,15 +29250,15 @@ components:
- "incident_type:database"
- "department:engineering"
env: "production"
finished_at: 1693492274000000000
finished_at: "2023-08-31T14:31:14Z"
git:
commit_sha: "66adc9350f2cc9b250b69abddab733dd55e1a588"
repository_url: "https://github.com/organization/example-repository"
name: "Database outage"
services:
- "shopist"
severity: "SEV-1"
started_at: 1693492174000000000
started_at: "2023-08-31T14:29:34Z"
team: "backend"
id: "4242fcdd31586085"
type: "dora_incident"
Expand All @@ -29282,10 +29281,10 @@ components:
example: production
type: string
finished_at:
description: Unix timestamp when the incident finished.
example: 1693491984000000000
format: int64
type: integer
description: The time when the incident finished.
example: "2023-08-31T14:26:24Z"
format: date-time
type: string
git:
$ref: "#/components/schemas/DORAGitInfo"
name:
Expand All @@ -29304,10 +29303,10 @@ components:
example: SEV-1
type: string
started_at:
description: Unix timestamp when the incident started.
example: 1693491974000000000
format: int64
type: integer
description: The time when the incident started.
example: "2023-08-31T14:26:14Z"
format: date-time
type: string
team:
description: Name of the team owning the services impacted.
example: backend
Expand All @@ -29316,8 +29315,6 @@ components:
description: Version to correlate with APM Deployment Tracking.
example: v1.12.07
type: string
required:
- started_at
type: object
DORAListDeploymentsRequest:
description: Request to get a list of deployments.
Expand Down Expand Up @@ -132589,9 +132586,9 @@ paths:
data:
- attributes:
env: production
finished_at: 1693491984000000000
finished_at: "2023-08-31T14:26:24Z"
service: test-service
started_at: 1693491974000000000
started_at: "2023-08-31T14:26:14Z"
team: backend
id: abc-123
type: dora_deployment
Expand Down Expand Up @@ -132640,9 +132637,9 @@ paths:
data:
attributes:
env: production
finished_at: 1693491984000000000
finished_at: "2023-08-31T14:26:24Z"
service: test-service
started_at: 1693491974000000000
started_at: "2023-08-31T14:26:14Z"
team: backend
id: abc-123
type: dora_deployment
Expand Down Expand Up @@ -132863,7 +132860,7 @@ paths:
services:
- test-service
severity: SEV-1
started_at: 1693492174000000000
started_at: "2023-08-31T14:29:34Z"
team: backend
id: abc-123
type: dora_failure
Expand Down Expand Up @@ -132916,7 +132913,7 @@ paths:
services:
- test-service
severity: SEV-1
started_at: 1693492174000000000
started_at: "2023-08-31T14:29:34Z"
team: backend
id: abc-123
type: dora_failure
Expand Down
29 changes: 29 additions & 0 deletions examples/v2/dora-metrics/ListDORADeployments_1654201709.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
"""
Get a list of deployment events returns deployments with date-time timestamps
"""

from datadog_api_client import ApiClient, Configuration
from datadog_api_client.v2.api.dora_metrics_api import DORAMetricsApi
from datadog_api_client.v2.model.dora_list_deployments_request import DORAListDeploymentsRequest
from datadog_api_client.v2.model.dora_list_deployments_request_attributes import DORAListDeploymentsRequestAttributes
from datadog_api_client.v2.model.dora_list_deployments_request_data import DORAListDeploymentsRequestData
from datadog_api_client.v2.model.dora_list_deployments_request_data_type import DORAListDeploymentsRequestDataType
from datetime import datetime
from dateutil.tz import tzutc

body = DORAListDeploymentsRequest(
data=DORAListDeploymentsRequestData(
attributes=DORAListDeploymentsRequestAttributes(
_from=datetime(2023, 8, 31, 0, 0, tzinfo=tzutc()),
to=datetime(2023, 9, 1, 0, 0, tzinfo=tzutc()),
),
type=DORAListDeploymentsRequestDataType.DORA_DEPLOYMENTS_LIST_REQUEST,
),
)

configuration = Configuration()
with ApiClient(configuration) as api_client:
api_instance = DORAMetricsApi(api_client)
response = api_instance.list_dora_deployments(body=body)

print(response)
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
from datadog_api_client.model_utils import (
ModelNormal,
cached_property,
datetime,
none_type,
unset,
UnsetType,
Expand All @@ -26,10 +27,10 @@ def openapi_types(_):
return {
"custom_tags": ([str],),
"env": (str,),
"finished_at": (int,),
"finished_at": (datetime,),
"git": (DORAGitInfoResponse,),
"service": (str,),
"started_at": (int,),
"started_at": (datetime,),
"team": (str,),
"version": (str,),
}
Expand All @@ -47,11 +48,11 @@ def openapi_types(_):

def __init__(
self_,
finished_at: int,
service: str,
started_at: int,
started_at: datetime,
custom_tags: Union[List[str], none_type, UnsetType] = unset,
env: Union[str, UnsetType] = unset,
finished_at: Union[datetime, UnsetType] = unset,
git: Union[DORAGitInfoResponse, UnsetType] = unset,
team: Union[str, UnsetType] = unset,
version: Union[str, UnsetType] = unset,
Expand All @@ -66,17 +67,17 @@ def __init__(
:param env: Environment name to where the service was deployed.
:type env: str, optional

:param finished_at: Unix timestamp when the deployment finished.
:type finished_at: int
:param finished_at: The time when the deployment finished.
:type finished_at: datetime, optional

:param git: Git info returned by DORA Metrics events.
:type git: DORAGitInfoResponse, optional

:param service: Service name.
:type service: str

:param started_at: Unix timestamp when the deployment started.
:type started_at: int
:param started_at: The time when the deployment started.
:type started_at: datetime

:param team: Name of the team owning the deployed service.
:type team: str, optional
Expand All @@ -88,6 +89,8 @@ def __init__(
kwargs["custom_tags"] = custom_tags
if env is not unset:
kwargs["env"] = env
if finished_at is not unset:
kwargs["finished_at"] = finished_at
if git is not unset:
kwargs["git"] = git
if team is not unset:
Expand All @@ -96,6 +99,5 @@ def __init__(
kwargs["version"] = version
super().__init__(kwargs)

self_.finished_at = finished_at
self_.service = service
self_.started_at = started_at
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
from datadog_api_client.model_utils import (
ModelNormal,
cached_property,
datetime,
none_type,
unset,
UnsetType,
Expand All @@ -26,12 +27,12 @@ def openapi_types(_):
return {
"custom_tags": ([str],),
"env": (str,),
"finished_at": (int,),
"finished_at": (datetime,),
"git": (DORAGitInfo,),
"name": (str,),
"services": ([str],),
"severity": (str,),
"started_at": (int,),
"started_at": (datetime,),
"team": (str,),
"version": (str,),
}
Expand All @@ -51,14 +52,14 @@ def openapi_types(_):

def __init__(
self_,
started_at: int,
custom_tags: Union[List[str], none_type, UnsetType] = unset,
env: Union[str, UnsetType] = unset,
finished_at: Union[int, UnsetType] = unset,
finished_at: Union[datetime, UnsetType] = unset,
git: Union[DORAGitInfo, UnsetType] = unset,
name: Union[str, UnsetType] = unset,
services: Union[List[str], UnsetType] = unset,
severity: Union[str, UnsetType] = unset,
started_at: Union[datetime, UnsetType] = unset,
team: Union[str, UnsetType] = unset,
version: Union[str, UnsetType] = unset,
**kwargs,
Expand All @@ -72,8 +73,8 @@ def __init__(
:param env: Environment name that was impacted by the incident.
:type env: str, optional

:param finished_at: Unix timestamp when the incident finished.
:type finished_at: int, optional
:param finished_at: The time when the incident finished.
:type finished_at: datetime, optional

:param git: Git info for DORA Metrics events.
:type git: DORAGitInfo, optional
Expand All @@ -87,8 +88,8 @@ def __init__(
:param severity: Incident severity.
:type severity: str, optional

:param started_at: Unix timestamp when the incident started.
:type started_at: int
:param started_at: The time when the incident started.
:type started_at: datetime, optional

:param team: Name of the team owning the services impacted.
:type team: str, optional
Expand All @@ -110,10 +111,10 @@ def __init__(
kwargs["services"] = services
if severity is not unset:
kwargs["severity"] = severity
if started_at is not unset:
kwargs["started_at"] = started_at
if team is not unset:
kwargs["team"] = team
if version is not unset:
kwargs["version"] = version
super().__init__(kwargs)

self_.started_at = started_at
Loading
Loading