Skip to content

Commit 8463fa3

Browse files
api-clients-generation-pipeline[bot]ci.datadog-api-spec
andauthored
Service Catalog support service definition schema v2.2 (#1709)
Co-authored-by: ci.datadog-api-spec <[email protected]>
1 parent f75da16 commit 8463fa3

22 files changed

+938
-37
lines changed

.apigentools-info

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,13 @@
44
"spec_versions": {
55
"v1": {
66
"apigentools_version": "1.6.6",
7-
"regenerated": "2023-10-10 07:51:52.156669",
8-
"spec_repo_commit": "6482b048"
7+
"regenerated": "2023-10-10 13:47:33.127844",
8+
"spec_repo_commit": "afb48804"
99
},
1010
"v2": {
1111
"apigentools_version": "1.6.6",
12-
"regenerated": "2023-10-10 07:51:52.174430",
13-
"spec_repo_commit": "6482b048"
12+
"regenerated": "2023-10-10 13:47:33.153228",
13+
"spec_repo_commit": "afb48804"
1414
}
1515
}
1616
}

.generator/schemas/v2/openapi.yaml

Lines changed: 179 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14994,18 +14994,21 @@ components:
1499414994
- $ref: '#/components/schemas/ServiceDefinitionV1'
1499514995
- $ref: '#/components/schemas/ServiceDefinitionV2'
1499614996
- $ref: '#/components/schemas/ServiceDefinitionV2Dot1'
14997+
- $ref: '#/components/schemas/ServiceDefinitionV2Dot2'
1499714998
type: object
1499814999
ServiceDefinitionSchemaVersions:
1499915000
description: Schema versions
1500015001
enum:
1500115002
- v1
1500215003
- v2
1500315004
- v2.1
15005+
- v2.2
1500415006
type: string
1500515007
x-enum-varnames:
1500615008
- V1
1500715009
- V2
1500815010
- V2_1
15011+
- V2_2
1500915012
ServiceDefinitionV1:
1501015013
deprecated: true
1501115014
description: Deprecated - Service definition V1 for providing additional service
@@ -15466,6 +15469,181 @@ components:
1546615469
type: string
1546715470
x-enum-varnames:
1546815471
- V2_1
15472+
ServiceDefinitionV2Dot2:
15473+
description: Service definition v2.2 for providing service metadata and integrations.
15474+
properties:
15475+
application:
15476+
description: Identifier for a group of related services serving a product
15477+
feature, which the service is a part of.
15478+
example: my-app
15479+
type: string
15480+
contacts:
15481+
description: A list of contacts related to the services.
15482+
items:
15483+
$ref: '#/components/schemas/ServiceDefinitionV2Dot2Contact'
15484+
type: array
15485+
dd-service:
15486+
description: Unique identifier of the service. Must be unique across all
15487+
services and is used to match with a service in Datadog.
15488+
example: my-service
15489+
type: string
15490+
description:
15491+
description: A short description of the service.
15492+
example: My service description
15493+
type: string
15494+
extensions:
15495+
additionalProperties: {}
15496+
description: Extensions to v2.2 schema.
15497+
example:
15498+
myorg/extension: extensionValue
15499+
type: object
15500+
integrations:
15501+
$ref: '#/components/schemas/ServiceDefinitionV2Dot2Integrations'
15502+
langauges:
15503+
description: 'The service''s programming language. Datadog recognizes the
15504+
following languages: `dotnet`, `go`, `java`, `js`, `php`, `python`, `ruby`,
15505+
and `c++`.'
15506+
example:
15507+
- dotnet
15508+
- go
15509+
- java
15510+
- js
15511+
- php
15512+
- python
15513+
- ruby
15514+
- c++
15515+
items:
15516+
type: string
15517+
type: array
15518+
lifecycle:
15519+
description: The current life cycle phase of the service.
15520+
example: sandbox
15521+
type: string
15522+
links:
15523+
description: A list of links related to the services.
15524+
items:
15525+
$ref: '#/components/schemas/ServiceDefinitionV2Dot2Link'
15526+
type: array
15527+
schema-version:
15528+
$ref: '#/components/schemas/ServiceDefinitionV2Dot2Version'
15529+
service-type:
15530+
description: 'The type of service. Datadog recognizes the following service
15531+
types: `database`, `cache`, `function`, `web`, `browser`, and `mobile`.'
15532+
example: web
15533+
type: string
15534+
tags:
15535+
description: A set of custom tags.
15536+
example:
15537+
- my:tag
15538+
- service:tag
15539+
items:
15540+
type: string
15541+
type: array
15542+
team:
15543+
description: Team that owns the service. It is used to locate a team defined
15544+
in Datadog Teams if it exists.
15545+
example: my-team
15546+
type: string
15547+
tier:
15548+
description: Importance of the service.
15549+
example: High
15550+
type: string
15551+
required:
15552+
- schema-version
15553+
- dd-service
15554+
type: object
15555+
ServiceDefinitionV2Dot2Contact:
15556+
description: Service owner's contacts information.
15557+
properties:
15558+
contact:
15559+
description: Contact value.
15560+
example: https://teams.microsoft.com/myteam
15561+
type: string
15562+
name:
15563+
description: Contact Name.
15564+
example: My team channel
15565+
type: string
15566+
type:
15567+
description: 'Contact type. Datadog recognizes the following types: `email`,
15568+
`slack`, and `microsoft-teams`.'
15569+
example: slack
15570+
type: string
15571+
required:
15572+
- type
15573+
- contact
15574+
type: object
15575+
ServiceDefinitionV2Dot2Integrations:
15576+
description: Third party integrations that Datadog supports.
15577+
properties:
15578+
opsgenie:
15579+
$ref: '#/components/schemas/ServiceDefinitionV2Dot2Opsgenie'
15580+
pagerduty:
15581+
$ref: '#/components/schemas/ServiceDefinitionV2Dot2Pagerduty'
15582+
type: object
15583+
ServiceDefinitionV2Dot2Link:
15584+
description: Service's external links.
15585+
properties:
15586+
name:
15587+
description: Link name.
15588+
example: Runbook
15589+
type: string
15590+
provider:
15591+
description: Link provider.
15592+
example: Github
15593+
type: string
15594+
type:
15595+
description: 'Link type. Datadog recognizes the following types: `runbook`,
15596+
`doc`, `repo`, `dashboard`, and `other`.'
15597+
example: runbook
15598+
type: string
15599+
url:
15600+
description: Link URL.
15601+
example: https://my-runbook
15602+
type: string
15603+
required:
15604+
- name
15605+
- type
15606+
- url
15607+
type: object
15608+
ServiceDefinitionV2Dot2Opsgenie:
15609+
description: Opsgenie integration for the service.
15610+
properties:
15611+
region:
15612+
$ref: '#/components/schemas/ServiceDefinitionV2Dot2OpsgenieRegion'
15613+
service-url:
15614+
description: Opsgenie service url.
15615+
example: https://my-org.opsgenie.com/service/123e4567-e89b-12d3-a456-426614174000
15616+
type: string
15617+
required:
15618+
- service-url
15619+
type: object
15620+
ServiceDefinitionV2Dot2OpsgenieRegion:
15621+
description: Opsgenie instance region.
15622+
enum:
15623+
- US
15624+
- EU
15625+
example: US
15626+
type: string
15627+
x-enum-varnames:
15628+
- US
15629+
- EU
15630+
ServiceDefinitionV2Dot2Pagerduty:
15631+
description: PagerDuty integration for the service.
15632+
properties:
15633+
service-url:
15634+
description: PagerDuty service url.
15635+
example: https://my-org.pagerduty.com/service-directory/PMyService
15636+
type: string
15637+
type: object
15638+
ServiceDefinitionV2Dot2Version:
15639+
default: v2.2
15640+
description: Schema version being used.
15641+
enum:
15642+
- v2.2
15643+
example: v2.2
15644+
type: string
15645+
x-enum-varnames:
15646+
- V2_2
1546915647
ServiceDefinitionV2Email:
1547015648
description: Service owner's email.
1547115649
properties:
@@ -15649,6 +15827,7 @@ components:
1564915827
ServiceDefinitionsCreateRequest:
1565015828
description: Create service definitions request.
1565115829
oneOf:
15830+
- $ref: '#/components/schemas/ServiceDefinitionV2Dot2'
1565215831
- $ref: '#/components/schemas/ServiceDefinitionV2Dot1'
1565315832
- $ref: '#/components/schemas/ServiceDefinitionV2'
1565415833
- $ref: '#/components/schemas/ServiceDefinitionRaw'

