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
53 changes: 45 additions & 8 deletions .generator/schemas/v2/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -232701,28 +232701,65 @@ paths:
If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/).
get:
description: |-
Retrieves the content of a specific JavaScript source map file by its
filename, service name, and version.
Retrieves the content of a specific JavaScript source map file. Provide either
`debug_id` with a UUID, or all three of `filename`, `service`, and `version`.
When `debug_id` is provided, filename, service, and version are not required
and are ignored.

**Examples:** the following commands use the US1 API host. Replace the host
with the API host for your site, and the filename, service, version, and
debug ID with values from your organization. Use `--get` so curl sends the
parameters in the query string.

**1. Retrieve a source map by debug ID**

Provide `debug_id` with a UUID. No filename, service, or version is required.

```bash
curl -sS --get "https://api.datadoghq.com/api/v2/sourcemaps" \
-H "Accept: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
--data-urlencode "debug_id=00000000-0000-4000-8000-000000000001"
```

**2. Retrieve a source map by service and version**

Provide `filename` together with `service` and `version`.

```bash
curl -sS --get "https://api.datadoghq.com/api/v2/sourcemaps" \
-H "Accept: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
--data-urlencode "filename=js/bundle.min.js.map" \
--data-urlencode "service=my-web-service" \
--data-urlencode "version=1.0.0"
```
operationId: GetSourcemaps
parameters:
- description: The path to the source map file.
- description: |-
The debug ID of the JavaScript source map, in UUID format. When provided,
filename, service, and version are not required and are ignored.
in: query
name: debug_id
schema:
example: 00000000-0000-4000-8000-000000000001
format: uuid
type: string
- description: The path to the source map file. Required when `debug_id` is omitted.
in: query
name: filename
required: true
schema:
example: js/bundle.min.js.map
type: string
- description: The service name associated with the source map.
- description: The service name associated with the source map. Required when `debug_id` is omitted.
in: query
name: service
required: true
schema:
example: my-web-service
type: string
- description: The version of the service associated with the source map.
- description: The version of the service associated with the source map. Required when `debug_id` is omitted.
in: query
name: version
required: true
schema:
example: 1.0.0
type: string
Expand Down
78 changes: 61 additions & 17 deletions src/datadog_api_client/v2/api/rum_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -309,20 +309,22 @@ def __init__(self, api_client=None):
"version": "v2",
},
params_map={
"debug_id": {
"openapi_types": (UUID,),
"attribute": "debug_id",
"location": "query",
},
"filename": {
"required": True,
"openapi_types": (str,),
"attribute": "filename",
"location": "query",
},
"service": {
"required": True,
"openapi_types": (str,),
"attribute": "service",
"location": "query",
},
"version": {
"required": True,
"openapi_types": (str,),
"attribute": "version",
"location": "query",
Expand Down Expand Up @@ -948,29 +950,71 @@ def get_service_repository_info(

def get_sourcemaps(
self,
filename: str,
service: str,
version: str,
*,
debug_id: Union[UUID, UnsetType] = unset,
filename: Union[str, UnsetType] = unset,
service: Union[str, UnsetType] = unset,
version: Union[str, UnsetType] = unset,
) -> SourcemapFileResponse:
"""Get a JavaScript source map.

Retrieves the content of a specific JavaScript source map file by its
filename, service name, and version.
Retrieves the content of a specific JavaScript source map file. Provide either
``debug_id`` with a UUID, or all three of ``filename`` , ``service`` , and ``version``.
When ``debug_id`` is provided, filename, service, and version are not required
and are ignored.

**Examples:** the following commands use the US1 API host. Replace the host
with the API host for your site, and the filename, service, version, and
debug ID with values from your organization. Use ``--get`` so curl sends the
parameters in the query string.

**1. Retrieve a source map by debug ID**

Provide ``debug_id`` with a UUID. No filename, service, or version is required.

.. code-block:: bash

curl -sS --get "https://api.datadoghq.com/api/v2/sourcemaps" \
-H "Accept: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
--data-urlencode "debug_id=00000000-0000-4000-8000-000000000001"

**2. Retrieve a source map by service and version**

Provide ``filename`` together with ``service`` and ``version``.

:param filename: The path to the source map file.
:type filename: str
:param service: The service name associated with the source map.
:type service: str
:param version: The version of the service associated with the source map.
:type version: str
.. code-block:: bash

curl -sS --get "https://api.datadoghq.com/api/v2/sourcemaps" \
-H "Accept: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
--data-urlencode "filename=js/bundle.min.js.map" \
--data-urlencode "service=my-web-service" \
--data-urlencode "version=1.0.0"

:param debug_id: The debug ID of the JavaScript source map, in UUID format. When provided,
filename, service, and version are not required and are ignored.
:type debug_id: UUID, optional
:param filename: The path to the source map file. Required when ``debug_id`` is omitted.
:type filename: str, optional
:param service: The service name associated with the source map. Required when ``debug_id`` is omitted.
:type service: str, optional
:param version: The version of the service associated with the source map. Required when ``debug_id`` is omitted.
:type version: str, optional
:rtype: SourcemapFileResponse
"""
kwargs: Dict[str, Any] = {}
kwargs["filename"] = filename
if debug_id is not unset:
kwargs["debug_id"] = debug_id

if filename is not unset:
kwargs["filename"] = filename

kwargs["service"] = service
if service is not unset:
kwargs["service"] = service

kwargs["version"] = version
if version is not unset:
kwargs["version"] = version

return self._get_sourcemaps_endpoint.call_with_http_info(**kwargs)

Expand Down
Loading