Skip to content
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
154 changes: 154 additions & 0 deletions .generator/schemas/v2/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -86739,6 +86739,89 @@ components:
required:
- data
type: object
StegadographyGetWidgetsRequest:
description: Multipart form data containing the PNG image to scan for watermarks.
properties:
image:
description: PNG image file to scan for embedded watermarks.
example: "screenshot.png"
format: binary
type: string
required:
- image
type: object
StegadographyGetWidgetsResponse:
description: Response containing watermarked widgets recovered from an image.
properties:
data:
$ref: "#/components/schemas/StegadographyWidgetItems"
required:
- data
type: object
StegadographyWidget:
description: A single watermarked widget resource recovered from an image.
properties:
attributes:
$ref: "#/components/schemas/StegadographyWidgetAttributes"
id:
description: Composite identifier formed from the organization ID and watermark, separated by a colon.
example: "abc123:0123456789abcdef"
type: string
type:
$ref: "#/components/schemas/StegadographyWidgetType"
required:
- id
- type
- attributes
type: object
StegadographyWidgetAttributes:
description: Attributes of a watermarked widget recovered from an image.
properties:
locationx:
description: Horizontal pixel coordinate where the watermark was found in the image.
example: 100
format: int64
type: integer
locationy:
description: Vertical pixel coordinate where the watermark was found in the image.
example: 200
format: int64
type: integer
rawData:
description: JSON-encoded string representing the widget state.
example: '{"widgetType":"timeseries","requests":[]}'
type: string
watermark:
description: Hex-encoded watermark string identifying the widget.
example: "0123456789abcdef"
type: string
required:
- rawData
- watermark
- locationx
- locationy
type: object
StegadographyWidgetItems:
description: List of watermarked widget resources recovered from an image.
example:
- attributes:
locationx: 100
locationy: 200
rawData: '{"widgetType":"timeseries","requests":[]}'
watermark: "0123456789abcdef"
id: "abc123:0123456789abcdef"
type: widget
items:
$ref: "#/components/schemas/StegadographyWidget"
type: array
StegadographyWidgetType:
description: Stegadography widget resource type.
enum:
- widget
example: widget
type: string
x-enum-varnames:
- WIDGET
Step:
description: A Step is a sub-component of a workflow. Each Step performs an action.
properties:
Expand Down Expand Up @@ -167338,6 +167421,75 @@ paths:
- status_pages_settings_write
- status_pages_public_page_publish
- status_pages_internal_page_publish
/api/v2/stegadography/get-widgets:
post:
description: |-
Extracts watermarks from a PNG image and returns the cached widget data
associated with each watermark found. The image must be uploaded as a
`multipart/form-data` request with the file in the `image` field.
Only widgets belonging to the authenticated organization are returned.
operationId: GetStegadographyWidgets
requestBody:
content:
multipart/form-data:
examples:
default:
value:
image: "screenshot.png"
schema:
$ref: "#/components/schemas/StegadographyGetWidgetsRequest"
description: PNG image to extract watermarks from.
required: true
responses:
"200":
content:
application/json:
examples:
default:
value:
data:
- attributes:
locationx: 100
locationy: 200
rawData: '{"widgetType":"timeseries","requests":[]}'
watermark: "0123456789abcdef"
id: "abc123:0123456789abcdef"
type: widget
schema:
$ref: "#/components/schemas/StegadographyGetWidgetsResponse"
description: OK
"400":
content:
application/json:
schema:
$ref: "#/components/schemas/JSONAPIErrorResponse"
description: Bad Request
"403":
content:
application/json:
schema:
$ref: "#/components/schemas/JSONAPIErrorResponse"
description: Forbidden
"415":
content:
application/json:
schema:
$ref: "#/components/schemas/JSONAPIErrorResponse"
description: Unsupported Media Type
"429":
$ref: "#/components/responses/TooManyRequestsResponse"
"500":
content:
application/json:
schema:
$ref: "#/components/schemas/JSONAPIErrorResponse"
description: Internal Server Error
security:
- apiKeyAuth: []
appKeyAuth: []
summary: Get widgets from an image
tags:
- Stegadography
/api/v2/synthetics/api-multistep/subtests/{public_id}:
get:
description: |-
Expand Down Expand Up @@ -175651,6 +175803,8 @@ tags:
externalDocs:
url: https://docs.datadoghq.com/api/latest/statuspage-integration
name: Statuspage Integration
- description: Extract watermarks embedded in dashboard screenshots to retrieve cached widget state.
name: Stegadography
- description: |-
Enable Storage Management for S3 buckets, GCS buckets, and Azure containers. Each configuration registers the destination that holds inventory reports for the storage being monitored.
name: Storage Management
Expand Down
26 changes: 26 additions & 0 deletions examples/v2/stegadography/GetStegadographyWidgets.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
// Get widgets from an image returns "OK" response

import com.datadog.api.client.ApiClient;
import com.datadog.api.client.ApiException;
import com.datadog.api.client.v2.api.StegadographyApi;
import com.datadog.api.client.v2.model.StegadographyGetWidgetsResponse;
import java.io.File;

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

try {
StegadographyGetWidgetsResponse result =
apiInstance.getStegadographyWidgets(new File("fixtures/stegadography/image.png"));
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling StegadographyApi#getStegadographyWidgets");
System.err.println("Status code: " + e.getCode());
System.err.println("Reason: " + e.getResponseBody());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}
195 changes: 195 additions & 0 deletions src/main/java/com/datadog/api/client/v2/api/StegadographyApi.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,195 @@
package com.datadog.api.client.v2.api;