docs/datadog_api_client.v2.model.rst

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6875,6 +6875,55 @@ service\_definition\_v2\_dot1\_slack\_type
68756875
:members:
68766876
:show-inheritance:
68776877

6878+
service\_definition\_v2\_dot2
6879+
-----------------------------
6880+
6881+
.. automodule:: datadog_api_client.v2.model.service_definition_v2_dot2
6882+
:members:
6883+
:show-inheritance:
6884+
6885+
service\_definition\_v2\_dot2\_contact
6886+
--------------------------------------
6887+
6888+
.. automodule:: datadog_api_client.v2.model.service_definition_v2_dot2_contact
6889+
:members:
6890+
:show-inheritance:
6891+
6892+
service\_definition\_v2\_dot2\_integrations
6893+
-------------------------------------------
6894+
6895+
.. automodule:: datadog_api_client.v2.model.service_definition_v2_dot2_integrations
6896+
:members:
6897+
:show-inheritance:
6898+
6899+
service\_definition\_v2\_dot2\_link
6900+
-----------------------------------
6901+
6902+
.. automodule:: datadog_api_client.v2.model.service_definition_v2_dot2_link
6903+
:members:
6904+
:show-inheritance:
6905+
6906+
service\_definition\_v2\_dot2\_opsgenie
6907+
---------------------------------------
6908+
6909+
.. automodule:: datadog_api_client.v2.model.service_definition_v2_dot2_opsgenie
6910+
:members:
6911+
:show-inheritance:
6912+
6913+
service\_definition\_v2\_dot2\_opsgenie\_region
6914+
-----------------------------------------------
6915+
6916+
.. automodule:: datadog_api_client.v2.model.service_definition_v2_dot2_opsgenie_region
6917+
:members:
6918+
:show-inheritance:
6919+
6920+
service\_definition\_v2\_dot2\_pagerduty
6921+
----------------------------------------
6922+
6923+
.. automodule:: datadog_api_client.v2.model.service_definition_v2_dot2_pagerduty
6924+
:members:
6925+
:show-inheritance:
6926+
68786927
service\_definition\_v2\_email
68796928
------------------------------
68806929

