콘텐츠로 이동

워크스페이스 리소스 가져오기



POST /api/v1/workspace/resource/upload

개요

워크스페이스 리소스 압축 파일을 업로드하고 가져오기를 시작합니다.

매개변수 추가 설명

1. API 용도

워크스페이스 리소스 압축 파일을 업로드하고 가져오기 작업을 시작합니다.

이 API는 비동기 작업 API입니다. 중복 충돌이 없으면 taskId를 반환하고, 중복 충돌이 있으면 작업을 생성하지 않고 중복 정보를 직접 반환합니다.


2. 요청 유형

요청 유형은 multipart/form-data입니다.

필수 파일 필드: - files


3. 권장 호출 흐름

  1. 먼저 resource.zip을 업로드하고 각 리소스의 충돌 처리 매개변수를 함께 전송합니다.
  2. taskId가 반환되면 작업이 생성된 것이므로 상태 API를 계속 폴링할 수 있습니다.
  3. repeat_name / repeat_identifier가 반환되면 중복이 있는 것이므로 가져오기 전략을 조정한 후 다시 제출해야 합니다.

4. 응답 분기 설명

4.1 직접 가져오기 가능

{
  "taskId": "task_xxx"
}

4.2 중복 존재, 호출자 확인 필요

{
  "repeat_name": {
    "checker": ["CPU 사용률 알림"],
    "tag": ["0306"]
  },
  "repeat_identifier": {
    "dashboard": [
      {
        "identifier": "system_overview",
        "existName": "시스템 개요",
        "importName": "시스템 개요 V2"
      }
    ]
  },
  "repeat_conflict": {
    "dashboard": {
      "name_and_identifier": [
        {
          "name": "CPU 모니터링 뷰",
          "identifier": "123",
          "fileName": "dashboard/CPU 모니터링 뷰.json",
          "existName": "CPU 모니터링 뷰",
          "importName": "CPU 모니터링 뷰"
        }
      ],
      "identifier": [],
      "name": []
    }
  }
}

5. 각 충돌 처리 매개변수 설명

5.1 모니터

  • repeatNameOp
  • 적용 리소스: 모니터
  • 허용 값: check / skip / recover / continue

5.2 대시보드 및 탐색기 식별자 ID

  • repeatIdentifierOp
  • 적용 리소스: 대시보드, 탐색기
  • 허용 값: check / skip / recover

5.3 대시보드 및 탐색기의 세 가지 충돌 그룹

대시보드와 탐색기는 이름과 식별자 ID를 동시에 감지하여 다음 세 가지 그룹으로 반환합니다:

  • name_and_identifier: 이름과 식별자 ID가 동시에 충돌
  • identifier: 식별자 ID만 충돌
  • name: 이름만 충돌

해당 처리 매개변수:

  • repeatDashboardNameAndIdentifierOp
  • repeatDashboardIdentifierOp
  • repeatDashboardNameOp
  • repeatViewerNameAndIdentifierOp
  • repeatViewerIdentifierOp
  • repeatViewerNameOp

위 매개변수는 모두 check / skip / recover만 지원하며, skiprecover는 그룹 단위로 적용됩니다.

5.4 기타 신규 리소스 이름 중복 처리

다음 매개변수는 모두 다음 값만 지원합니다: - check - skip - recover

포함 항목: - repeatNotifyObjectNameOp - repeatAlertPolicyNameOp - repeatLogBackupCfgNameOp - repeatSloNameOp - repeatSecurityRuleNameOp - repeatFieldNameOp - repeatLabelNameOp - repeatEnvVariableNameOp - repeatRoleNameOp - repeatLogIndexNameOp - repeatBlacklistNameOp - repeatPipelineNameOp - repeatRegularExpressionNameOp - repeatFieldDisplayPermissionNameOp - repeatSensitiveDataScannerNameOp


6. 현재 리소스 경계 설명

현재 워크스페이스 리소스 가져오기 및 내보내기에는 다음과 같은 경계가 있습니다:

  1. 환경 변수에 scope=rum이 포함되지 않습니다.
  2. 로그 인덱스에 외부 인덱스와 default가 포함되지 않습니다.
  3. 필드 관리는 워크스페이스 사용자 정의 필드만 처리합니다.
  4. 데이터 액세스는 현재 워크스페이스 가져오기 및 내보내기를 지원하지 않습니다.

7. 호환성 설명

가져오기 시 압축 파일에 현재 지원되지 않거나 무시된 특수 데이터가 포함된 경우 시스템은 현재 구현 규칙에 따라 건너뛰기 또는 실패 처리를 수행합니다. 실제 결과는 작업 상태 API 응답을 기준으로 하십시오.

요청 예시

curl 'https://openapi.guance.com/api/v1/workspace/resource/upload' \
-H 'DF-API-KEY: <DF-API-KEY>' \
-F 'files=@guance.com' \
-F 'repeatNameOp=check' \
-F 'repeatIdentifierOp=check' \
--compressed

응답

{
    "code": 200,
    "content": {
        "taskId": "task_xxx"
    },
    "errorCode": "",
    "message": "",
    "success": true,
    "traceId": "TRACE-XXXX"
}

문서 평가

이 페이지가 도움이 되었나요?