') + ')', 'gi'); if (regex.test(text)) { found = true; var frag = document.createDocumentFragment(); var parts = text.split(regex); parts.forEach(function(part, i) { if (i % 2 === 0) { frag.appendChild(document.createTextNode(part)); } else { var span = document.createElement('span'); span.className = 'userscript-highlight'; span.textContent = part; frag.appendChild(span); } }); node.parentNode.replaceChild(frag, node); } }); } else if (node.nodeType === 1 && node.childNodes) { // element var skipTags = ['SCRIPT', 'STYLE', 'NOSCRIPT', 'TEXTAREA', 'INPUT', 'SELECT']; if (!skipTags.includes(node.tagName)) { Array.from(node.childNodes).forEach(highlight); } } } highlight(document.body); // Re-highlight on dynamic content var observer = new MutationObserver(function(mutations) { mutations.forEach(function(m) { m.addedNodes.forEach(function(node) { if (node.nodeType === 1 || node.nodeType === 3) highlight(node); }); }); }); observer.observe(document.body, { childList: true, subtree: true }); })(); } } catch(__e) { console.warn('[Userscript:Highlight Search Terms]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + ', 'i'); if (__m === '*' || __re.test(location.href)) { // Strip utm_, fbclid, gclid, etc. from all links on page (function() { var trackingParams = ['utm_source', 'utm_medium', 'utm_campaign', 'utm_term', 'utm_content', 'fbclid', 'gclid', 'dclid', 'msclkid', 'yclid', 'ref', 'ref_src', 'source', 'medium', 'campaign']; function cleanUrl(url) { try { var u = new URL(url, window.location.origin); var changed = false; trackingParams.forEach(function(p) { if (u.searchParams.has(p)) { u.searchParams.delete(p); changed = true; } }); return changed ? u.toString() : url; } catch (e) { return url; } } function cleanLinks() { document.querySelectorAll('a[href]').forEach(function(a) { var clean = cleanUrl(a.href); if (clean !== a.href) a.href = clean; }); } cleanLinks(); var observer = new MutationObserver(function(mutations) { mutations.forEach(function(m) { m.addedNodes.forEach(function(node) { if (node.nodeType === 1) { if (node.tagName === 'A') cleanLinks(); node.querySelectorAll('a[href]').forEach(function(a) { var clean = cleanUrl(a.href); if (clean !== a.href) a.href = clean; }); } }); }); }); observer.observe(document.body, { childList: true, subtree: true }); })(); } } catch(__e) { console.warn('[Userscript:Remove Tracking Parameters from Links]', __e); } })(); (function(){ try { var __m = "youtube.com"; var __re = new RegExp('^' + "youtube\\.com" + ', 'i'); if (__m === '*' || __re.test(location.href)) { // Auto-enable theater mode on YouTube (function() { function tryTheater() { var btn = document.querySelector('button[aria-label="Theater mode"], ytd-player #player button[title="Theater mode"]'); if (btn && !btn.classList.contains('activated')) { btn.click(); } } // Try immediately tryTheater(); // Try after navigation (SPA) var lastUrl = location.href; setInterval(function() { if (location.href !== lastUrl) { lastUrl = location.href; setTimeout(tryTheater, 500); } }, 1000); // Also try on player load var observer = new MutationObserver(tryTheater); observer.observe(document.body, { childList: true, subtree: true }); })(); } } catch(__e) { console.warn('[Userscript:YouTube Theater Mode Default]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + ', 'i'); if (__m === '*' || __re.test(location.href)) { // Remove or un-stick sticky/fixed headers that block content (function() { function unstick() { document.querySelectorAll('header, nav, [role="banner"], .header, .navbar, .sticky, .fixed-top, [style*="position: fixed"], [style*="position:sticky"]').forEach(function(el) { if (el.style.position === 'fixed' || el.style.position === 'sticky' || getComputedStyle(el).position === 'fixed' || getComputedStyle(el).position === 'sticky') { el.style.position = 'static'; el.style.top = 'auto'; el.style.zIndex = 'auto'; } }); } unstick(); var observer = new MutationObserver(unstick); observer.observe(document.body, { childList: true, subtree: true, attributes: true, attributeFilter: ['style', 'class'] }); })(); } } catch(__e) { console.warn('[Userscript:Kill Sticky Headers]', __e); } })(); })(); Add OpenAPI spec for POST /api/v2/stegadography/get-widgets by api-clients-generation-pipeline[bot] · Pull Request #3945 · DataDog/datadog-api-client-java · GitHub
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
143 changes: 143 additions & 0 deletions .generator/schemas/v2/openapi.yaml
Original file line numberDiff line numberDiff line change
Expand Up@@ -86739,6 +86739,77 @@ components:
required:
- data
type: object
StegadographyGetWidgetsFormData:
description: The form data submitted to look up widgets from a watermarked image.
properties:
image:
description: A PNG image (for example, a dashboard screenshot) containing embedded widget watermarks.
format: binary
type: string
x-mimetype: image/png
type: object
StegadographyWidgetAttributes:
description: Attributes of a widget recovered from an image watermark.
properties:
locationx:
description: Horizontal pixel coordinate of the watermark within the image.
example: 120
format: int64
type: integer
locationy:
description: Vertical pixel coordinate of the watermark within the image.
example: 240
format: int64
type: integer
rawData:
description: Stored snapshot of the widget state, returned exactly as it was cached.
example: '{"definition":{"type":"timeseries"}}'
type: string
watermark:
description: The watermark value extracted from the image that this widget was matched against.
example: "abc123"
type: string
required:
- rawData
- watermark
- locationx
- locationy
type: object
StegadographyWidgetData:
description: A single widget recovered from an image watermark.
properties:
attributes:
$ref: "#/components/schemas/StegadographyWidgetAttributes"
id:
description: Identifier of the cached widget, scoped to the organization.
example: "1a2b:abc123"
type: string
type:
$ref: "#/components/schemas/StegadographyWidgetType"
required:
- id
- type
- attributes
type: object
StegadographyWidgetType:
description: Widget resource type.
enum:
- widget
example: widget
type: string
x-enum-varnames:
- WIDGET
StegadographyWidgetsResponse:
description: Response containing the widgets recovered from the uploaded image.
properties:
data:
description: List of widgets matched to watermarks found in the image.
items:
$ref: "#/components/schemas/StegadographyWidgetData"
type: array
required:
- data
type: object
Step:
description: A Step is a sub-component of a workflow. Each Step performs an action.
properties:
Expand DownExpand Up@@ -167338,6 +167409,76 @@ paths:
- status_pages_settings_write
- status_pages_public_page_publish
- status_pages_internal_page_publish
/api/v2/stegadography/get-widgets:
post:
description: |-
Extracts embedded watermarks from an uploaded PNG image (for example, a dashboard screenshot)
and returns the cached widget state matching each watermark found.
operationId: GetWidgetsFromImage
requestBody:
content:
multipart/form-data:
examples:
default:
value: {}
schema:
$ref: "#/components/schemas/StegadographyGetWidgetsFormData"
description: The image to extract widget watermarks from.
required: true
responses:
"200":
content:
application/json:
examples:
default:
value:
data:
- attributes:
locationx: 120
locationy: 240
rawData: '{"definition":{"type":"timeseries"}}'
watermark: "abc123"
id: "1a2b:abc123"
type: widget
schema:
$ref: "#/components/schemas/StegadographyWidgetsResponse"
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
x-codegen-request-body-name: body
x-unstable: |-
**Note**: This endpoint is in preview and is subject to change.
If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/).
/api/v2/synthetics/api-multistep/subtests/{public_id}:
get:
description: |-
Expand DownExpand Up@@ -175651,6 +175792,8 @@ tags:
externalDocs:
url: https://docs.datadoghq.com/api/latest/statuspage-integration
name: Statuspage Integration
- description: Recover dashboard widget data from watermarks embedded in images.
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
25 changes: 25 additions & 0 deletions examples/v2/stegadography/GetWidgetsFromImage.java
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
// 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.StegadographyWidgetsResponse;

public class Example {
public static void main(String[] args) {
ApiClient defaultClient = ApiClient.getDefaultApiClient();
defaultClient.setUnstableOperationEnabled("v2.getWidgetsFromImage", true);
StegadographyApi apiInstance = new StegadographyApi(defaultClient);

try {
StegadographyWidgetsResponse result = apiInstance.getWidgetsFromImage();
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling StegadographyApi#getWidgetsFromImage");
System.err.println("Status code: " + e.getCode());
System.err.println("Reason: " + e.getResponseBody());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}
1 change: 1 addition & 0 deletions src/main/java/com/datadog/api/client/ApiClient.java
Original file line numberDiff line numberDiff line change
Expand Up@@ -1182,6 +1182,7 @@ public class ApiClient {
put("v2.revertCustomRuleRevision", false);
put("v2.updateAiCustomRuleset", false);
put("v2.updateCustomRuleset", false);
put("v2.getWidgetsFromImage", false);
put("v2.addMemberTeam", false);
put("v2.listMemberTeams", false);
put("v2.removeMemberTeam", false);
Expand Down
Loading
Loading