import com.datadog.api.client.ApiClient;
import com.datadog.api.client.ApiException;
import com.datadog.api.client.ApiResponse;
import com.datadog.api.client.Pair;
import com.datadog.api.client.v2.model.StegadographyGetWidgetsResponse;
import jakarta.ws.rs.client.Invocation;
import jakarta.ws.rs.core.GenericType;
import java.io.File;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.Map;
import java.util.concurrent.CompletableFuture;

@jakarta.annotation.Generated(
value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator")
public class StegadographyApi {
private ApiClient apiClient;

public StegadographyApi() {
this(ApiClient.getDefaultApiClient());
}

public StegadographyApi(ApiClient apiClient) {
this.apiClient = apiClient;
}

/**
* Get the API client.
*
* @return API client
*/
public ApiClient getApiClient() {
return apiClient;
}

/**
* Set the API client.
*
* @param apiClient an instance of API client
*/
public void setApiClient(ApiClient apiClient) {
this.apiClient = apiClient;
}

/**
* Get widgets from an image.
*
* <p>See {@link #getStegadographyWidgetsWithHttpInfo}.
*
* @param image PNG image file to scan for embedded watermarks. (required)
* @return StegadographyGetWidgetsResponse
* @throws ApiException if fails to make API call
*/
public StegadographyGetWidgetsResponse getStegadographyWidgets(File image) throws ApiException {
return getStegadographyWidgetsWithHttpInfo(image).getData();
}

/**
* Get widgets from an image.
*
* <p>See {@link #getStegadographyWidgetsWithHttpInfoAsync}.
*
* @param image PNG image file to scan for embedded watermarks. (required)
* @return CompletableFuture&lt;StegadographyGetWidgetsResponse&gt;
*/
public CompletableFuture<StegadographyGetWidgetsResponse> getStegadographyWidgetsAsync(
File image) {
return getStegadographyWidgetsWithHttpInfoAsync(image)
.thenApply(
response -> {
return response.getData();
});
}

/**
* Extracts watermarks from a PNG image and returns the cached widget data associated with each
* watermark found. The image must be uploaded as a <code>multipart/form-data</code> request with
* the file in the <code>image</code> field. Only widgets belonging to the authenticated
* organization are returned.
*
* @param image PNG image file to scan for embedded watermarks. (required)
* @return ApiResponse&lt;StegadographyGetWidgetsResponse&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> 200 </td><td> OK </td><td> - </td></tr>
* <tr><td> 400 </td><td> Bad Request </td><td> - </td></tr>
* <tr><td> 403 </td><td> Forbidden </td><td> - </td></tr>
* <tr><td> 415 </td><td> Unsupported Media Type </td><td> - </td></tr>
* <tr><td> 429 </td><td> Too many requests </td><td> - </td></tr>
* <tr><td> 500 </td><td> Internal Server Error </td><td> - </td></tr>
* </table>
*/
public ApiResponse<StegadographyGetWidgetsResponse> getStegadographyWidgetsWithHttpInfo(
File image) throws ApiException {
Object localVarPostBody = null;

// verify the required parameter 'image' is set
if (image == null) {
throw new ApiException(
400, "Missing the required parameter 'image' when calling getStegadographyWidgets");
}
// create path and map variables
String localVarPath = "/api/v2/stegadography/get-widgets";

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

if (image != null) {
localVarFormParams.put("image", image);
}

Invocation.Builder builder =
apiClient.createBuilder(
"v2.StegadographyApi.getStegadographyWidgets",
localVarPath,
new ArrayList<Pair>(),
localVarHeaderParams,
new HashMap<String, String>(),
new String[] {"application/json"},
new String[] {"apiKeyAuth", "appKeyAuth"});
return apiClient.invokeAPI(
"POST",
builder,
localVarHeaderParams,
new String[] {"multipart/form-data"},
localVarPostBody,
localVarFormParams,
false,
new GenericType<StegadographyGetWidgetsResponse>() {});
}

/**
* Get widgets from an image.
*
* <p>See {@link #getStegadographyWidgetsWithHttpInfo}.
*
* @param image PNG image file to scan for embedded watermarks. (required)
* @return CompletableFuture&lt;ApiResponse&lt;StegadographyGetWidgetsResponse&gt;&gt;
*/
public CompletableFuture<ApiResponse<StegadographyGetWidgetsResponse>>
getStegadographyWidgetsWithHttpInfoAsync(File image) {
Object localVarPostBody = null;

// verify the required parameter 'image' is set
if (image == null) {
CompletableFuture<ApiResponse<StegadographyGetWidgetsResponse>> result =
new CompletableFuture<>();
result.completeExceptionally(
new ApiException(
400, "Missing the required parameter 'image' when calling getStegadographyWidgets"));
return result;
}
// create path and map variables
String localVarPath = "/api/v2/stegadography/get-widgets";

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

if (image != null) {
localVarFormParams.put("image", image);
}

Invocation.Builder builder;
try {
builder =
apiClient.createBuilder(
"v2.StegadographyApi.getStegadographyWidgets",
localVarPath,
new ArrayList<Pair>(),
localVarHeaderParams,
new HashMap<String, String>(),
new String[] {"application/json"},
new String[] {"apiKeyAuth", "appKeyAuth"});
} catch (ApiException ex) {
CompletableFuture<ApiResponse<StegadographyGetWidgetsResponse>> result =
new CompletableFuture<>();
result.completeExceptionally(ex);
return result;
}
return apiClient.invokeAPIAsync(
"POST",
builder,
localVarHeaderParams,
new String[] {"multipart/form-data"},
localVarPostBody,
localVarFormParams,
false,
new GenericType<StegadographyGetWidgetsResponse>() {});
}
}
Loading
Loading