From ee94e06835b66d7f37dad29c2968f3b7c5e32fc7 Mon Sep 17 00:00:00 2001 From: "ci.datadog-api-spec" Date: Mon, 30 Mar 2026 08:31:19 +0000 Subject: [PATCH] Regenerate client from commit 962dc50 of spec repo --- .generator/schemas/v2/openapi.yaml | 374 ++++++++++++++++++ docs/datadog_api_client.v2.model.rst | 70 ++++ .../AbortTestFileMultipartUpload.py | 19 + .../CompleteTestFileMultipartUpload.py | 28 ++ .../v2/synthetics/GetTestFileDownloadUrl.py | 18 + .../GetTestFileMultipartPresignedUrls.py | 32 ++ .../v2/api/synthetics_api.py | 206 ++++++++++ ...est_file_abort_multipart_upload_request.py | 39 ++ ...est_file_complete_multipart_upload_part.py | 39 ++ ..._file_complete_multipart_upload_request.py | 56 +++ .../synthetics_test_file_download_request.py | 39 ++ .../synthetics_test_file_download_response.py | 36 ++ ...st_file_multipart_presigned_urls_params.py | 56 +++ ...test_file_multipart_presigned_urls_part.py | 46 +++ ...t_file_multipart_presigned_urls_request.py | 61 +++ ...resigned_urls_request_bucket_key_prefix.py | 42 ++ ..._file_multipart_presigned_urls_response.py | 58 +++ src/datadog_api_client/v2/models/__init__.py | 36 ++ tests/v2/features/synthetics.feature | 64 +++ tests/v2/features/undo.json | 24 ++ 20 files changed, 1343 insertions(+) create mode 100644 examples/v2/synthetics/AbortTestFileMultipartUpload.py create mode 100644 examples/v2/synthetics/CompleteTestFileMultipartUpload.py create mode 100644 examples/v2/synthetics/GetTestFileDownloadUrl.py create mode 100644 examples/v2/synthetics/GetTestFileMultipartPresignedUrls.py create mode 100644 src/datadog_api_client/v2/model/synthetics_test_file_abort_multipart_upload_request.py create mode 100644 src/datadog_api_client/v2/model/synthetics_test_file_complete_multipart_upload_part.py create mode 100644 src/datadog_api_client/v2/model/synthetics_test_file_complete_multipart_upload_request.py create mode 100644 src/datadog_api_client/v2/model/synthetics_test_file_download_request.py create mode 100644 src/datadog_api_client/v2/model/synthetics_test_file_download_response.py create mode 100644 src/datadog_api_client/v2/model/synthetics_test_file_multipart_presigned_urls_params.py create mode 100644 src/datadog_api_client/v2/model/synthetics_test_file_multipart_presigned_urls_part.py create mode 100644 src/datadog_api_client/v2/model/synthetics_test_file_multipart_presigned_urls_request.py create mode 100644 src/datadog_api_client/v2/model/synthetics_test_file_multipart_presigned_urls_request_bucket_key_prefix.py create mode 100644 src/datadog_api_client/v2/model/synthetics_test_file_multipart_presigned_urls_response.py diff --git a/.generator/schemas/v2/openapi.yaml b/.generator/schemas/v2/openapi.yaml index ea8f0cd3e1..eac2fa3c17 100644 --- a/.generator/schemas/v2/openapi.yaml +++ b/.generator/schemas/v2/openapi.yaml @@ -65509,6 +65509,149 @@ components: type: string x-enum-varnames: - SUITES + SyntheticsTestFileAbortMultipartUploadRequest: + description: Request body for aborting a multipart file upload. + properties: + key: + description: The full storage path of the file whose upload should be aborted. + example: "org-123/api-upload-file/abc-def-123/2024-01-01T00:00:00_uuid.json" + type: string + uploadId: + description: The upload ID of the multipart upload to abort. + example: "upload-id-abc123" + type: string + required: + - uploadId + - key + type: object + SyntheticsTestFileCompleteMultipartUploadPart: + description: A completed part of a multipart upload. + properties: + ETag: + description: The ETag returned by the storage provider after uploading the part. + example: '"d41d8cd98f00b204e9800998ecf8427e"' + type: string + PartNumber: + description: The 1-indexed part number for the multipart upload. + example: 1 + format: int64 + type: integer + required: + - ETag + - PartNumber + type: object + SyntheticsTestFileCompleteMultipartUploadRequest: + description: Request body for completing a multipart file upload. + properties: + key: + description: The full storage path for the uploaded file. + example: "org-123/api-upload-file/abc-def-123/2024-01-01T00:00:00_uuid.json" + type: string + parts: + description: Array of completed parts with their ETags. + items: + $ref: "#/components/schemas/SyntheticsTestFileCompleteMultipartUploadPart" + type: array + uploadId: + description: The upload ID returned when the multipart upload was initiated. + example: "upload-id-abc123" + type: string + required: + - uploadId + - key + - parts + type: object + SyntheticsTestFileDownloadRequest: + description: Request body for getting a presigned download URL for a test file. + properties: + bucketKey: + description: The bucket key referencing the file to download. + example: "api-upload-file/abc-def-123/2024-01-01T00:00:00_uuid.json" + minLength: 1 + type: string + required: + - bucketKey + type: object + SyntheticsTestFileDownloadResponse: + description: Response containing a presigned URL for downloading a test file. + properties: + url: + description: A presigned URL to download the file. The URL expires after a short period. + example: "https://storage.example.com/presigned-download-url" + type: string + type: object + SyntheticsTestFileMultipartPresignedUrlsParams: + description: Presigned URL parameters returned for a multipart upload. + properties: + key: + description: The full storage path for the file being uploaded. + example: "org-123/api-upload-file/abc-def-123/2024-01-01T00:00:00_uuid.json" + type: string + upload_id: + description: The upload ID assigned by the storage provider for this multipart upload. + example: "upload-id-abc123" + type: string + urls: + additionalProperties: + type: string + description: A map of part numbers to presigned upload URLs. + example: + "1": "https://storage.example.com/presigned-upload-url-part-1" + "2": "https://storage.example.com/presigned-upload-url-part-2" + type: object + type: object + SyntheticsTestFileMultipartPresignedUrlsPart: + description: A part descriptor for initiating a multipart upload. + properties: + md5: + description: Base64-encoded MD5 digest of the part content. + example: "1B2M2Y8AsgTpgAmY7PhCfg==" + maxLength: 24 + minLength: 22 + type: string + partNumber: + description: The 1-indexed part number for the multipart upload. + example: 1 + format: int64 + type: integer + required: + - md5 + - partNumber + type: object + SyntheticsTestFileMultipartPresignedUrlsRequest: + description: Request body for getting presigned URLs for a multipart file upload. + properties: + bucketKeyPrefix: + $ref: "#/components/schemas/SyntheticsTestFileMultipartPresignedUrlsRequestBucketKeyPrefix" + parts: + description: Array of part descriptors for the multipart upload. + items: + $ref: "#/components/schemas/SyntheticsTestFileMultipartPresignedUrlsPart" + type: array + required: + - bucketKeyPrefix + - parts + type: object + SyntheticsTestFileMultipartPresignedUrlsRequestBucketKeyPrefix: + description: The bucket key prefix indicating the type of file upload. + enum: + - api-upload-file + - browser-upload-file-step + example: "api-upload-file" + type: string + x-enum-varnames: + - API_UPLOAD_FILE + - BROWSER_UPLOAD_FILE_STEP + SyntheticsTestFileMultipartPresignedUrlsResponse: + description: Response containing presigned URLs for multipart file upload and the bucket key. + properties: + bucketKey: + description: The bucket key that references the uploaded file after completion. + example: "api-upload-file/abc-def-123/2024-01-01T00:00:00_uuid.json" + type: string + multipart_presigned_urls_params: + $ref: "#/components/schemas/SyntheticsTestFileMultipartPresignedUrlsParams" + type: object SyntheticsTestOptions: description: Object describing the extra options for a Synthetic test. properties: @@ -107394,6 +107537,237 @@ paths: permissions: - synthetics_write - synthetics_create_edit_trigger + /api/v2/synthetics/tests/{public_id}/files/download: + post: + description: |- + Get a presigned URL to download a file attached to a Synthetic test. + The returned URL is temporary and expires after a short period. + operationId: GetTestFileDownloadUrl + parameters: + - description: The public ID of the Synthetic test. + in: path + name: public_id + required: true + schema: + example: abc-def-123 + type: string + requestBody: + content: + application/json: + schema: + $ref: "#/components/schemas/SyntheticsTestFileDownloadRequest" + required: true + responses: + "200": + content: + application/json: + schema: + $ref: "#/components/schemas/SyntheticsTestFileDownloadResponse" + description: OK + "400": + content: + application/json: + schema: + $ref: "#/components/schemas/APIErrorResponse" + description: API error response. + "403": + content: + application/json: + schema: + $ref: "#/components/schemas/APIErrorResponse" + description: Forbidden. + "404": + content: + application/json: + schema: + $ref: "#/components/schemas/APIErrorResponse" + description: API error response. + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: + - synthetics_read + summary: Get a presigned URL for downloading a test file + tags: + - Synthetics + x-permission: + operator: OR + permissions: + - synthetics_read + /api/v2/synthetics/tests/{public_id}/files/multipart-presigned-urls: + post: + description: |- + Get presigned URLs for uploading a file to a Synthetic test using multipart upload. + Returns the presigned URLs for each part along with the bucket key that references the file. + operationId: GetTestFileMultipartPresignedUrls + parameters: + - description: The public ID of the Synthetic test. + in: path + name: public_id + required: true + schema: + example: abc-def-123 + type: string + requestBody: + content: + application/json: + schema: + $ref: "#/components/schemas/SyntheticsTestFileMultipartPresignedUrlsRequest" + required: true + responses: + "200": + content: + application/json: + schema: + $ref: "#/components/schemas/SyntheticsTestFileMultipartPresignedUrlsResponse" + description: OK + "400": + content: + application/json: + schema: + $ref: "#/components/schemas/APIErrorResponse" + description: API error response. + "403": + content: + application/json: + schema: + $ref: "#/components/schemas/APIErrorResponse" + description: Forbidden. + "404": + content: + application/json: + schema: + $ref: "#/components/schemas/APIErrorResponse" + description: API error response. + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: + - synthetics_write + summary: Get presigned URLs for uploading a test file + tags: + - Synthetics + x-permission: + operator: OR + permissions: + - synthetics_write + - synthetics_create_edit_trigger + /api/v2/synthetics/tests/{public_id}/files/multipart-upload-abort: + post: + description: |- + Abort an in-progress multipart file upload for a Synthetic test. This cancels the upload + and releases any storage used by already-uploaded parts. + operationId: AbortTestFileMultipartUpload + parameters: + - description: The public ID of the Synthetic test. + in: path + name: public_id + required: true + schema: + example: abc-def-123 + type: string + requestBody: + content: + application/json: + schema: + $ref: "#/components/schemas/SyntheticsTestFileAbortMultipartUploadRequest" + required: true + responses: + "204": + description: No Content + "400": + content: + application/json: + schema: + $ref: "#/components/schemas/APIErrorResponse" + description: API error response. + "403": + content: + application/json: + schema: + $ref: "#/components/schemas/APIErrorResponse" + description: Forbidden. + "404": + content: + application/json: + schema: + $ref: "#/components/schemas/APIErrorResponse" + description: API error response. + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: + - synthetics_write + summary: Abort a multipart upload of a test file + tags: + - Synthetics + x-permission: + operator: OR + permissions: + - synthetics_write + - synthetics_create_edit_trigger + /api/v2/synthetics/tests/{public_id}/files/multipart-upload-complete: + post: + description: |- + Complete a multipart file upload for a Synthetic test. Call this endpoint after all parts + have been uploaded using the presigned URLs obtained from the multipart presigned URLs endpoint. + operationId: CompleteTestFileMultipartUpload + parameters: + - description: The public ID of the Synthetic test. + in: path + name: public_id + required: true + schema: + example: abc-def-123 + type: string + requestBody: + content: + application/json: + schema: + $ref: "#/components/schemas/SyntheticsTestFileCompleteMultipartUploadRequest" + required: true + responses: + "204": + description: No Content + "400": + content: + application/json: + schema: + $ref: "#/components/schemas/APIErrorResponse" + description: API error response. + "403": + content: + application/json: + schema: + $ref: "#/components/schemas/APIErrorResponse" + description: Forbidden. + "404": + content: + application/json: + schema: + $ref: "#/components/schemas/APIErrorResponse" + description: API error response. + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: + - synthetics_write + summary: Complete a multipart upload of a test file + tags: + - Synthetics + x-permission: + operator: OR + permissions: + - synthetics_write + - synthetics_create_edit_trigger /api/v2/synthetics/tests/{public_id}/parent-suites: get: description: Get the list of parent suites and their status for a given Synthetic test. diff --git a/docs/datadog_api_client.v2.model.rst b/docs/datadog_api_client.v2.model.rst index aff4489c6a..1e35118a14 100644 --- a/docs/datadog_api_client.v2.model.rst +++ b/docs/datadog_api_client.v2.model.rst @@ -29768,6 +29768,76 @@ datadog\_api\_client.v2.model.synthetics\_suite\_types module :members: :show-inheritance: +datadog\_api\_client.v2.model.synthetics\_test\_file\_abort\_multipart\_upload\_request module +---------------------------------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.synthetics_test_file_abort_multipart_upload_request + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.synthetics\_test\_file\_complete\_multipart\_upload\_part module +---------------------------------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.synthetics_test_file_complete_multipart_upload_part + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.synthetics\_test\_file\_complete\_multipart\_upload\_request module +------------------------------------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.synthetics_test_file_complete_multipart_upload_request + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.synthetics\_test\_file\_download\_request module +------------------------------------------------------------------------------ + +.. automodule:: datadog_api_client.v2.model.synthetics_test_file_download_request + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.synthetics\_test\_file\_download\_response module +------------------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.synthetics_test_file_download_response + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.synthetics\_test\_file\_multipart\_presigned\_urls\_params module +----------------------------------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.synthetics_test_file_multipart_presigned_urls_params + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.synthetics\_test\_file\_multipart\_presigned\_urls\_part module +--------------------------------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.synthetics_test_file_multipart_presigned_urls_part + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.synthetics\_test\_file\_multipart\_presigned\_urls\_request module +------------------------------------------------------------------------------------------------ + +.. automodule:: datadog_api_client.v2.model.synthetics_test_file_multipart_presigned_urls_request + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.synthetics\_test\_file\_multipart\_presigned\_urls\_request\_bucket\_key\_prefix module +--------------------------------------------------------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.synthetics_test_file_multipart_presigned_urls_request_bucket_key_prefix + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.synthetics\_test\_file\_multipart\_presigned\_urls\_response module +------------------------------------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.synthetics_test_file_multipart_presigned_urls_response + :members: + :show-inheritance: + datadog\_api\_client.v2.model.synthetics\_test\_options module -------------------------------------------------------------- diff --git a/examples/v2/synthetics/AbortTestFileMultipartUpload.py b/examples/v2/synthetics/AbortTestFileMultipartUpload.py new file mode 100644 index 0000000000..014ffeca97 --- /dev/null +++ b/examples/v2/synthetics/AbortTestFileMultipartUpload.py @@ -0,0 +1,19 @@ +""" +Abort a multipart upload of a test file returns "No Content" response +""" + +from datadog_api_client import ApiClient, Configuration +from datadog_api_client.v2.api.synthetics_api import SyntheticsApi +from datadog_api_client.v2.model.synthetics_test_file_abort_multipart_upload_request import ( + SyntheticsTestFileAbortMultipartUploadRequest, +) + +body = SyntheticsTestFileAbortMultipartUploadRequest( + key="org-123/api-upload-file/abc-def-123/2024-01-01T00:00:00_uuid.json", + upload_id="upload-id-abc123", +) + +configuration = Configuration() +with ApiClient(configuration) as api_client: + api_instance = SyntheticsApi(api_client) + api_instance.abort_test_file_multipart_upload(public_id="abc-def-123", body=body) diff --git a/examples/v2/synthetics/CompleteTestFileMultipartUpload.py b/examples/v2/synthetics/CompleteTestFileMultipartUpload.py new file mode 100644 index 0000000000..181ecba1bd --- /dev/null +++ b/examples/v2/synthetics/CompleteTestFileMultipartUpload.py @@ -0,0 +1,28 @@ +""" +Complete a multipart upload of a test file returns "No Content" response +""" + +from datadog_api_client import ApiClient, Configuration +from datadog_api_client.v2.api.synthetics_api import SyntheticsApi +from datadog_api_client.v2.model.synthetics_test_file_complete_multipart_upload_part import ( + SyntheticsTestFileCompleteMultipartUploadPart, +) +from datadog_api_client.v2.model.synthetics_test_file_complete_multipart_upload_request import ( + SyntheticsTestFileCompleteMultipartUploadRequest, +) + +body = SyntheticsTestFileCompleteMultipartUploadRequest( + key="org-123/api-upload-file/abc-def-123/2024-01-01T00:00:00_uuid.json", + parts=[ + SyntheticsTestFileCompleteMultipartUploadPart( + e_tag='"d41d8cd98f00b204e9800998ecf8427e"', + part_number=1, + ), + ], + upload_id="upload-id-abc123", +) + +configuration = Configuration() +with ApiClient(configuration) as api_client: + api_instance = SyntheticsApi(api_client) + api_instance.complete_test_file_multipart_upload(public_id="abc-def-123", body=body) diff --git a/examples/v2/synthetics/GetTestFileDownloadUrl.py b/examples/v2/synthetics/GetTestFileDownloadUrl.py new file mode 100644 index 0000000000..2f2fd365ea --- /dev/null +++ b/examples/v2/synthetics/GetTestFileDownloadUrl.py @@ -0,0 +1,18 @@ +""" +Get a presigned URL for downloading a test file returns "OK" response +""" + +from datadog_api_client import ApiClient, Configuration +from datadog_api_client.v2.api.synthetics_api import SyntheticsApi +from datadog_api_client.v2.model.synthetics_test_file_download_request import SyntheticsTestFileDownloadRequest + +body = SyntheticsTestFileDownloadRequest( + bucket_key="api-upload-file/abc-def-123/2024-01-01T00:00:00_uuid.json", +) + +configuration = Configuration() +with ApiClient(configuration) as api_client: + api_instance = SyntheticsApi(api_client) + response = api_instance.get_test_file_download_url(public_id="abc-def-123", body=body) + + print(response) diff --git a/examples/v2/synthetics/GetTestFileMultipartPresignedUrls.py b/examples/v2/synthetics/GetTestFileMultipartPresignedUrls.py new file mode 100644 index 0000000000..fb2cc95931 --- /dev/null +++ b/examples/v2/synthetics/GetTestFileMultipartPresignedUrls.py @@ -0,0 +1,32 @@ +""" +Get presigned URLs for uploading a test file returns "OK" response +""" + +from datadog_api_client import ApiClient, Configuration +from datadog_api_client.v2.api.synthetics_api import SyntheticsApi +from datadog_api_client.v2.model.synthetics_test_file_multipart_presigned_urls_part import ( + SyntheticsTestFileMultipartPresignedUrlsPart, +) +from datadog_api_client.v2.model.synthetics_test_file_multipart_presigned_urls_request import ( + SyntheticsTestFileMultipartPresignedUrlsRequest, +) +from datadog_api_client.v2.model.synthetics_test_file_multipart_presigned_urls_request_bucket_key_prefix import ( + SyntheticsTestFileMultipartPresignedUrlsRequestBucketKeyPrefix, +) + +body = SyntheticsTestFileMultipartPresignedUrlsRequest( + bucket_key_prefix=SyntheticsTestFileMultipartPresignedUrlsRequestBucketKeyPrefix.API_UPLOAD_FILE, + parts=[ + SyntheticsTestFileMultipartPresignedUrlsPart( + md5="1B2M2Y8AsgTpgAmY7PhCfg==", + part_number=1, + ), + ], +) + +configuration = Configuration() +with ApiClient(configuration) as api_client: + api_instance = SyntheticsApi(api_client) + response = api_instance.get_test_file_multipart_presigned_urls(public_id="abc-def-123", body=body) + + print(response) diff --git a/src/datadog_api_client/v2/api/synthetics_api.py b/src/datadog_api_client/v2/api/synthetics_api.py index 537f6d0737..ef02b17a4d 100644 --- a/src/datadog_api_client/v2/api/synthetics_api.py +++ b/src/datadog_api_client/v2/api/synthetics_api.py @@ -30,6 +30,20 @@ from datadog_api_client.v2.model.synthetics_fast_test_result import SyntheticsFastTestResult from datadog_api_client.v2.model.synthetics_network_test_response import SyntheticsNetworkTestResponse from datadog_api_client.v2.model.synthetics_network_test_edit_request import SyntheticsNetworkTestEditRequest +from datadog_api_client.v2.model.synthetics_test_file_download_response import SyntheticsTestFileDownloadResponse +from datadog_api_client.v2.model.synthetics_test_file_download_request import SyntheticsTestFileDownloadRequest +from datadog_api_client.v2.model.synthetics_test_file_multipart_presigned_urls_response import ( + SyntheticsTestFileMultipartPresignedUrlsResponse, +) +from datadog_api_client.v2.model.synthetics_test_file_multipart_presigned_urls_request import ( + SyntheticsTestFileMultipartPresignedUrlsRequest, +) +from datadog_api_client.v2.model.synthetics_test_file_abort_multipart_upload_request import ( + SyntheticsTestFileAbortMultipartUploadRequest, +) +from datadog_api_client.v2.model.synthetics_test_file_complete_multipart_upload_request import ( + SyntheticsTestFileCompleteMultipartUploadRequest, +) from datadog_api_client.v2.model.synthetics_test_parent_suites_response import SyntheticsTestParentSuitesResponse from datadog_api_client.v2.model.synthetics_test_version_history_response import SyntheticsTestVersionHistoryResponse from datadog_api_client.v2.model.synthetics_test_version_response import SyntheticsTestVersionResponse @@ -54,6 +68,58 @@ def __init__(self, api_client=None): api_client = ApiClient(Configuration()) self.api_client = api_client + self._abort_test_file_multipart_upload_endpoint = _Endpoint( + settings={ + "response_type": None, + "auth": ["apiKeyAuth", "appKeyAuth", "AuthZ"], + "endpoint_path": "/api/v2/synthetics/tests/{public_id}/files/multipart-upload-abort", + "operation_id": "abort_test_file_multipart_upload", + "http_method": "POST", + "version": "v2", + }, + params_map={ + "public_id": { + "required": True, + "openapi_types": (str,), + "attribute": "public_id", + "location": "path", + }, + "body": { + "required": True, + "openapi_types": (SyntheticsTestFileAbortMultipartUploadRequest,), + "location": "body", + }, + }, + headers_map={"accept": ["*/*"], "content_type": ["application/json"]}, + api_client=api_client, + ) + + self._complete_test_file_multipart_upload_endpoint = _Endpoint( + settings={ + "response_type": None, + "auth": ["apiKeyAuth", "appKeyAuth", "AuthZ"], + "endpoint_path": "/api/v2/synthetics/tests/{public_id}/files/multipart-upload-complete", + "operation_id": "complete_test_file_multipart_upload", + "http_method": "POST", + "version": "v2", + }, + params_map={ + "public_id": { + "required": True, + "openapi_types": (str,), + "attribute": "public_id", + "location": "path", + }, + "body": { + "required": True, + "openapi_types": (SyntheticsTestFileCompleteMultipartUploadRequest,), + "location": "body", + }, + }, + headers_map={"accept": ["*/*"], "content_type": ["application/json"]}, + api_client=api_client, + ) + self._create_synthetics_network_test_endpoint = _Endpoint( settings={ "response_type": (SyntheticsNetworkTestResponse,), @@ -330,6 +396,58 @@ def __init__(self, api_client=None): api_client=api_client, ) + self._get_test_file_download_url_endpoint = _Endpoint( + settings={ + "response_type": (SyntheticsTestFileDownloadResponse,), + "auth": ["apiKeyAuth", "appKeyAuth", "AuthZ"], + "endpoint_path": "/api/v2/synthetics/tests/{public_id}/files/download", + "operation_id": "get_test_file_download_url", + "http_method": "POST", + "version": "v2", + }, + params_map={ + "public_id": { + "required": True, + "openapi_types": (str,), + "attribute": "public_id", + "location": "path", + }, + "body": { + "required": True, + "openapi_types": (SyntheticsTestFileDownloadRequest,), + "location": "body", + }, + }, + headers_map={"accept": ["application/json"], "content_type": ["application/json"]}, + api_client=api_client, + ) + + self._get_test_file_multipart_presigned_urls_endpoint = _Endpoint( + settings={ + "response_type": (SyntheticsTestFileMultipartPresignedUrlsResponse,), + "auth": ["apiKeyAuth", "appKeyAuth", "AuthZ"], + "endpoint_path": "/api/v2/synthetics/tests/{public_id}/files/multipart-presigned-urls", + "operation_id": "get_test_file_multipart_presigned_urls", + "http_method": "POST", + "version": "v2", + }, + params_map={ + "public_id": { + "required": True, + "openapi_types": (str,), + "attribute": "public_id", + "location": "path", + }, + "body": { + "required": True, + "openapi_types": (SyntheticsTestFileMultipartPresignedUrlsRequest,), + "location": "body", + }, + }, + headers_map={"accept": ["application/json"], "content_type": ["application/json"]}, + api_client=api_client, + ) + self._get_test_parent_suites_endpoint = _Endpoint( settings={ "response_type": (SyntheticsTestParentSuitesResponse,), @@ -529,6 +647,50 @@ def __init__(self, api_client=None): api_client=api_client, ) + def abort_test_file_multipart_upload( + self, + public_id: str, + body: SyntheticsTestFileAbortMultipartUploadRequest, + ) -> None: + """Abort a multipart upload of a test file. + + Abort an in-progress multipart file upload for a Synthetic test. This cancels the upload + and releases any storage used by already-uploaded parts. + + :param public_id: The public ID of the Synthetic test. + :type public_id: str + :type body: SyntheticsTestFileAbortMultipartUploadRequest + :rtype: None + """ + kwargs: Dict[str, Any] = {} + kwargs["public_id"] = public_id + + kwargs["body"] = body + + return self._abort_test_file_multipart_upload_endpoint.call_with_http_info(**kwargs) + + def complete_test_file_multipart_upload( + self, + public_id: str, + body: SyntheticsTestFileCompleteMultipartUploadRequest, + ) -> None: + """Complete a multipart upload of a test file. + + Complete a multipart file upload for a Synthetic test. Call this endpoint after all parts + have been uploaded using the presigned URLs obtained from the multipart presigned URLs endpoint. + + :param public_id: The public ID of the Synthetic test. + :type public_id: str + :type body: SyntheticsTestFileCompleteMultipartUploadRequest + :rtype: None + """ + kwargs: Dict[str, Any] = {} + kwargs["public_id"] = public_id + + kwargs["body"] = body + + return self._complete_test_file_multipart_upload_endpoint.call_with_http_info(**kwargs) + def create_synthetics_network_test( self, body: SyntheticsNetworkTestEditRequest, @@ -734,6 +896,50 @@ def get_synthetics_test_version( return self._get_synthetics_test_version_endpoint.call_with_http_info(**kwargs) + def get_test_file_download_url( + self, + public_id: str, + body: SyntheticsTestFileDownloadRequest, + ) -> SyntheticsTestFileDownloadResponse: + """Get a presigned URL for downloading a test file. + + Get a presigned URL to download a file attached to a Synthetic test. + The returned URL is temporary and expires after a short period. + + :param public_id: The public ID of the Synthetic test. + :type public_id: str + :type body: SyntheticsTestFileDownloadRequest + :rtype: SyntheticsTestFileDownloadResponse + """ + kwargs: Dict[str, Any] = {} + kwargs["public_id"] = public_id + + kwargs["body"] = body + + return self._get_test_file_download_url_endpoint.call_with_http_info(**kwargs) + + def get_test_file_multipart_presigned_urls( + self, + public_id: str, + body: SyntheticsTestFileMultipartPresignedUrlsRequest, + ) -> SyntheticsTestFileMultipartPresignedUrlsResponse: + """Get presigned URLs for uploading a test file. + + Get presigned URLs for uploading a file to a Synthetic test using multipart upload. + Returns the presigned URLs for each part along with the bucket key that references the file. + + :param public_id: The public ID of the Synthetic test. + :type public_id: str + :type body: SyntheticsTestFileMultipartPresignedUrlsRequest + :rtype: SyntheticsTestFileMultipartPresignedUrlsResponse + """ + kwargs: Dict[str, Any] = {} + kwargs["public_id"] = public_id + + kwargs["body"] = body + + return self._get_test_file_multipart_presigned_urls_endpoint.call_with_http_info(**kwargs) + def get_test_parent_suites( self, public_id: str, diff --git a/src/datadog_api_client/v2/model/synthetics_test_file_abort_multipart_upload_request.py b/src/datadog_api_client/v2/model/synthetics_test_file_abort_multipart_upload_request.py new file mode 100644 index 0000000000..7ab5f2a982 --- /dev/null +++ b/src/datadog_api_client/v2/model/synthetics_test_file_abort_multipart_upload_request.py @@ -0,0 +1,39 @@ +# 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, +) + + +class SyntheticsTestFileAbortMultipartUploadRequest(ModelNormal): + @cached_property + def openapi_types(_): + return { + "key": (str,), + "upload_id": (str,), + } + + attribute_map = { + "key": "key", + "upload_id": "uploadId", + } + + def __init__(self_, key: str, upload_id: str, **kwargs): + """ + Request body for aborting a multipart file upload. + + :param key: The full storage path of the file whose upload should be aborted. + :type key: str + + :param upload_id: The upload ID of the multipart upload to abort. + :type upload_id: str + """ + super().__init__(kwargs) + + self_.key = key + self_.upload_id = upload_id diff --git a/src/datadog_api_client/v2/model/synthetics_test_file_complete_multipart_upload_part.py b/src/datadog_api_client/v2/model/synthetics_test_file_complete_multipart_upload_part.py new file mode 100644 index 0000000000..b35fefee26 --- /dev/null +++ b/src/datadog_api_client/v2/model/synthetics_test_file_complete_multipart_upload_part.py @@ -0,0 +1,39 @@ +# 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, +) + + +class SyntheticsTestFileCompleteMultipartUploadPart(ModelNormal): + @cached_property + def openapi_types(_): + return { + "e_tag": (str,), + "part_number": (int,), + } + + attribute_map = { + "e_tag": "ETag", + "part_number": "PartNumber", + } + + def __init__(self_, e_tag: str, part_number: int, **kwargs): + """ + A completed part of a multipart upload. + + :param e_tag: The ETag returned by the storage provider after uploading the part. + :type e_tag: str + + :param part_number: The 1-indexed part number for the multipart upload. + :type part_number: int + """ + super().__init__(kwargs) + + self_.e_tag = e_tag + self_.part_number = part_number diff --git a/src/datadog_api_client/v2/model/synthetics_test_file_complete_multipart_upload_request.py b/src/datadog_api_client/v2/model/synthetics_test_file_complete_multipart_upload_request.py new file mode 100644 index 0000000000..81cdc5d143 --- /dev/null +++ b/src/datadog_api_client/v2/model/synthetics_test_file_complete_multipart_upload_request.py @@ -0,0 +1,56 @@ +# 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 List, TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.synthetics_test_file_complete_multipart_upload_part import ( + SyntheticsTestFileCompleteMultipartUploadPart, + ) + + +class SyntheticsTestFileCompleteMultipartUploadRequest(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.synthetics_test_file_complete_multipart_upload_part import ( + SyntheticsTestFileCompleteMultipartUploadPart, + ) + + return { + "key": (str,), + "parts": ([SyntheticsTestFileCompleteMultipartUploadPart],), + "upload_id": (str,), + } + + attribute_map = { + "key": "key", + "parts": "parts", + "upload_id": "uploadId", + } + + def __init__(self_, key: str, parts: List[SyntheticsTestFileCompleteMultipartUploadPart], upload_id: str, **kwargs): + """ + Request body for completing a multipart file upload. + + :param key: The full storage path for the uploaded file. + :type key: str + + :param parts: Array of completed parts with their ETags. + :type parts: [SyntheticsTestFileCompleteMultipartUploadPart] + + :param upload_id: The upload ID returned when the multipart upload was initiated. + :type upload_id: str + """ + super().__init__(kwargs) + + self_.key = key + self_.parts = parts + self_.upload_id = upload_id diff --git a/src/datadog_api_client/v2/model/synthetics_test_file_download_request.py b/src/datadog_api_client/v2/model/synthetics_test_file_download_request.py new file mode 100644 index 0000000000..7fa894db35 --- /dev/null +++ b/src/datadog_api_client/v2/model/synthetics_test_file_download_request.py @@ -0,0 +1,39 @@ +# 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, +) + + +class SyntheticsTestFileDownloadRequest(ModelNormal): + validations = { + "bucket_key": { + "min_length": 1, + }, + } + + @cached_property + def openapi_types(_): + return { + "bucket_key": (str,), + } + + attribute_map = { + "bucket_key": "bucketKey", + } + + def __init__(self_, bucket_key: str, **kwargs): + """ + Request body for getting a presigned download URL for a test file. + + :param bucket_key: The bucket key referencing the file to download. + :type bucket_key: str + """ + super().__init__(kwargs) + + self_.bucket_key = bucket_key diff --git a/src/datadog_api_client/v2/model/synthetics_test_file_download_response.py b/src/datadog_api_client/v2/model/synthetics_test_file_download_response.py new file mode 100644 index 0000000000..01a52519b8 --- /dev/null +++ b/src/datadog_api_client/v2/model/synthetics_test_file_download_response.py @@ -0,0 +1,36 @@ +# 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 Union + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, + unset, + UnsetType, +) + + +class SyntheticsTestFileDownloadResponse(ModelNormal): + @cached_property + def openapi_types(_): + return { + "url": (str,), + } + + attribute_map = { + "url": "url", + } + + def __init__(self_, url: Union[str, UnsetType] = unset, **kwargs): + """ + Response containing a presigned URL for downloading a test file. + + :param url: A presigned URL to download the file. The URL expires after a short period. + :type url: str, optional + """ + if url is not unset: + kwargs["url"] = url + super().__init__(kwargs) diff --git a/src/datadog_api_client/v2/model/synthetics_test_file_multipart_presigned_urls_params.py b/src/datadog_api_client/v2/model/synthetics_test_file_multipart_presigned_urls_params.py new file mode 100644 index 0000000000..91688b7dff --- /dev/null +++ b/src/datadog_api_client/v2/model/synthetics_test_file_multipart_presigned_urls_params.py @@ -0,0 +1,56 @@ +# 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 Dict, Union + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, + unset, + UnsetType, +) + + +class SyntheticsTestFileMultipartPresignedUrlsParams(ModelNormal): + @cached_property + def openapi_types(_): + return { + "key": (str,), + "upload_id": (str,), + "urls": ({str: (str,)},), + } + + attribute_map = { + "key": "key", + "upload_id": "upload_id", + "urls": "urls", + } + + def __init__( + self_, + key: Union[str, UnsetType] = unset, + upload_id: Union[str, UnsetType] = unset, + urls: Union[Dict[str, str], UnsetType] = unset, + **kwargs, + ): + """ + Presigned URL parameters returned for a multipart upload. + + :param key: The full storage path for the file being uploaded. + :type key: str, optional + + :param upload_id: The upload ID assigned by the storage provider for this multipart upload. + :type upload_id: str, optional + + :param urls: A map of part numbers to presigned upload URLs. + :type urls: {str: (str,)}, optional + """ + if key is not unset: + kwargs["key"] = key + if upload_id is not unset: + kwargs["upload_id"] = upload_id + if urls is not unset: + kwargs["urls"] = urls + super().__init__(kwargs) diff --git a/src/datadog_api_client/v2/model/synthetics_test_file_multipart_presigned_urls_part.py b/src/datadog_api_client/v2/model/synthetics_test_file_multipart_presigned_urls_part.py new file mode 100644 index 0000000000..2a98369665 --- /dev/null +++ b/src/datadog_api_client/v2/model/synthetics_test_file_multipart_presigned_urls_part.py @@ -0,0 +1,46 @@ +# 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, +) + + +class SyntheticsTestFileMultipartPresignedUrlsPart(ModelNormal): + validations = { + "md5": { + "max_length": 24, + "min_length": 22, + }, + } + + @cached_property + def openapi_types(_): + return { + "md5": (str,), + "part_number": (int,), + } + + attribute_map = { + "md5": "md5", + "part_number": "partNumber", + } + + def __init__(self_, md5: str, part_number: int, **kwargs): + """ + A part descriptor for initiating a multipart upload. + + :param md5: Base64-encoded MD5 digest of the part content. + :type md5: str + + :param part_number: The 1-indexed part number for the multipart upload. + :type part_number: int + """ + super().__init__(kwargs) + + self_.md5 = md5 + self_.part_number = part_number diff --git a/src/datadog_api_client/v2/model/synthetics_test_file_multipart_presigned_urls_request.py b/src/datadog_api_client/v2/model/synthetics_test_file_multipart_presigned_urls_request.py new file mode 100644 index 0000000000..f5fca2ce03 --- /dev/null +++ b/src/datadog_api_client/v2/model/synthetics_test_file_multipart_presigned_urls_request.py @@ -0,0 +1,61 @@ +# 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 List, TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.synthetics_test_file_multipart_presigned_urls_request_bucket_key_prefix import ( + SyntheticsTestFileMultipartPresignedUrlsRequestBucketKeyPrefix, + ) + from datadog_api_client.v2.model.synthetics_test_file_multipart_presigned_urls_part import ( + SyntheticsTestFileMultipartPresignedUrlsPart, + ) + + +class SyntheticsTestFileMultipartPresignedUrlsRequest(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.synthetics_test_file_multipart_presigned_urls_request_bucket_key_prefix import ( + SyntheticsTestFileMultipartPresignedUrlsRequestBucketKeyPrefix, + ) + from datadog_api_client.v2.model.synthetics_test_file_multipart_presigned_urls_part import ( + SyntheticsTestFileMultipartPresignedUrlsPart, + ) + + return { + "bucket_key_prefix": (SyntheticsTestFileMultipartPresignedUrlsRequestBucketKeyPrefix,), + "parts": ([SyntheticsTestFileMultipartPresignedUrlsPart],), + } + + attribute_map = { + "bucket_key_prefix": "bucketKeyPrefix", + "parts": "parts", + } + + def __init__( + self_, + bucket_key_prefix: SyntheticsTestFileMultipartPresignedUrlsRequestBucketKeyPrefix, + parts: List[SyntheticsTestFileMultipartPresignedUrlsPart], + **kwargs, + ): + """ + Request body for getting presigned URLs for a multipart file upload. + + :param bucket_key_prefix: The bucket key prefix indicating the type of file upload. + :type bucket_key_prefix: SyntheticsTestFileMultipartPresignedUrlsRequestBucketKeyPrefix + + :param parts: Array of part descriptors for the multipart upload. + :type parts: [SyntheticsTestFileMultipartPresignedUrlsPart] + """ + super().__init__(kwargs) + + self_.bucket_key_prefix = bucket_key_prefix + self_.parts = parts diff --git a/src/datadog_api_client/v2/model/synthetics_test_file_multipart_presigned_urls_request_bucket_key_prefix.py b/src/datadog_api_client/v2/model/synthetics_test_file_multipart_presigned_urls_request_bucket_key_prefix.py new file mode 100644 index 0000000000..8ec3181df4 --- /dev/null +++ b/src/datadog_api_client/v2/model/synthetics_test_file_multipart_presigned_urls_request_bucket_key_prefix.py @@ -0,0 +1,42 @@ +# 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 ( + ModelSimple, + cached_property, +) + +from typing import ClassVar + + +class SyntheticsTestFileMultipartPresignedUrlsRequestBucketKeyPrefix(ModelSimple): + """ + The bucket key prefix indicating the type of file upload. + + :param value: Must be one of ["api-upload-file", "browser-upload-file-step"]. + :type value: str + """ + + allowed_values = { + "api-upload-file", + "browser-upload-file-step", + } + API_UPLOAD_FILE: ClassVar["SyntheticsTestFileMultipartPresignedUrlsRequestBucketKeyPrefix"] + BROWSER_UPLOAD_FILE_STEP: ClassVar["SyntheticsTestFileMultipartPresignedUrlsRequestBucketKeyPrefix"] + + @cached_property + def openapi_types(_): + return { + "value": (str,), + } + + +SyntheticsTestFileMultipartPresignedUrlsRequestBucketKeyPrefix.API_UPLOAD_FILE = ( + SyntheticsTestFileMultipartPresignedUrlsRequestBucketKeyPrefix("api-upload-file") +) +SyntheticsTestFileMultipartPresignedUrlsRequestBucketKeyPrefix.BROWSER_UPLOAD_FILE_STEP = ( + SyntheticsTestFileMultipartPresignedUrlsRequestBucketKeyPrefix("browser-upload-file-step") +) diff --git a/src/datadog_api_client/v2/model/synthetics_test_file_multipart_presigned_urls_response.py b/src/datadog_api_client/v2/model/synthetics_test_file_multipart_presigned_urls_response.py new file mode 100644 index 0000000000..9646a3301e --- /dev/null +++ b/src/datadog_api_client/v2/model/synthetics_test_file_multipart_presigned_urls_response.py @@ -0,0 +1,58 @@ +# 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 Union, TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, + unset, + UnsetType, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.synthetics_test_file_multipart_presigned_urls_params import ( + SyntheticsTestFileMultipartPresignedUrlsParams, + ) + + +class SyntheticsTestFileMultipartPresignedUrlsResponse(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.synthetics_test_file_multipart_presigned_urls_params import ( + SyntheticsTestFileMultipartPresignedUrlsParams, + ) + + return { + "bucket_key": (str,), + "multipart_presigned_urls_params": (SyntheticsTestFileMultipartPresignedUrlsParams,), + } + + attribute_map = { + "bucket_key": "bucketKey", + "multipart_presigned_urls_params": "multipart_presigned_urls_params", + } + + def __init__( + self_, + bucket_key: Union[str, UnsetType] = unset, + multipart_presigned_urls_params: Union[SyntheticsTestFileMultipartPresignedUrlsParams, UnsetType] = unset, + **kwargs, + ): + """ + Response containing presigned URLs for multipart file upload and the bucket key. + + :param bucket_key: The bucket key that references the uploaded file after completion. + :type bucket_key: str, optional + + :param multipart_presigned_urls_params: Presigned URL parameters returned for a multipart upload. + :type multipart_presigned_urls_params: SyntheticsTestFileMultipartPresignedUrlsParams, optional + """ + if bucket_key is not unset: + kwargs["bucket_key"] = bucket_key + if multipart_presigned_urls_params is not unset: + kwargs["multipart_presigned_urls_params"] = multipart_presigned_urls_params + super().__init__(kwargs) diff --git a/src/datadog_api_client/v2/models/__init__.py b/src/datadog_api_client/v2/models/__init__.py index 84b0763668..9aff4b4381 100644 --- a/src/datadog_api_client/v2/models/__init__.py +++ b/src/datadog_api_client/v2/models/__init__.py @@ -6077,6 +6077,32 @@ ) from datadog_api_client.v2.model.synthetics_suite_type import SyntheticsSuiteType from datadog_api_client.v2.model.synthetics_suite_types import SyntheticsSuiteTypes +from datadog_api_client.v2.model.synthetics_test_file_abort_multipart_upload_request import ( + SyntheticsTestFileAbortMultipartUploadRequest, +) +from datadog_api_client.v2.model.synthetics_test_file_complete_multipart_upload_part import ( + SyntheticsTestFileCompleteMultipartUploadPart, +) +from datadog_api_client.v2.model.synthetics_test_file_complete_multipart_upload_request import ( + SyntheticsTestFileCompleteMultipartUploadRequest, +) +from datadog_api_client.v2.model.synthetics_test_file_download_request import SyntheticsTestFileDownloadRequest +from datadog_api_client.v2.model.synthetics_test_file_download_response import SyntheticsTestFileDownloadResponse +from datadog_api_client.v2.model.synthetics_test_file_multipart_presigned_urls_params import ( + SyntheticsTestFileMultipartPresignedUrlsParams, +) +from datadog_api_client.v2.model.synthetics_test_file_multipart_presigned_urls_part import ( + SyntheticsTestFileMultipartPresignedUrlsPart, +) +from datadog_api_client.v2.model.synthetics_test_file_multipart_presigned_urls_request import ( + SyntheticsTestFileMultipartPresignedUrlsRequest, +) +from datadog_api_client.v2.model.synthetics_test_file_multipart_presigned_urls_request_bucket_key_prefix import ( + SyntheticsTestFileMultipartPresignedUrlsRequestBucketKeyPrefix, +) +from datadog_api_client.v2.model.synthetics_test_file_multipart_presigned_urls_response import ( + SyntheticsTestFileMultipartPresignedUrlsResponse, +) from datadog_api_client.v2.model.synthetics_test_options import SyntheticsTestOptions from datadog_api_client.v2.model.synthetics_test_options_monitor_options import SyntheticsTestOptionsMonitorOptions from datadog_api_client.v2.model.synthetics_test_options_monitor_options_notification_preset_name import ( @@ -10956,6 +10982,16 @@ "SyntheticsSuiteTestAlertingCriticality", "SyntheticsSuiteType", "SyntheticsSuiteTypes", + "SyntheticsTestFileAbortMultipartUploadRequest", + "SyntheticsTestFileCompleteMultipartUploadPart", + "SyntheticsTestFileCompleteMultipartUploadRequest", + "SyntheticsTestFileDownloadRequest", + "SyntheticsTestFileDownloadResponse", + "SyntheticsTestFileMultipartPresignedUrlsParams", + "SyntheticsTestFileMultipartPresignedUrlsPart", + "SyntheticsTestFileMultipartPresignedUrlsRequest", + "SyntheticsTestFileMultipartPresignedUrlsRequestBucketKeyPrefix", + "SyntheticsTestFileMultipartPresignedUrlsResponse", "SyntheticsTestOptions", "SyntheticsTestOptionsMonitorOptions", "SyntheticsTestOptionsMonitorOptionsNotificationPresetName", diff --git a/tests/v2/features/synthetics.feature b/tests/v2/features/synthetics.feature index 8ed9b98adf..2cdf9231fb 100644 --- a/tests/v2/features/synthetics.feature +++ b/tests/v2/features/synthetics.feature @@ -17,6 +17,22 @@ Feature: Synthetics And a valid "appKeyAuth" key in the system And an instance of "Synthetics" API + @generated @skip @team:DataDog/synthetics-managing + Scenario: Abort a multipart upload of a test file returns "API error response." response + Given new "AbortTestFileMultipartUpload" request + And request contains "public_id" parameter from "REPLACE.ME" + And body with value {"key": "org-123/api-upload-file/abc-def-123/2024-01-01T00:00:00_uuid.json", "uploadId": "upload-id-abc123"} + When the request is sent + Then the response status is 404 API error response. + + @generated @skip @team:DataDog/synthetics-managing + Scenario: Abort a multipart upload of a test file returns "No Content" response + Given new "AbortTestFileMultipartUpload" request + And request contains "public_id" parameter from "REPLACE.ME" + And body with value {"key": "org-123/api-upload-file/abc-def-123/2024-01-01T00:00:00_uuid.json", "uploadId": "upload-id-abc123"} + When the request is sent + Then the response status is 204 No Content + @generated @skip @team:DataDog/synthetics-managing Scenario: Bulk delete suites returns "API error response." response Given new "DeleteSyntheticsSuites" request @@ -45,6 +61,22 @@ Feature: Synthetics When the request is sent Then the response status is 200 OK + @generated @skip @team:DataDog/synthetics-managing + Scenario: Complete a multipart upload of a test file returns "API error response." response + Given new "CompleteTestFileMultipartUpload" request + And request contains "public_id" parameter from "REPLACE.ME" + And body with value {"key": "org-123/api-upload-file/abc-def-123/2024-01-01T00:00:00_uuid.json", "parts": [{"ETag": "\"d41d8cd98f00b204e9800998ecf8427e\"", "PartNumber": 1}], "uploadId": "upload-id-abc123"} + When the request is sent + Then the response status is 404 API error response. + + @generated @skip @team:DataDog/synthetics-managing + Scenario: Complete a multipart upload of a test file returns "No Content" response + Given new "CompleteTestFileMultipartUpload" request + And request contains "public_id" parameter from "REPLACE.ME" + And body with value {"key": "org-123/api-upload-file/abc-def-123/2024-01-01T00:00:00_uuid.json", "parts": [{"ETag": "\"d41d8cd98f00b204e9800998ecf8427e\"", "PartNumber": 1}], "uploadId": "upload-id-abc123"} + When the request is sent + Then the response status is 204 No Content + @generated @skip @team:DataDog/synthetics-managing Scenario: Create a Network Path test returns "API error response." response Given new "CreateSyntheticsNetworkTest" request @@ -133,6 +165,22 @@ Feature: Synthetics When the request is sent Then the response status is 200 OK + @generated @skip @team:DataDog/synthetics-managing + Scenario: Get a presigned URL for downloading a test file returns "API error response." response + Given new "GetTestFileDownloadUrl" request + And request contains "public_id" parameter from "REPLACE.ME" + And body with value {"bucketKey": "api-upload-file/abc-def-123/2024-01-01T00:00:00_uuid.json"} + When the request is sent + Then the response status is 404 API error response. + + @generated @skip @team:DataDog/synthetics-managing + Scenario: Get a presigned URL for downloading a test file returns "OK" response + Given new "GetTestFileDownloadUrl" request + And request contains "public_id" parameter from "REPLACE.ME" + And body with value {"bucketKey": "api-upload-file/abc-def-123/2024-01-01T00:00:00_uuid.json"} + When the request is sent + Then the response status is 200 OK + @generated @skip @team:DataDog/synthetics-managing Scenario: Get a specific version of a test returns "API error response." response Given new "GetSyntheticsTestVersion" request @@ -198,6 +246,22 @@ Feature: Synthetics When the request is sent Then the response status is 200 OK + @generated @skip @team:DataDog/synthetics-managing + Scenario: Get presigned URLs for uploading a test file returns "API error response." response + Given new "GetTestFileMultipartPresignedUrls" request + And request contains "public_id" parameter from "REPLACE.ME" + And body with value {"bucketKeyPrefix": "api-upload-file", "parts": [{"md5": "1B2M2Y8AsgTpgAmY7PhCfg==", "partNumber": 1}]} + When the request is sent + Then the response status is 404 API error response. + + @generated @skip @team:DataDog/synthetics-managing + Scenario: Get presigned URLs for uploading a test file returns "OK" response + Given new "GetTestFileMultipartPresignedUrls" request + And request contains "public_id" parameter from "REPLACE.ME" + And body with value {"bucketKeyPrefix": "api-upload-file", "parts": [{"md5": "1B2M2Y8AsgTpgAmY7PhCfg==", "partNumber": 1}]} + When the request is sent + Then the response status is 200 OK + @team:DataDog/synthetics-managing Scenario: Get the on-demand concurrency cap returns "OK" response Given new "GetOnDemandConcurrencyCap" request diff --git a/tests/v2/features/undo.json b/tests/v2/features/undo.json index dcdc0219f9..29b9dc1ab2 100644 --- a/tests/v2/features/undo.json +++ b/tests/v2/features/undo.json @@ -5913,6 +5913,30 @@ "type": "idempotent" } }, + "GetTestFileDownloadUrl": { + "tag": "Synthetics", + "undo": { + "type": "safe" + } + }, + "GetTestFileMultipartPresignedUrls": { + "tag": "Synthetics", + "undo": { + "type": "safe" + } + }, + "AbortTestFileMultipartUpload": { + "tag": "Synthetics", + "undo": { + "type": "safe" + } + }, + "CompleteTestFileMultipartUpload": { + "tag": "Synthetics", + "undo": { + "type": "safe" + } + }, "GetTestParentSuites": { "tag": "Synthetics", "undo": {