For AI agents: A markdown version of this page is available at https://dnd37xeb23o8n.cloudfront.net/jen.gilbert/astro-base/ko/api/latest/synthetics/get-presigned-urls-for-uploading-a-test-file.md. A documentation index is available at /llms.txt.
Language
Datadog site

테스트 파일 업로드를 위한 사전 서명된 URL 가져오기

POSThttps://api.datadoghq.com/api/v2/synthetics/tests/{public_id}/files/multipart-presigned-urlshttps://api.us3.datadoghq.com/api/v2/synthetics/tests/{public_id}/files/multipart-presigned-urlshttps://api.us5.datadoghq.com/api/v2/synthetics/tests/{public_id}/files/multipart-presigned-urlshttps://api.datadoghq.eu/api/v2/synthetics/tests/{public_id}/files/multipart-presigned-urlshttps://api.ap1.datadoghq.com/api/v2/synthetics/tests/{public_id}/files/multipart-presigned-urlshttps://api.ap2.datadoghq.com/api/v2/synthetics/tests/{public_id}/files/multipart-presigned-urlshttps://api.uk1.datadoghq.com/api/v2/synthetics/tests/{public_id}/files/multipart-presigned-urlshttps://api.ddog-gov.com/api/v2/synthetics/tests/{public_id}/files/multipart-presigned-urlshttps://api.us2.ddog-gov.com/api/v2/synthetics/tests/{public_id}/files/multipart-presigned-urls

개요

멀티파트 업로드를 사용하여 Synthetic 테스트에 파일을 업로드하기 위한 사전 서명된 URL을 가져옵니다. 파일을 참조하는 버킷 키와 함께 각 파트에 대한 사전 서명된 URL을 반환합니다.

This endpoint requires any of the following permissions:

  • synthetics_write
  • synthetics_create_edit_trigger

OAuth apps require the synthetics_write authorization scope to access this endpoint.

인수

경로 파라미터

이름
유형
설명
public_id [required]
string

The public ID of the Synthetic test.

요청

Body Data (required)

항목
유형
설명
bucketKeyPrefix [required]
enum

멀티파트 파일 업로드를 위한 사전 서명된 URL을 가져오기 위한 요청 본문입니다.

Allowed enum values: api-upload-file, browser-upload-file-step
parts [required]
[object]

Array of part descriptors for the multipart upload.

응답

OK

Response containing presigned URLs for multipart file upload and the bucket key.

항목
유형
설명
bucketKey
string

The bucket key that references the uploaded file after completion.

multipart_presigned_urls_params
object

Presigned URL parameters returned for a multipart upload.

코드 예시

테스트 파일 업로드를 위한 사전 서명된 URL 가져오기
# Path parameters
export public_id="abc-def-123"

# Set your Datadog site and credentials
export DD_SITE="datadoghq.com"
# Use a Personal Access Token or Service Access Token
export DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>"

curl -X POST "https://api.${DD_SITE}/api/v2/synthetics/tests/${public_id}/files/multipart-presigned-urls" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
  "bucketKeyPrefix": "api-upload-file",
  "parts": [
    {
      "md5": "1B2M2Y8AsgTpgAmY7PhCfg==",
      "partNumber": 1
    }
  ]
}
EOF
# Path parameters
export public_id="abc-def-123"

# Set your Datadog site and credentials
export DD_SITE="us3.datadoghq.com"
# Use a Personal Access Token or Service Access Token
export DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>"

curl -X POST "https://api.${DD_SITE}/api/v2/synthetics/tests/${public_id}/files/multipart-presigned-urls" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
  "bucketKeyPrefix": "api-upload-file",
  "parts": [
    {
      "md5": "1B2M2Y8AsgTpgAmY7PhCfg==",
      "partNumber": 1
    }
  ]
}
EOF
# Path parameters
export public_id="abc-def-123"

# Set your Datadog site and credentials
export DD_SITE="us5.datadoghq.com"
# Use a Personal Access Token or Service Access Token
export DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>"

curl -X POST "https://api.${DD_SITE}/api/v2/synthetics/tests/${public_id}/files/multipart-presigned-urls" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
  "bucketKeyPrefix": "api-upload-file",
  "parts": [
    {
      "md5": "1B2M2Y8AsgTpgAmY7PhCfg==",
      "partNumber": 1
    }
  ]
}
EOF
# Path parameters
export public_id="abc-def-123"

# Set your Datadog site and credentials
export DD_SITE="datadoghq.eu"
# Use a Personal Access Token or Service Access Token
export DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>"

curl -X POST "https://api.${DD_SITE}/api/v2/synthetics/tests/${public_id}/files/multipart-presigned-urls" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
  "bucketKeyPrefix": "api-upload-file",
  "parts": [
    {
      "md5": "1B2M2Y8AsgTpgAmY7PhCfg==",
      "partNumber": 1
    }
  ]
}
EOF
# Path parameters
export public_id="abc-def-123"

# Set your Datadog site and credentials
export DD_SITE="ap1.datadoghq.com"
# Use a Personal Access Token or Service Access Token
export DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>"

curl -X POST "https://api.${DD_SITE}/api/v2/synthetics/tests/${public_id}/files/multipart-presigned-urls" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
  "bucketKeyPrefix": "api-upload-file",
  "parts": [
    {
      "md5": "1B2M2Y8AsgTpgAmY7PhCfg==",
      "partNumber": 1
    }
  ]
}
EOF
# Path parameters
export public_id="abc-def-123"

# Set your Datadog site and credentials
export DD_SITE="ap2.datadoghq.com"
# Use a Personal Access Token or Service Access Token
export DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>"

curl -X POST "https://api.${DD_SITE}/api/v2/synthetics/tests/${public_id}/files/multipart-presigned-urls" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
  "bucketKeyPrefix": "api-upload-file",
  "parts": [
    {
      "md5": "1B2M2Y8AsgTpgAmY7PhCfg==",
      "partNumber": 1
    }
  ]
}
EOF
# Path parameters
export public_id="abc-def-123"

# Set your Datadog site and credentials
export DD_SITE="uk1.datadoghq.com"
# Use a Personal Access Token or Service Access Token
export DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>"

curl -X POST "https://api.${DD_SITE}/api/v2/synthetics/tests/${public_id}/files/multipart-presigned-urls" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
  "bucketKeyPrefix": "api-upload-file",
  "parts": [
    {
      "md5": "1B2M2Y8AsgTpgAmY7PhCfg==",
      "partNumber": 1
    }
  ]
}
EOF
# Path parameters
export public_id="abc-def-123"

# Set your Datadog site and credentials
export DD_SITE="ddog-gov.com"
# Use a Personal Access Token or Service Access Token
export DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>"

curl -X POST "https://api.${DD_SITE}/api/v2/synthetics/tests/${public_id}/files/multipart-presigned-urls" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
  "bucketKeyPrefix": "api-upload-file",
  "parts": [
    {
      "md5": "1B2M2Y8AsgTpgAmY7PhCfg==",
      "partNumber": 1
    }
  ]
}
EOF
# Path parameters
export public_id="abc-def-123"

# Set your Datadog site and credentials
export DD_SITE="us2.ddog-gov.com"
# Use a Personal Access Token or Service Access Token
export DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>"

curl -X POST "https://api.${DD_SITE}/api/v2/synthetics/tests/${public_id}/files/multipart-presigned-urls" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
  "bucketKeyPrefix": "api-upload-file",
  "parts": [
    {
      "md5": "1B2M2Y8AsgTpgAmY7PhCfg==",
      "partNumber": 1
    }
  ]
}
EOF