Skip to content

Add a new endpoint for listing Software Catalog relations #2535

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
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
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": "2025-05-01 18:50:10.700756",
"spec_repo_commit": "7eb88f6a"
"regenerated": "2025-05-01 20:46:43.893610",
"spec_repo_commit": "81e2f26f"
},
"v2": {
"apigentools_version": "1.6.6",
"regenerated": "2025-05-01 18:50:10.716342",
"spec_repo_commit": "7eb88f6a"
"regenerated": "2025-05-01 20:46:43.917554",
"spec_repo_commit": "81e2f26f"
}
}
}
217 changes: 217 additions & 0 deletions .generator/schemas/v2/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -335,6 +335,7 @@ components:
type: string
FilterByRef:
description: Filter entities by reference
example: service:shopping-cart
explode: true
in: query
name: filter[ref]
Expand All @@ -349,6 +350,32 @@ components:
required: false
schema:
$ref: '#/components/schemas/RelationType'
FilterRelationByFromRef:
description: Filter relations by the reference of the first entity in the relation.
example: service:shopping-cart
explode: true
in: query
name: filter[from_ref]
required: false
schema:
type: string
FilterRelationByToRef:
description: Filter relations by the reference of the second entity in the relation.
example: service:shopping-cart
explode: true
in: query
name: filter[to_ref]
required: false
schema:
type: string
FilterRelationByType:
description: Filter relations by type.
explode: true
in: query
name: filter[type]
required: false
schema:
$ref: '#/components/schemas/RelationType'
GCPSTSServiceAccountID:
description: Your GCP STS enabled service account's unique ID.
in: path
Expand Down Expand Up @@ -659,6 +686,14 @@ components:
required: true
schema:
type: string
RelationInclude:
description: Include relationship data.
explode: true
in: query
name: include
required: false
schema:
$ref: '#/components/schemas/RelationIncludeType'
ReportID:
description: The ID of the report job.
in: path
Expand Down Expand Up @@ -19217,6 +19252,38 @@ components:
meta:
$ref: '#/components/schemas/PowerpacksResponseMeta'
type: object
ListRelationCatalogResponse:
description: List entity relation response.
properties:
data:
$ref: '#/components/schemas/RelationResponseData'
included:
$ref: '#/components/schemas/ListRelationCatalogResponseIncluded'
links:
$ref: '#/components/schemas/ListRelationCatalogResponseLinks'
meta:
$ref: '#/components/schemas/RelationResponseMeta'
type: object
ListRelationCatalogResponseIncluded:
description: List relation response included entities.
items:
$ref: '#/components/schemas/EntityData'
type: array
ListRelationCatalogResponseLinks:
description: List relation response links.
properties:
next:
description: Next link.
example: /api/v2/catalog/relation?filter[from_ref]=service:service-catalog&include=entity&page[limit]=2&page[offset]=2
type: string
previous:
description: Previous link.
type: string
self:
description: Current link.
example: /api/v2/catalog/relation?filter[from_ref]=service:service-catalog&include=entity&page[limit]=2&page[offset]=0
type: string
type: object
ListRulesResponse:
description: Scorecard rules response.
properties:
Expand Down Expand Up @@ -28519,6 +28586,114 @@ components:
x-enum-varnames:
- ANY
- ALL
RelationAttributes:
description: Relation attributes.
properties:
from:
$ref: '#/components/schemas/RelationEntity'
to:
$ref: '#/components/schemas/RelationEntity'
type:
$ref: '#/components/schemas/RelationType'
type: object
RelationEntity:
description: Relation entity reference.
properties:
kind:
description: Entity kind.
type: string
name:
description: Entity name.
type: string
namespace:
description: Entity namespace.
type: string
type: object
RelationIncludeType:
description: Supported include types for relations.
enum:
- entity
- schema
type: string
x-enum-varnames:
- ENTITY
- SCHEMA
RelationMeta:
description: Relation metadata.
properties:
createdAt:
description: Relation creation time.
format: date-time
type: string
definedBy:
description: Relation defined by.
type: string
modifiedAt:
description: Relation modification time.
format: date-time
type: string
source:
description: Relation source.
type: string
type: object
RelationRelationships:
description: Relation relationships.
properties:
fromEntity:
$ref: '#/components/schemas/RelationToEntity'
toEntity:
$ref: '#/components/schemas/RelationToEntity'
type: object
RelationResponse:
description: Relation response data.
properties:
attributes:
$ref: '#/components/schemas/RelationAttributes'
id:
description: Relation ID.
type: string
meta:
$ref: '#/components/schemas/RelationMeta'
relationships:
$ref: '#/components/schemas/RelationRelationships'
subtype:
description: Relation subtype.
type: string
type:
$ref: '#/components/schemas/RelationResponseType'
type: object
RelationResponseData:
description: Array of relation responses
items:
$ref: '#/components/schemas/RelationResponse'
type: array
RelationResponseMeta:
description: Relation response metadata.
properties:
count:
description: Total relations count.
format: int64
type: integer
includeCount:
description: Total included data count.
format: int64
type: integer
type: object
RelationResponseType:
description: Relation type.
enum:
- relation
type: string
x-enum-varnames:
- RELATION
RelationToEntity:
description: Relation to entity.
properties:
data:
$ref: '#/components/schemas/RelationshipItem'
meta:
$ref: '#/components/schemas/EntityMeta'
type: object
RelationType:
description: Supported relation types.
enum:
Expand Down Expand Up @@ -42584,6 +42759,48 @@ paths:
summary: Delete a single entity
tags:
- Software Catalog
/api/v2/catalog/relation:
get:
description: Get a list of entity relations from Software Catalog.
operationId: ListCatalogRelation
parameters:
- $ref: '#/components/parameters/PageOffset'
- description: Maximum number of relations in the response.
example: 100
in: query
name: page[limit]
required: false
schema:
default: 100
format: int64
type: integer
- $ref: '#/components/parameters/FilterRelationByType'
- $ref: '#/components/parameters/FilterRelationByFromRef'
- $ref: '#/components/parameters/FilterRelationByToRef'
- $ref: '#/components/parameters/RelationInclude'
responses:
'200':
content:
application/json:
schema:
$ref: '#/components/schemas/ListRelationCatalogResponse'
description: OK
'403':
$ref: '#/components/responses/ForbiddenResponse'
'429':
$ref: '#/components/responses/TooManyRequestsResponse'
security:
- apiKeyAuth: []
appKeyAuth: []
- AuthZ:
- apm_service_catalog_read
summary: Get a list of entity relations
tags:
- Software Catalog
x-pagination:
limitParam: page[limit]
pageOffsetParam: page[offset]
resultsPath: data
/api/v2/ci/pipeline:
post:
description: 'Send your pipeline event to your Datadog platform over HTTP. For
Expand Down
77 changes: 77 additions & 0 deletions docs/datadog_api_client.v2.model.rst
Original file line number Diff line number Diff line change
Expand Up @@ -8068,6 +8068,20 @@ datadog\_api\_client.v2.model.list\_powerpacks\_response module
:members:
:show-inheritance:

