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
223 changes: 223 additions & 0 deletions .generator/schemas/v2/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17294,11 +17294,201 @@ components:
schema:
$ref: '#/components/schemas/EntityToSchema'
type: object
EntityResponseArray:
properties:
data:
items:
$ref: '#/components/schemas/PreviewEntityResponseData'
type: array
required:
- data
type: object
EntityResponseData:
description: List of entity data.
items:
$ref: '#/components/schemas/EntityData'
type: array
EntityResponseDataAttributes:
properties:
apiVersion:
type: string
description:
type: string
displayName:
type: string
kind:
type: string
name:
type: string
namespace:
type: string
owner:
type: string
properties:
additionalProperties: {}
type: object
tags:
items:
type: string
type: array
type: object
EntityResponseDataRelationships:
properties:
incidents:
$ref: '#/components/schemas/EntityResponseDataRelationshipsIncidents'
oncalls:
$ref: '#/components/schemas/EntityResponseDataRelationshipsOncalls'
rawSchema:
$ref: '#/components/schemas/EntityResponseDataRelationshipsRawSchema'
relatedEntities:
$ref: '#/components/schemas/EntityResponseDataRelationshipsRelatedEntities'
schema:
$ref: '#/components/schemas/EntityResponseDataRelationshipsSchema'
type: object
EntityResponseDataRelationshipsIncidents:
properties:
data:
items:
$ref: '#/components/schemas/EntityResponseDataRelationshipsIncidentsDataItems'
type: array
type: object
EntityResponseDataRelationshipsIncidentsDataItems:
properties:
id:
example: ''
type: string
type:
$ref: '#/components/schemas/EntityResponseDataRelationshipsIncidentsDataItemsType'
required:
- type
- id
type: object
EntityResponseDataRelationshipsIncidentsDataItemsType:
default: incident
description: Incident resource type.
enum:
- incident
example: incident
type: string
x-enum-varnames:
- INCIDENT
EntityResponseDataRelationshipsOncalls:
properties:
data:
items:
$ref: '#/components/schemas/EntityResponseDataRelationshipsOncallsDataItems'
type: array
type: object
EntityResponseDataRelationshipsOncallsDataItems:
properties:
id:
example: ''
type: string
type:
$ref: '#/components/schemas/EntityResponseDataRelationshipsOncallsDataItemsType'
required:
- type
- id
type: object
EntityResponseDataRelationshipsOncallsDataItemsType:
default: oncall
description: Oncall resource type.
enum:
- oncall
example: oncall
type: string
x-enum-varnames:
- ONCALL
EntityResponseDataRelationshipsRawSchema:
properties:
data:
$ref: '#/components/schemas/EntityResponseDataRelationshipsRawSchemaData'
required:
- data
type: object
EntityResponseDataRelationshipsRawSchemaData:
properties:
id:
example: ''
type: string
type:
$ref: '#/components/schemas/EntityResponseDataRelationshipsRawSchemaDataType'
required:
- type
- id
type: object
EntityResponseDataRelationshipsRawSchemaDataType:
default: rawSchema
description: Raw schema resource type.
enum:
- rawSchema
example: rawSchema
type: string
x-enum-varnames:
- RAWSCHEMA
EntityResponseDataRelationshipsRelatedEntities:
properties:
data:
items:
$ref: '#/components/schemas/EntityResponseDataRelationshipsRelatedEntitiesDataItems'
type: array
type: object
EntityResponseDataRelationshipsRelatedEntitiesDataItems:
properties:
id:
example: ''
type: string
type:
$ref: '#/components/schemas/EntityResponseDataRelationshipsRelatedEntitiesDataItemsType'
required:
- type
- id
type: object
EntityResponseDataRelationshipsRelatedEntitiesDataItemsType:
default: relatedEntity
description: Related entity resource type.
enum:
- relatedEntity
example: relatedEntity
type: string
x-enum-varnames:
- RELATEDENTITY
EntityResponseDataRelationshipsSchema:
properties:
data:
$ref: '#/components/schemas/EntityResponseDataRelationshipsSchemaData'
required:
- data
type: object
EntityResponseDataRelationshipsSchemaData:
properties:
id:
example: ''
type: string
type:
$ref: '#/components/schemas/EntityResponseDataRelationshipsSchemaDataType'
required:
- type
- id
type: object
EntityResponseDataRelationshipsSchemaDataType:
default: schema
description: Schema resource type.
enum:
- schema
example: schema
type: string
x-enum-varnames:
- SCHEMA
EntityResponseDataType:
default: entity
description: Entity resource type.
enum:
- entity
example: entity
type: string
x-enum-varnames:
- ENTITY
EntityResponseIncludedIncident:
description: Included incident.
properties:
Expand Down Expand Up @@ -37681,6 +37871,19 @@ components:
description: Offset type.
type: string
type: object
PreviewEntityResponseData:
properties:
attributes:
$ref: '#/components/schemas/EntityResponseDataAttributes'
id:
type: string
relationships:
$ref: '#/components/schemas/EntityResponseDataRelationships'
type:
$ref: '#/components/schemas/EntityResponseDataType'
required:
- type
type: object
ProcessSummariesMeta:
description: Response metadata object.
properties:
Expand Down Expand Up @@ -58421,6 +58624,26 @@ paths:
tags:
- Software Catalog
x-codegen-request-body-name: body
/api/v2/catalog/entity/preview:
post:
operationId: PreviewCatalogEntities
responses:
'202':
content:
application/json:
schema:
$ref: '#/components/schemas/EntityResponseArray'
description: Accepted
'429':
$ref: '#/components/responses/TooManyRequestsResponse'
security:
- apiKeyAuth: []
appKeyAuth: []
- AuthZ:
- apm_service_catalog_read
summary: Preview catalog entities
tags:
- Software Catalog
/api/v2/catalog/entity/{entity_id}:
delete:
description: Delete a single entity in Software Catalog.
Expand Down
24 changes: 24 additions & 0 deletions examples/v2/software-catalog/PreviewCatalogEntities.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
// Preview catalog entities returns "Accepted" 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.EntityResponseArray;

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

