콘텐츠로 이동

Dock 바꾸기

PUT
/api/v1/stations/{station_id}/dock
curl --request PUT \
--url https://dev.api.endueos.com/api/v1/stations/stn_01J9ZK3Q8M4XW7D2N5R6T0V1BC/dock \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{ "items": [ { "type": "device", "device_id": "res_01J9ZK3Q8M4XW7D2N5R6T0V1BC" }, { "type": "app", "app_id": "app_01J9ZK3Q8M4XW7D2N5R6T0V1BC" } ] }'

Dock 1단을 통째로 바꾼다 — 순서 바꾸기·넣기·빼기가 모두 이것이다. 빼도 Device·앱은 지워지지 않는다 (앱은 2단에 남는다).

가이드 — Dock 과 앱

station_id
필수
string
/^stn_[0-9A-HJKMNP-TV-Z]{26}$/
예시
stn_01J9ZK3Q8M4XW7D2N5R6T0V1BC
Media typeapplication/json
object
items
필수

이 순서로 Dock 을 바꾼다. 30개까지. 없는·남의 항목이나 같은 항목이 두 번 있으면 422 DOCK_ITEM_INVALID.

Array
<= 30 items
Any of:
object
type
필수
string
허용 값: device
device_id
필수

Device 의 id — Resource 와 같은 res_ 다 (v0.1.0 이 이미 냈다).

string
/^res_[0-9A-HJKMNP-TV-Z]{26}$/
예시
{
"items": [
{
"type": "device",
"device_id": "res_01J9ZK3Q8M4XW7D2N5R6T0V1BC"
},
{
"type": "app",
"app_id": "app_01J9ZK3Q8M4XW7D2N5R6T0V1BC"
}
]
}

성공.

Media typeapplication/json
object
data
필수

Dock 의 1단 — 실행 진입점의 목록. 순서가 곧 화면의 순서다. Device 와 1단에 고정한 앱을 담는다 (파일·활동·설정 칸은 화면이 그린다). Dock 은 2단이다. 1단의 Device 를 누르면 그 Device 의 저장한 앱 전부가 2단으로 펼쳐진다 (GET /devices/{device_id}/apps). Device 를 만들면 끝에 붙는다 — virtual 은 pin_to_dock(기본 true), actual 은 등록할 때.

object
station_id
필수
string
/^stn_[0-9A-HJKMNP-TV-Z]{26}$/
items
필수
Array<object>
object
type
필수
string
허용 값: device app
device_id
필수

device 면 그 Device, app 이면 그 앱이 있는 Device.

string
/^res_[0-9A-HJKMNP-TV-Z]{26}$/
app_id
필수
Any of:
string
/^app_[0-9A-HJKMNP-TV-Z]{26}$/
label
필수

화면에 쓰는 이름 — Device 이름 또는 앱 이름.

string
kind
필수

그 Device 의 kind. 화면이 기본 아이콘을 고르는 데 쓴다.

string
허용 값: chrome mac android linux windows
device_type
필수
string
허용 값: actual virtual
compute_status
필수
Any of:

Virtual Device 의 컴퓨트 상태. actual 이면 compute_status 가 null 이다.

string
허용 값: provisioning starting running stopping stopped failed deleting
online
필수

그 Device 가 온라인인지.

boolean
icon_data_url
필수
Any of:
string
updated_at
필수
string format: date-time
meta
필수
object
request_id
필수
string
timestamp
필수
string format: date-time
duration

서버 처리 시간(ms).

integer format: int32
예시
{
"data": {
"station_id": "stn_01J9ZK3Q8M4XW7D2N5R6T0V1BC",
"items": [
{
"type": "device",
"device_id": "res_01J9ZK3Q8M4XW7D2N5R6T0V1BC",
"app_id": "app_01J9ZK3Q8M4XW7D2N5R6T0V1BC",
"kind": "chrome",
"device_type": "actual",
"compute_status": "provisioning"
}
]
}
}

요청 형식이 틀렸다 — VALIDATION_ERROR(details.errors[]) 또는 BAD_REQUEST. 본문은 오류 봉투.

인증이 없거나 무효다 — UNAUTHORIZED. 본문은 오류 봉투.

없거나 내 것이 아니다 — *_NOT_FOUND. 본문은 오류 봉투.

형식은 맞지만 할 수 없다 — 코드는 위 설명을 본다. 본문은 오류 봉투.

한도를 넘었다 — Retry-After 초 뒤에 다시. 본문은 오류 봉투.

서버 오류 — INTERNAL_ERROR. 본문은 오류 봉투.

의존 서비스에 닿지 못했다 — 잠시 뒤 다시. 본문은 오류 봉투.