Skip to content

Add a new endpoint for listing Software Catalog relations #2828

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-02 04:31:10.898749",
"spec_repo_commit": "272cce39"
"regenerated": "2025-05-02 16:32:06.843518",
"spec_repo_commit": "f88cc028"
},
"v2": {
"apigentools_version": "1.6.6",
"regenerated": "2025-05-02 04:31:10.915000",
"spec_repo_commit": "272cce39"
"regenerated": "2025-05-02 16:32:06.863833",
"spec_repo_commit": "f88cc028"
}
}
}
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 @@ -19254,6 +19289,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 @@ -28556,6 +28623,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 @@ -42634,6 +42809,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
24 changes: 24 additions & 0 deletions examples/v2/software-catalog/ListCatalogRelation.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
// Get a list of entity relations returns "OK" response

import com.datadog.api.client.ApiClient;
import com.datadog.api.client.ApiException;
import com.datadog.api.client.v2.api.SoftwareCatalogApi;
import com.datadog.api.client.v2.model.ListRelationCatalogResponse;

public class Example {
public static void main(String[] args) {
ApiClient defaultClient = ApiClient.getDefaultApiClient();
SoftwareCatalogApi apiInstance = new SoftwareCatalogApi(defaultClient);

try {
ListRelationCatalogResponse result = apiInstance.listCatalogRelation();
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling SoftwareCatalogApi#listCatalogRelation");
System.err.println("Status code: " + e.getCode());
System.err.println("Reason: " + e.getResponseBody());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
// Get a list of entity relations returns "OK" response with pagination

import com.datadog.api.client.ApiClient;
import com.datadog.api.client.PaginationIterable;
import com.datadog.api.client.v2.api.SoftwareCatalogApi;
import com.datadog.api.client.v2.model.RelationResponse;

public class Example {
public static void main(String[] args) {
ApiClient defaultClient = ApiClient.getDefaultApiClient();
SoftwareCatalogApi apiInstance = new SoftwareCatalogApi(defaultClient);

try {
PaginationIterable<RelationResponse> iterable =
apiInstance.listCatalogRelationWithPagination();

for (RelationResponse item : iterable) {
System.out.println(item);
}
} catch (RuntimeException e) {
System.err.println(
"Exception when calling SoftwareCatalogApi#listCatalogRelationWithPagination");
System.err.println("Reason: " + e.getMessage());
e.printStackTrace();
}
}
}
Loading
Loading