datadog\_api\_client.v2.model.list\_relation\_catalog\_response module
----------------------------------------------------------------------

.. automodule:: datadog_api_client.v2.model.list_relation_catalog_response
:members:
:show-inheritance:

datadog\_api\_client.v2.model.list\_relation\_catalog\_response\_links module
-----------------------------------------------------------------------------

.. automodule:: datadog_api_client.v2.model.list_relation_catalog_response_links
:members:
:show-inheritance:

datadog\_api\_client.v2.model.list\_rules\_response module
----------------------------------------------------------

Expand Down Expand Up @@ -11960,6 +11974,69 @@ datadog\_api\_client.v2.model.readiness\_gate\_threshold\_type module
:members:
:show-inheritance:

datadog\_api\_client.v2.model.relation\_attributes module
---------------------------------------------------------

.. automodule:: datadog_api_client.v2.model.relation_attributes
:members:
:show-inheritance:

datadog\_api\_client.v2.model.relation\_entity module
-----------------------------------------------------

.. automodule:: datadog_api_client.v2.model.relation_entity
:members:
:show-inheritance:

datadog\_api\_client.v2.model.relation\_include\_type module
------------------------------------------------------------

.. automodule:: datadog_api_client.v2.model.relation_include_type
:members:
:show-inheritance:

datadog\_api\_client.v2.model.relation\_meta module
---------------------------------------------------

.. automodule:: datadog_api_client.v2.model.relation_meta
:members:
:show-inheritance:

datadog\_api\_client.v2.model.relation\_relationships module
------------------------------------------------------------

.. automodule:: datadog_api_client.v2.model.relation_relationships
:members:
:show-inheritance:

datadog\_api\_client.v2.model.relation\_response module
-------------------------------------------------------

.. automodule:: datadog_api_client.v2.model.relation_response
:members:
:show-inheritance:

datadog\_api\_client.v2.model.relation\_response\_meta module
-------------------------------------------------------------

.. automodule:: datadog_api_client.v2.model.relation_response_meta
:members:
:show-inheritance:

datadog\_api\_client.v2.model.relation\_response\_type module
-------------------------------------------------------------

.. automodule:: datadog_api_client.v2.model.relation_response_type
:members:
:show-inheritance:

datadog\_api\_client.v2.model.relation\_to\_entity module
---------------------------------------------------------

.. automodule:: datadog_api_client.v2.model.relation_to_entity
:members:
:show-inheritance:

datadog\_api\_client.v2.model.relation\_type module
---------------------------------------------------

Expand Down
13 changes: 13 additions & 0 deletions examples/v2/software-catalog/ListCatalogRelation.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
"""
Get a list of entity relations returns "OK" response
"""

from datadog_api_client import ApiClient, Configuration
from datadog_api_client.v2.api.software_catalog_api import SoftwareCatalogApi

configuration = Configuration()
with ApiClient(configuration) as api_client:
api_instance = SoftwareCatalogApi(api_client)
response = api_instance.list_catalog_relation()

print(response)
13 changes: 13 additions & 0 deletions examples/v2/software-catalog/ListCatalogRelation_1311054087.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
"""
Get a list of entity relations returns "OK" response with pagination
"""

from datadog_api_client import ApiClient, Configuration
from datadog_api_client.v2.api.software_catalog_api import SoftwareCatalogApi

configuration = Configuration()
with ApiClient(configuration) as api_client:
api_instance = SoftwareCatalogApi(api_client)
items = api_instance.list_catalog_relation_with_pagination()
for item in items:
print(item)
Loading