examples/v2/service-definition/CreateOrUpdateServiceDefinitions.py

Lines changed: 31 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -4,48 +4,57 @@
44

55
from datadog_api_client import ApiClient, Configuration
66
from datadog_api_client.v2.api.service_definition_api import ServiceDefinitionApi
7-
from datadog_api_client.v2.model.service_definition_v2_dot1 import ServiceDefinitionV2Dot1
8-
from datadog_api_client.v2.model.service_definition_v2_dot1_email import ServiceDefinitionV2Dot1Email
9-
from datadog_api_client.v2.model.service_definition_v2_dot1_email_type import ServiceDefinitionV2Dot1EmailType
10-
from datadog_api_client.v2.model.service_definition_v2_dot1_integrations import ServiceDefinitionV2Dot1Integrations
11-
from datadog_api_client.v2.model.service_definition_v2_dot1_link import ServiceDefinitionV2Dot1Link
12-
from datadog_api_client.v2.model.service_definition_v2_dot1_link_type import ServiceDefinitionV2Dot1LinkType
13-
from datadog_api_client.v2.model.service_definition_v2_dot1_opsgenie import ServiceDefinitionV2Dot1Opsgenie
14-
from datadog_api_client.v2.model.service_definition_v2_dot1_opsgenie_region import ServiceDefinitionV2Dot1OpsgenieRegion
15-
from datadog_api_client.v2.model.service_definition_v2_dot1_pagerduty import ServiceDefinitionV2Dot1Pagerduty
16-
from datadog_api_client.v2.model.service_definition_v2_dot1_version import ServiceDefinitionV2Dot1Version
7+
from datadog_api_client.v2.model.service_definition_v2_dot2 import ServiceDefinitionV2Dot2
8+
from datadog_api_client.v2.model.service_definition_v2_dot2_contact import ServiceDefinitionV2Dot2Contact
9+
from datadog_api_client.v2.model.service_definition_v2_dot2_integrations import ServiceDefinitionV2Dot2Integrations
10+
from datadog_api_client.v2.model.service_definition_v2_dot2_link import ServiceDefinitionV2Dot2Link
11+
from datadog_api_client.v2.model.service_definition_v2_dot2_opsgenie import ServiceDefinitionV2Dot2Opsgenie
12+
from datadog_api_client.v2.model.service_definition_v2_dot2_opsgenie_region import ServiceDefinitionV2Dot2OpsgenieRegion
13+
from datadog_api_client.v2.model.service_definition_v2_dot2_pagerduty import ServiceDefinitionV2Dot2Pagerduty
14+
from datadog_api_client.v2.model.service_definition_v2_dot2_version import ServiceDefinitionV2Dot2Version
1715