try {
EntityResponseArray result = apiInstance.previewCatalogEntities();
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling SoftwareCatalogApi#previewCatalogEntities");
System.err.println("Status code: " + e.getCode());
System.err.println("Reason: " + e.getResponseBody());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}
108 changes: 108 additions & 0 deletions src/main/java/com/datadog/api/client/v2/api/SoftwareCatalogApi.java
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
import com.datadog.api.client.PaginationIterable;
import com.datadog.api.client.Pair;
import com.datadog.api.client.v2.model.EntityData;
import com.datadog.api.client.v2.model.EntityResponseArray;
import com.datadog.api.client.v2.model.IncludeType;
import com.datadog.api.client.v2.model.KindData;
import com.datadog.api.client.v2.model.ListEntityCatalogResponse;
Expand Down Expand Up @@ -1268,6 +1269,113 @@ public ApiResponse<ListRelationCatalogResponse> listCatalogRelationWithHttpInfo(
new GenericType<ListRelationCatalogResponse>() {});
}

/**
* Preview catalog entities.
*
* <p>See {@link #previewCatalogEntitiesWithHttpInfo}.
*
* @return EntityResponseArray
* @throws ApiException if fails to make API call
*/
public EntityResponseArray previewCatalogEntities() throws ApiException {
return previewCatalogEntitiesWithHttpInfo().getData();
}

/**
* Preview catalog entities.
*
* <p>See {@link #previewCatalogEntitiesWithHttpInfoAsync}.
*
* @return CompletableFuture&lt;EntityResponseArray&gt;
*/
public CompletableFuture<EntityResponseArray> previewCatalogEntitiesAsync() {
return previewCatalogEntitiesWithHttpInfoAsync()
.thenApply(
response -> {
return response.getData();
});
}

/**
* @return ApiResponse&lt;EntityResponseArray&gt;
* @throws ApiException if fails to make API call
* @http.response.details
* <table border="1">
* <caption>Response details</caption>
* <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
* <tr><td> 202 </td><td> Accepted </td><td> - </td></tr>
* <tr><td> 429 </td><td> Too many requests </td><td> - </td></tr>
* </table>
*/
public ApiResponse<EntityResponseArray> previewCatalogEntitiesWithHttpInfo() throws ApiException {
Object localVarPostBody = null;
// create path and map variables
String localVarPath = "/api/v2/catalog/entity/preview";

Map<String, String> localVarHeaderParams = new HashMap<String, String>();

Invocation.Builder builder =
apiClient.createBuilder(
"v2.SoftwareCatalogApi.previewCatalogEntities",
localVarPath,
new ArrayList<Pair>(),
localVarHeaderParams,
new HashMap<String, String>(),
new String[] {"application/json"},
new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"});
return apiClient.invokeAPI(
"POST",
builder,
localVarHeaderParams,
new String[] {},
localVarPostBody,
new HashMap<String, Object>(),
false,
new GenericType<EntityResponseArray>() {});
}

/**
* Preview catalog entities.
*
* <p>See {@link #previewCatalogEntitiesWithHttpInfo}.
*
* @return CompletableFuture&lt;ApiResponse&lt;EntityResponseArray&gt;&gt;
*/
public CompletableFuture<ApiResponse<EntityResponseArray>>
previewCatalogEntitiesWithHttpInfoAsync() {
Object localVarPostBody = null;
// create path and map variables
String localVarPath = "/api/v2/catalog/entity/preview";

Map<String, String> localVarHeaderParams = new HashMap<String, String>();

Invocation.Builder builder;
try {
builder =
apiClient.createBuilder(
"v2.SoftwareCatalogApi.previewCatalogEntities",
localVarPath,
new ArrayList<Pair>(),
localVarHeaderParams,
new HashMap<String, String>(),
new String[] {"application/json"},
new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"});
} catch (ApiException ex) {
CompletableFuture<ApiResponse<EntityResponseArray>> result = new CompletableFuture<>();
result.completeExceptionally(ex);
return result;
}
return apiClient.invokeAPIAsync(
"POST",
builder,
localVarHeaderParams,
new String[] {},
localVarPostBody,
new HashMap<String, Object>(),
false,
new GenericType<EntityResponseArray>() {});
}

/**
* Create or update entities.
*
Expand Down
Loading
Loading