콘텐츠로 이동

생성



POST /api/v1/dashboard/add

개요

새로운 사용자 뷰 생성

Body 요청 매개변수

매개변수명 유형 필수 설명
sourceDashboardUUID string 소스 뷰 UUID
빈 값 허용: False
빈 문자열 허용: True
최대 길이: 128
name string Y 뷰 이름
빈 값 허용: False
최대 길이: 256
desc string 설명
예시: 설명1
빈 값 허용: False
최대 길이: 2048
recoverIdentifier boolean 중복된 식별 id/이름 관련 객체를 덮어쓸지 여부. false-중복 그룹만 반환, true-중복 그룹의 관련 객체를 삭제한 후 계속 생성
빈 값 허용: False
identifier string 식별 id --2024.12.25 식별 id 추가
예시: xxxx
빈 값 허용: False
빈 문자열 허용: True
최대 길이: 128
templateInfos json 사용자 정의 템플릿 데이터
예시: {}
빈 값 허용: False
빈 문자열 허용: False
dashboardBidding json 매핑, 기본값 {}
예시: {}
빈 값 허용: False
specifyDashboardUUID string 새로 생성할 대시보드의 uuid 지정, dsbd_custom_ 접두사 뒤에 32자리 소문자 영숫자로 구성
예시: dsbd_custom_xxxx32
빈 값 허용: False
빈 문자열 허용: False
$matchRegExp: ^dsbd_custom_[a-z0-9]{32}$

매개변수 추가 설명

1. API 동작

API는 먼저 생성할 뷰의 이름과 식별 ID 충돌을 확인하며, 충돌 결과는 다음 세 가지 유형으로 반환됩니다.

  • name_and_identifier: 이름과 식별 ID가 모두 중복됨
  • identifier: 식별 ID만 중복됨
  • name: 이름만 중복됨

recoverIdentifier=false 또는 전달하지 않을 경우: - 뷰를 생성하지 않음 - repeatInfo를 직접 반환

recoverIdentifier=true일 경우: - 위 세 가지 중복 그룹에서 일치하는 관련 뷰를 삭제 - 그런 다음 새 뷰를 계속 생성


2. 응답 예시

2.1 생성 성공

{
  "uuid": "dsbd_xxxx32",
  "name": "001Bind Built-in View"
}

2.2 중복 존재, 중복 그룹 반환

{
  "repeatInfo": {
    "name_and_identifier": [
      {
        "name": "시스템 개요",
        "identifier": "system_overview",
        "importName": "시스템 개요",
        "importIdentifier": "system_overview",
        "existName": "시스템 개요",
        "existIdentifier": "system_overview",
        "conflictUUIDs": ["dsbd_xxxx01"]
      }
    ],
    "identifier": [],
    "name": []
  }
}

3. 요청 본문 구조 설명

요청 본문 구조 설명

매개변수명 type 설명
name string 이름
desc string 설명
identifier string 식별 id --2024.12.25 추가
recoverIdentifier boolean 중복 그룹의 관련 뷰를 삭제하고 계속 생성할지 여부
dashboardBidding dict 대시보드 바인딩 정보
sourceDashboardUUID string 대시보드 또는 내장 사용자 뷰를 복제할 UUID
templateInfos dict 내장 시스템 뷰를 복제할 템플릿 정보

내장 뷰 필드 dashboardBidding 설명

내부적으로 op 값 in/wildcard 지원

dashboardBidding 필드 예시:

{
    "service": [
        {
            "value": [
                "*"
            ],
            "op": "in"
        }
    ],
    "app_id": [
        {
            "value": [
                "test0"
            ],
            "op": "wildcard"
        }
    ],
    "label": [
        {
            "value": [
                "삭제 금지"
            ],
            "op": "in"
        }
    ]
}

요청 예시

curl 'https://openapi.guance.com/api/v1/dashboard/add' \
-H 'DF-API-KEY: <DF-API-KEY>' \
-H 'Accept-Language: zh' \
-H 'Content-Type: application/json;charset=UTF-8' \
-H 'Accept: application/json, text/plain, */*' \
--data-raw '{"name":"001Bind Built-in View","dashboardBidding":{"service":[{"value":["*"],"op":"in"}],"app_id":[{"value":["test0"],"op":"wildcard"}],"label":[{"value":["Do Not Delete"],"op":"in"}]}}' \
--compressed

응답

{
    "code": 200,
    "content": {
        "chartGroupPos": [],
        "chartPos": [],
        "createAt": 1713513331,
        "createdWay": "manual",
        "creator": "wsak_xxxx32",
        "identifier": "",
        "dashboardBidding": {
            "app_id": [
                {
                    "op": "wildcard",
                    "value": [
                        "test0"
                    ]
                }
            ],
            "label": [
                {
                    "op": "in",
                    "value": [
                        "Do Not Delete"
                    ]
                }
            ],
            "service": [
                {
                    "op": "in",
                    "value": [
                        "*"
                    ]
                }
            ]
        },
        "dashboardBindSet": [],
        "declaration": {
            "b": [
                "asfawfgajfasfafgafwba",
                "asfgahjfaf"
            ],
            "business": "aaa",
            "organization": "64fe7b4062f74d0007b46676"
        },
        "deleteAt": -1,
        "desc": "",
        "extend": {},
        "iconSet": {},
        "id": 5091,
        "isPublic": 1,
        "mapping": [],
        "name": "001Bind Built-in View",
        "ownerType": "inner",
        "status": 0,
        "type": "CUSTOM",
        "updateAt": 1713513331,
        "updator": "wsak_xxxx32",
        "uuid": "dsbd_xxxx32",
        "workspaceUUID": "wksp_xxxx32"
    },
    "errorCode": "",
    "message": "",
    "success": true,
    "traceId": "TRACE-2FB0228E-1660-4557-AF7B-688176108C28"
}

문서 평가

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