18-
body = ServiceDefinitionV2Dot1(
16+
body = ServiceDefinitionV2Dot2(
1917
application="my-app",
2018
contacts=[
21-
ServiceDefinitionV2Dot1Email(
22-
contact="contact@datadoghq.com",
23-
name="Team Email",
24-
type=ServiceDefinitionV2Dot1EmailType.EMAIL,
19+
ServiceDefinitionV2Dot2Contact(
20+
contact="https://teams.microsoft.com/myteam",
21+
name="My team channel",
22+
type="slack",
2523
),
2624
],
2725
dd_service="my-service",
2826
description="My service description",
2927
extensions=dict([("myorg/extension", "extensionValue")]),
30-
integrations=ServiceDefinitionV2Dot1Integrations(
31-
opsgenie=ServiceDefinitionV2Dot1Opsgenie(
32-
region=ServiceDefinitionV2Dot1OpsgenieRegion.US,
28+
integrations=ServiceDefinitionV2Dot2Integrations(
29+
opsgenie=ServiceDefinitionV2Dot2Opsgenie(
30+
region=ServiceDefinitionV2Dot2OpsgenieRegion.US,
3331
service_url="https://my-org.opsgenie.com/service/123e4567-e89b-12d3-a456-426614174000",
3432
),
35-
pagerduty=ServiceDefinitionV2Dot1Pagerduty(
33+
pagerduty=ServiceDefinitionV2Dot2Pagerduty(
3634
service_url="https://my-org.pagerduty.com/service-directory/PMyService",
3735
),
3836
),
37+
langauges=[
38+
"dotnet",
39+
"go",
40+
"java",
41+
"js",
42+
"php",
43+
"python",
44+
"ruby",
45+
"c++",
46+
],
3947
lifecycle="sandbox",
4048
links=[
41-
ServiceDefinitionV2Dot1Link(
49+
ServiceDefinitionV2Dot2Link(
4250
name="Runbook",
4351
provider="Github",
44-
type=ServiceDefinitionV2Dot1LinkType.RUNBOOK,
52+
type="runbook",
4553
url="https://my-runbook",
4654
),
4755
],
48-
schema_version=ServiceDefinitionV2Dot1Version.V2_1,
56+
schema_version=ServiceDefinitionV2Dot2Version.V2_2,
57+
service_type="web",
4958
tags=[
5059
"my:tag",
5160
"service:tag",

0 commit comments

Comments
 (0)