Skip to content

Commit bd54eba

Browse files
api-clients-generation-pipeline[bot]ci.datadog-api-spec
andauthored
Add PreviewCatalogEntities (#2757)
Co-authored-by: ci.datadog-api-spec <[email protected]>
1 parent a3d7553 commit bd54eba

26 files changed

+2370
-0
lines changed

.generator/schemas/v2/openapi.yaml

Lines changed: 223 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17294,11 +17294,201 @@ components:
1729417294
schema:
1729517295
$ref: '#/components/schemas/EntityToSchema'
1729617296
type: object
17297+
EntityResponseArray:
17298+
properties:
17299+
data:
17300+
items:
17301+
$ref: '#/components/schemas/PreviewEntityResponseData'
17302+
type: array
17303+
required:
17304+
- data
17305+
type: object
1729717306
EntityResponseData:
1729817307
description: List of entity data.
1729917308
items:
1730017309
$ref: '#/components/schemas/EntityData'
1730117310
type: array
17311+
EntityResponseDataAttributes:
17312+
properties:
17313+
apiVersion:
17314+
type: string
17315+
description:
17316+
type: string
17317+
displayName:
17318+
type: string
17319+
kind:
17320+
type: string
17321+
name:
17322+
type: string
17323+
namespace:
17324+
type: string
17325+
owner:
17326+
type: string
17327+
properties:
17328+
additionalProperties: {}
17329+
type: object
17330+
tags:
17331+
items:
17332+
type: string
17333+
type: array
17334+
type: object
17335+
EntityResponseDataRelationships:
17336+
properties:
17337+
incidents:
17338+
$ref: '#/components/schemas/EntityResponseDataRelationshipsIncidents'
17339+
oncalls:
17340+
$ref: '#/components/schemas/EntityResponseDataRelationshipsOncalls'
17341+
rawSchema:
17342+
$ref: '#/components/schemas/EntityResponseDataRelationshipsRawSchema'
17343+
relatedEntities:
17344+
$ref: '#/components/schemas/EntityResponseDataRelationshipsRelatedEntities'
17345+
schema:
17346+
$ref: '#/components/schemas/EntityResponseDataRelationshipsSchema'
17347+
type: object
17348+
EntityResponseDataRelationshipsIncidents:
17349+
properties:
17350+
data:
17351+
items:
17352+
$ref: '#/components/schemas/EntityResponseDataRelationshipsIncidentsDataItems'
17353+
type: array
17354+
type: object
17355+
EntityResponseDataRelationshipsIncidentsDataItems:
17356+
properties:
17357+
id:
17358+
example: ''
17359+
type: string
17360+
type:
17361+
$ref: '#/components/schemas/EntityResponseDataRelationshipsIncidentsDataItemsType'
17362+
required:
17363+
- type
17364+
- id
17365+
type: object
17366+
EntityResponseDataRelationshipsIncidentsDataItemsType:
17367+
default: incident
17368+
description: Incident resource type.
17369+
enum:
17370+
- incident
17371+
example: incident
17372+
type: string
17373+
x-enum-varnames:
17374+
- INCIDENT
17375+
EntityResponseDataRelationshipsOncalls:
17376+
properties:
17377+
data:
17378+
items:
17379+
$ref: '#/components/schemas/EntityResponseDataRelationshipsOncallsDataItems'
17380+
type: array
17381+
type: object
17382+
EntityResponseDataRelationshipsOncallsDataItems:
17383+
properties:
17384+
id:
17385+
example: ''
17386+
type: string
17387+
type:
17388+
$ref: '#/components/schemas/EntityResponseDataRelationshipsOncallsDataItemsType'
17389+
required:
17390+
- type
17391+
- id
17392+
type: object
17393+
EntityResponseDataRelationshipsOncallsDataItemsType:
17394+
default: oncall
17395+
description: Oncall resource type.
17396+
enum:
17397+
- oncall
17398+
example: oncall
17399+
type: string
17400+
x-enum-varnames:
17401+
- ONCALL
17402+
EntityResponseDataRelationshipsRawSchema:
17403+
properties:
17404+
data:
17405+
$ref: '#/components/schemas/EntityResponseDataRelationshipsRawSchemaData'
17406+
required:
17407+
- data
17408+
type: object
17409+
EntityResponseDataRelationshipsRawSchemaData:
17410+
properties:
17411+
id:
17412+
example: ''
17413+
type: string
17414+
type:
17415+
$ref: '#/components/schemas/EntityResponseDataRelationshipsRawSchemaDataType'
17416+
required:
17417+
- type
17418+
- id
17419+
type: object
17420+
EntityResponseDataRelationshipsRawSchemaDataType:
17421+
default: rawSchema
17422+
description: Raw schema resource type.
17423+
enum:
17424+
- rawSchema
17425+
example: rawSchema
17426+
type: string
17427+
x-enum-varnames:
17428+
- RAWSCHEMA
17429+
EntityResponseDataRelationshipsRelatedEntities:
17430+
properties:
17431+
data:
17432+
items:
17433+
$ref: '#/components/schemas/EntityResponseDataRelationshipsRelatedEntitiesDataItems'
17434+
type: array
17435+
type: object
17436+
EntityResponseDataRelationshipsRelatedEntitiesDataItems:
17437+
properties:
17438+
id:
17439+
example: ''
17440+
type: string
17441+
type:
17442+
$ref: '#/components/schemas/EntityResponseDataRelationshipsRelatedEntitiesDataItemsType'
17443+
required:
17444+
- type
17445+
- id
17446+
type: object
17447+
EntityResponseDataRelationshipsRelatedEntitiesDataItemsType:
17448+
default: relatedEntity
17449+
description: Related entity resource type.
17450+
enum:
17451+
- relatedEntity
17452+
example: relatedEntity
17453+
type: string
17454+
x-enum-varnames:
17455+
- RELATEDENTITY
17456+
EntityResponseDataRelationshipsSchema:
17457+
properties:
17458+
data:
17459+
$ref: '#/components/schemas/EntityResponseDataRelationshipsSchemaData'
17460+
required:
17461+
- data
17462+
type: object
17463+
EntityResponseDataRelationshipsSchemaData:
17464+
properties:
17465+
id:
17466+
example: ''
17467+
type: string
17468+
type:
17469+
$ref: '#/components/schemas/EntityResponseDataRelationshipsSchemaDataType'
17470+
required:
17471+
- type
17472+
- id
17473+
type: object
17474+
EntityResponseDataRelationshipsSchemaDataType:
17475+
default: schema
17476+
description: Schema resource type.
17477+
enum:
17478+
- schema
17479+
example: schema
17480+
type: string
17481+
x-enum-varnames:
17482+
- SCHEMA
17483+
EntityResponseDataType:
17484+
default: entity
17485+
description: Entity resource type.
17486+
enum:
17487+
- entity
17488+
example: entity
17489+
type: string
17490+
x-enum-varnames:
17491+
- ENTITY
1730217492
EntityResponseIncludedIncident:
1730317493
description: Included incident.
1730417494
properties:
@@ -37681,6 +37871,19 @@ components:
3768137871
description: Offset type.
3768237872
type: string
3768337873
type: object
37874+
PreviewEntityResponseData:
37875+
properties:
37876+
attributes:
37877+
$ref: '#/components/schemas/EntityResponseDataAttributes'
37878+
id:
37879+
type: string
37880+
relationships:
37881+
$ref: '#/components/schemas/EntityResponseDataRelationships'
37882+
type:
37883+
$ref: '#/components/schemas/EntityResponseDataType'
37884+
required:
37885+
- type
37886+
type: object
3768437887
ProcessSummariesMeta:
3768537888
description: Response metadata object.
3768637889
properties:
@@ -58421,6 +58624,26 @@ paths:
5842158624
tags:
5842258625
- Software Catalog
5842358626
x-codegen-request-body-name: body
58627+
/api/v2/catalog/entity/preview:
58628+
post:
58629+
operationId: PreviewCatalogEntities
58630+
responses:
58631+
'202':
58632+
content:
58633+
application/json:
58634+
schema:
58635+
$ref: '#/components/schemas/EntityResponseArray'
58636+
description: Accepted
58637+
'429':
58638+
$ref: '#/components/responses/TooManyRequestsResponse'
58639+
security:
58640+
- apiKeyAuth: []
58641+
appKeyAuth: []
58642+
- AuthZ:
58643+
- apm_service_catalog_read
58644+
summary: Preview catalog entities
58645+
tags:
58646+
- Software Catalog
5842458647
/api/v2/catalog/entity/{entity_id}:
5842558648
delete:
5842658649
description: Delete a single entity in Software Catalog.
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# Preview catalog entities returns "Accepted" response
2+
3+
require "datadog_api_client"
4+
api_instance = DatadogAPIClient::V2::SoftwareCatalogAPI.new
5+
p api_instance.preview_catalog_entities()

features/v2/software_catalog.feature

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -144,3 +144,9 @@ Feature: Software Catalog
144144
And request contains "page[limit]" parameter with value 20
145145
When the request with pagination is sent
146146
Then the response status is 200 OK
147+
148+
@generated @skip @team:DataDog/service-catalog
149+
Scenario: Preview catalog entities returns "Accepted" response
150+
Given new "PreviewCatalogEntities" request
151+
When the request is sent
152+
Then the response status is 202 Accepted

features/v2/undo.json

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -751,6 +751,12 @@
751751
"type": "unsafe"
752752
}
753753
},
754+
"PreviewCatalogEntities": {
755+
"tag": "Software Catalog",
756+
"undo": {
757+
"type": "safe"
758+
}
759+
},
754760
"DeleteCatalogEntity": {
755761
"tag": "Software Catalog",
756762
"undo": {

lib/datadog_api_client/inflector.rb

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1954,6 +1954,25 @@ def overrides
19541954
"v2.entity_data" => "EntityData",
19551955
"v2.entity_meta" => "EntityMeta",
19561956
"v2.entity_relationships" => "EntityRelationships",
1957+
"v2.entity_response_array" => "EntityResponseArray",
1958+
"v2.entity_response_data_attributes" => "EntityResponseDataAttributes",
1959+
"v2.entity_response_data_relationships" => "EntityResponseDataRelationships",
1960+
"v2.entity_response_data_relationships_incidents" => "EntityResponseDataRelationshipsIncidents",
1961+
"v2.entity_response_data_relationships_incidents_data_items" => "EntityResponseDataRelationshipsIncidentsDataItems",
1962+
"v2.entity_response_data_relationships_incidents_data_items_type" => "EntityResponseDataRelationshipsIncidentsDataItemsType",
1963+
"v2.entity_response_data_relationships_oncalls" => "EntityResponseDataRelationshipsOncalls",
1964+
"v2.entity_response_data_relationships_oncalls_data_items" => "EntityResponseDataRelationshipsOncallsDataItems",
1965+
"v2.entity_response_data_relationships_oncalls_data_items_type" => "EntityResponseDataRelationshipsOncallsDataItemsType",
1966+
"v2.entity_response_data_relationships_raw_schema" => "EntityResponseDataRelationshipsRawSchema",
1967+
"v2.entity_response_data_relationships_raw_schema_data" => "EntityResponseDataRelationshipsRawSchemaData",
1968+
"v2.entity_response_data_relationships_raw_schema_data_type" => "EntityResponseDataRelationshipsRawSchemaDataType",
1969+
"v2.entity_response_data_relationships_related_entities" => "EntityResponseDataRelationshipsRelatedEntities",
1970+
"v2.entity_response_data_relationships_related_entities_data_items" => "EntityResponseDataRelationshipsRelatedEntitiesDataItems",
1971+
"v2.entity_response_data_relationships_related_entities_data_items_type" => "EntityResponseDataRelationshipsRelatedEntitiesDataItemsType",
1972+
"v2.entity_response_data_relationships_schema" => "EntityResponseDataRelationshipsSchema",
1973+
"v2.entity_response_data_relationships_schema_data" => "EntityResponseDataRelationshipsSchemaData",
1974+
"v2.entity_response_data_relationships_schema_data_type" => "EntityResponseDataRelationshipsSchemaDataType",
1975+
"v2.entity_response_data_type" => "EntityResponseDataType",
19571976
"v2.entity_response_included_incident" => "EntityResponseIncludedIncident",
19581977
"v2.entity_response_included_incident_type" => "EntityResponseIncludedIncidentType",
19591978
"v2.entity_response_included_oncall" => "EntityResponseIncludedOncall",
@@ -3291,6 +3310,7 @@ def overrides
32913310
"v2.powerpacks_response_meta" => "PowerpacksResponseMeta",
32923311
"v2.powerpacks_response_meta_pagination" => "PowerpacksResponseMetaPagination",
32933312
"v2.powerpack_template_variable" => "PowerpackTemplateVariable",
3313+
"v2.preview_entity_response_data" => "PreviewEntityResponseData",
32943314
"v2.process_summaries_meta" => "ProcessSummariesMeta",
32953315
"v2.process_summaries_meta_page" => "ProcessSummariesMetaPage",
32963316
"v2.process_summaries_response" => "ProcessSummariesResponse",

lib/datadog_api_client/v2/api/software_catalog_api.rb

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -452,6 +452,63 @@ def list_catalog_relation_with_pagination(opts = {})
452452
end
453453
end
454454

455+
# Preview catalog entities.
456+
#
457+
# @see #preview_catalog_entities_with_http_info
458+
def preview_catalog_entities(opts = {})
459+
data, _status_code, _headers = preview_catalog_entities_with_http_info(opts)
460+
data
461+
end
462+
463+
# Preview catalog entities.
464+
# @param opts [Hash] the optional parameters
465+
# @return [Array<(EntityResponseArray, Integer, Hash)>] EntityResponseArray data, response status code and response headers
466+
def preview_catalog_entities_with_http_info(opts = {})
467+
468+
if @api_client.config.debugging
469+
@api_client.config.logger.debug 'Calling API: SoftwareCatalogAPI.preview_catalog_entities ...'
470+
end
471+
# resource path
472+
local_var_path = '/api/v2/catalog/entity/preview'
473+
474+
# query parameters
475+
query_params = opts[:query_params] || {}
476+
477+
# header parameters
478+
header_params = opts[:header_params] || {}
479+
# HTTP header 'Accept' (if needed)
480+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
481+
482+
# form parameters
483+
form_params = opts[:form_params] || {}
484+
485+
# http body (model)
486+
post_body = opts[:debug_body]
487+
488+
# return_type
489+
return_type = opts[:debug_return_type] || 'EntityResponseArray'
490+
491+
# auth_names
492+
auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ]
493+
494+
new_options = opts.merge(
495+
:operation => :preview_catalog_entities,
496+
:header_params => header_params,
497+
:query_params => query_params,
498+
:form_params => form_params,
499+
:body => post_body,
500+
:auth_names => auth_names,
501+
:return_type => return_type,
502+
:api_version => "V2"
503+
)
504+
505+
data, status_code, headers = @api_client.call_api(Net::HTTP::Post, local_var_path, new_options)
506+
if @api_client.config.debugging
507+
@api_client.config.logger.debug "API called: SoftwareCatalogAPI#preview_catalog_entities\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
508+
end
509+
return data, status_code, headers
510+
end
511+
455512
# Create or update entities.
456513
#
457514
# @see #upsert_catalog_entity_with_http_info

0 commit comments

Comments
 (0)