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 @@ -83901,6 +83901,89 @@ components:
type: string
x-enum-varnames:
- USERS
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 @@ -161903,6 +161986,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 @@ -170201,6 +170353,8 @@ tags:
name: Static Analysis
- description: Manage your status pages and communicate service disruptions to stakeholders via Datadog's API. See the [Status Pages documentation](https://docs.datadoghq.com/incident_response/status_pages/) for more information.
name: Status Pages
- 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
7 changes: 7 additions & 0 deletions docs/datadog_api_client.v2.api.rst
Original file line number Diff line number Diff line change
Expand Up @@ -753,6 +753,13 @@ datadog\_api\_client.v2.api.status\_pages\_api module
:members:
:show-inheritance:

datadog\_api\_client.v2.api.stegadography\_api module
-----------------------------------------------------

.. automodule:: datadog_api_client.v2.api.stegadography_api
:members:
:show-inheritance:

datadog\_api\_client.v2.api.storage\_management\_api module
-----------------------------------------------------------

Expand Down
35 changes: 35 additions & 0 deletions docs/datadog_api_client.v2.model.rst
Original file line number Diff line number Diff line change
Expand Up @@ -36607,6 +36607,41 @@ datadog\_api\_client.v2.model.status\_pages\_user\_type module
:members:
:show-inheritance:

datadog\_api\_client.v2.model.stegadography\_get\_widgets\_request module
-------------------------------------------------------------------------

.. automodule:: datadog_api_client.v2.model.stegadography_get_widgets_request
:members:
:show-inheritance:

datadog\_api\_client.v2.model.stegadography\_get\_widgets\_response module
--------------------------------------------------------------------------

.. automodule:: datadog_api_client.v2.model.stegadography_get_widgets_response
:members:
:show-inheritance:

datadog\_api\_client.v2.model.stegadography\_widget module
----------------------------------------------------------

.. automodule:: datadog_api_client.v2.model.stegadography_widget
:members:
:show-inheritance:

datadog\_api\_client.v2.model.stegadography\_widget\_attributes module
----------------------------------------------------------------------

.. automodule:: datadog_api_client.v2.model.stegadography_widget_attributes
:members:
:show-inheritance:

datadog\_api\_client.v2.model.stegadography\_widget\_type module
----------------------------------------------------------------

.. automodule:: datadog_api_client.v2.model.stegadography_widget_type
:members:
:show-inheritance:

datadog\_api\_client.v2.model.step module
-----------------------------------------

Expand Down
13 changes: 13 additions & 0 deletions examples/v2/stegadography/GetStegadographyWidgets.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
"""
Get widgets from an image returns "OK" response
"""

from datadog_api_client import ApiClient, Configuration
from datadog_api_client.v2.api.stegadography_api import StegadographyApi

configuration = Configuration()
with ApiClient(configuration) as api_client:
api_instance = StegadographyApi(api_client)
response = api_instance.get_stegadography_widgets()

print(response)
65 changes: 65 additions & 0 deletions src/datadog_api_client/v2/api/stegadography_api.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License.
# This product includes software developed at Datadog (https://www.datadoghq.com/).
# Copyright 2019-Present Datadog, Inc.
from __future__ import annotations

from typing import Any, Dict

from datadog_api_client.api_client import ApiClient, Endpoint as _Endpoint
from datadog_api_client.configuration import Configuration
from datadog_api_client.model_utils import (
file_type,
)
from datadog_api_client.v2.model.stegadography_get_widgets_response import StegadographyGetWidgetsResponse


class StegadographyApi:
"""
Extract watermarks embedded in dashboard screenshots to retrieve cached widget state.
"""

def __init__(self, api_client=None):
if api_client is None:
api_client = ApiClient(Configuration())
self.api_client = api_client

self._get_stegadography_widgets_endpoint = _Endpoint(
settings={
"response_type": (StegadographyGetWidgetsResponse,),
"auth": ["apiKeyAuth", "appKeyAuth"],
"endpoint_path": "/api/v2/stegadography/get-widgets",
"operation_id": "get_stegadography_widgets",
"http_method": "POST",
"version": "v2",
},
params_map={
"image": {
"required": True,
"openapi_types": (file_type,),
"attribute": "image",
"location": "form",
},
},
headers_map={"accept": ["application/json"], "content_type": ["multipart/form-data"]},
api_client=api_client,
)

def get_stegadography_widgets(
self,
image: file_type,
) -> StegadographyGetWidgetsResponse:
"""Get widgets from an image.

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.

:param image: PNG image file to scan for embedded watermarks.
:type image: file_type
:rtype: StegadographyGetWidgetsResponse
"""
kwargs: Dict[str, Any] = {}
kwargs["image"] = image

return self._get_stegadography_widgets_endpoint.call_with_http_info(**kwargs)
2 changes: 2 additions & 0 deletions src/datadog_api_client/v2/apis/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,7 @@
from datadog_api_client.v2.api.spans_metrics_api import SpansMetricsApi
from datadog_api_client.v2.api.static_analysis_api import StaticAnalysisApi
from datadog_api_client.v2.api.status_pages_api import StatusPagesApi
from datadog_api_client.v2.api.stegadography_api import StegadographyApi
from datadog_api_client.v2.api.storage_management_api import StorageManagementApi
from datadog_api_client.v2.api.synthetics_api import SyntheticsApi
from datadog_api_client.v2.api.teams_api import TeamsApi
Expand Down Expand Up @@ -224,6 +225,7 @@
"SpansMetricsApi",
"StaticAnalysisApi",
"StatusPagesApi",
"StegadographyApi",
"StorageManagementApi",
"SyntheticsApi",
"TeamsApi",
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License.
# This product includes software developed at Datadog (https://www.datadoghq.com/).
# Copyright 2019-Present Datadog, Inc.
from __future__ import annotations


from datadog_api_client.model_utils import (
ModelNormal,
cached_property,
file_type,
)


class StegadographyGetWidgetsRequest(ModelNormal):
@cached_property
def openapi_types(_):
return {
"image": (file_type,),
}

attribute_map = {
"image": "image",
}

def __init__(self_, image: file_type, **kwargs):
"""
Multipart form data containing the PNG image to scan for watermarks.

:param image: PNG image file to scan for embedded watermarks.
:type image: file_type
"""
super().__init__(kwargs)

self_.image = image
Loading
Loading