중요: Unity 클라우드 콘텐츠 딜리버리 기술 자료가 docs.unity.com으로 이동되었습니다. Unity CCD에 대한 최신 정보를 보려면 새 사이트를 방문하십시오. |
이 섹션에는 커맨드 라인 인터페이스(CLI)를 통해 클라우드 콘텐츠 제공(CCD)을 사용하는 방법에 대한 전체 예제가 나와 있습니다. 여기에는 다음의 주제가 포함됩니다.
API 키를 사용하여 서비스에 로그인합니다. API 키를 찾는 데 도움이 필요하면 시작하기 섹션을 참조하십시오.
$ ucd auth login XXXXXXXXXXXX
Login successful.
auth info
커맨드를 사용하여 로그인 여부를 확인합니다.
$ ucd auth info
Current user: Joe Smith
첫 번째 버킷을 생성합니다. 버킷은 단일 프로젝트와 연결되어 있습니다. 이 예제의 프로젝트 ID는 e1942cea-12df-4220-aa6d-f8c9c3ab7526
이지만, 실제 프로젝트 ID 중 하나를 사용해야 합니다. 프로젝트 ID를 찾는 데 도움이 필요하면 시작하기 섹션을 참조하십시오.
이 프로젝트의 버킷(이 시점에는 비어 있어야 함)을 나열합니다.
$ ucd buckets list e1942cea-12df-4220-aa6d-f8c9c3ab7526
No buckets found for project.
이 프로젝트에 대해 example_bucket
이라는 이름의 버킷을 생성합니다.
$ ucd buckets create e1942cea-12df-4220-aa6d-f8c9c3ab7526 example_bucket
Created bucket: example_bucket (aee9ee5f-fa01-46d3-a293-731d15f066cf)
버킷 및 항목 이름은 대소문자를 구분합니다.
새로 생성된 버킷을 확인하기 위해 이 프로젝트에 대한 버킷을 다시 나열합니다.
$ ucd buckets list e1942cea-12df-4220-aa6d-f8c9c3ab7526
Buckets for project (e1942cea-12df-4220-aa6d-f8c9c3ab7526):
- example_bucket (aee9ee5f-fa01-46d3-a293-731d15f066cf)
항목 및 릴리스 생성 작업을 좀더 용이하게 수행하려면 새로 생성된 버킷을 로컬 설정에 저장합니다(모든 작업에 대해 CLI에 파라미터로 제공하지 않음). 위의 버킷 생성 메시지(이 예제의 경우 aee9ee5f-fa01-46d3-a293-731d15f066cf
)에서 버킷의 GUID를 복사합니다.
$ ucd config set bucket aee9ee5f-fa01-46d3-a293-731d15f066cf
Successfully switched to bucket aee9ee5f-fa01-46d3-a293-731d15f066cf.
Currently active project: e1942cea-12df-4220-aa6d-f8c9c3ab7526.
Currently active bucket: aee9ee5f-fa01-46d3-a293-731d15f066cf (example_bucket).
CCD는 지정된 버킷의 항목 및 릴리스와 관련된 모든 커맨드를 자동으로 수행합니다.
새로 생성된 버킷(비어 있어야 함)의 항목을 나열합니다.
$ ucd entries list
No Entries found for current bucket.
생성된 에셋 번들이 포함된 로컬 폴더의 모든 파일을 동기화합니다.
$ ucd entries sync ./ServerData/StandaloneOSX
Calculating...
Added Entry: catalog_2019.07.30.18.24.34.hash
Added Entry: catalog_2019.07.30.18.24.34.json
Added Entry: remotedemodata_green.bundle
Added Entry: remotedemodata_mat1.bundle
Added Entry: remotedemodata_sphere.bundle
Added Entry: remotedemodata_unitylogo.bundle
Added Entry: remotedemodata_unitylogoprefab.bundle
Added Entry: remotedemodata_scenes_scene2.bundle
Added Entry: remotedemodata_scenes_scene.bundle
Added Entry: spaceshooterdata_done_asteroid01.bundle
Added Entry: spaceshooterdata_done_asteroid02.bundle
Added Entry: spaceshooterdata_done_asteroid03.bundle
Added Entry: spaceshooterdata_done_bolt-enemy.bundle
Added Entry: spaceshooterdata_done_bolt.bundle
Added Entry: spaceshooterdata_done_enemyship.bundle
Added Entry: spaceshooterdata_done_player.bundle
Added Entry: spaceshooterdata_engines_enemy.bundle
Added Entry: spaceshooterdata_engines_player.bundle
Added Entry: spaceshooterdata_explosion_asteroid.bundle
Added Entry: spaceshooterdata_explosion_enemy.bundle
Added Entry: spaceshooterdata_explosion_player.bundle
Added Entry: spaceshooterdata_starfield.bundle
Complete! Bytes uploaded: 5346781
그러면 파일이 버킷에 항목으로 추가됩니다. 버킷의 콘텐츠를 나열하고 각 항목에 대한 몇 가지 기본 정보를 확인할 수 있습니다.
$ ucd entries list
22 entries for current bucket (aee9ee5f-fa01-46d3-a293-731d15f066cf):
2019-08-21 14:27:03 167915 spaceshooterdata_starfield.bundle
2019-08-21 14:27:00 573539 spaceshooterdata_explosion_player.bundle
2019-08-21 14:26:56 412235 spaceshooterdata_explosion_enemy.bundle
2019-08-21 14:26:52 382630 spaceshooterdata_explosion_asteroid.bundle
2019-08-21 14:26:49 177018 spaceshooterdata_engines_player.bundle
2019-08-21 14:26:45 157215 spaceshooterdata_engines_enemy.bundle
2019-08-21 14:26:42 1085518 spaceshooterdata_done_player.bundle
2019-08-21 14:26:38 1070297 spaceshooterdata_done_enemyship.bundle
2019-08-21 14:26:34 27178 spaceshooterdata_done_bolt.bundle
2019-08-21 14:26:31 28362 spaceshooterdata_done_bolt-enemy.bundle
2019-08-21 14:26:28 231658 spaceshooterdata_done_asteroid03.bundle
2019-08-21 14:26:24 221450 spaceshooterdata_done_asteroid02.bundle
2019-08-21 14:26:20 227842 spaceshooterdata_done_asteroid01.bundle
2019-08-21 14:26:17 23016 remotedemodata_scenes_scene.bundle
2019-08-21 14:26:13 23064 remotedemodata_scenes_scene2.bundle
2019-08-21 14:26:10 10568 remotedemodata_unitylogoprefab.bundle
2019-08-21 14:26:07 462522 remotedemodata_unitylogo.bundle
2019-08-21 14:26:03 7864 remotedemodata_sphere.bundle
2019-08-21 14:26:00 6320 remotedemodata_mat1.bundle
2019-08-21 14:25:57 6320 remotedemodata_green.bundle
2019-08-21 14:25:53 44218 catalog_2019.07.30.18.24.34.json
2019-08-21 14:25:50 32 catalog_2019.07.30.18.24.34.hash
특정 항목에 대한 상세 정보를 확인하려면 항목의 경로와 함께 entries info
커맨드를 사용하십시오.
$ ucd entries info spaceshooterdata_starfield.bundle`
Entry Info:
Path: spaceshooterdata_starfield.bundle
Id: 8ac46783-be01-4a47-b23e-74233fc7cc09
Last Modified: 2019-08-21 14:27:03
Content Size: 167915
Content Hash: 4a3ad5b69bd489699d1909e8868a7cb1
Content Type: application/octet-stream
Content Link: …
Labels:
Metadata:
Current Version: aa0304db-fd9f-4772-9549-dfeb44cc6d6f
이제 게임 클라이언트는 항목과 연결된 경로를 사용하여 버킷의 개별 파일에 대한 콘텐츠를 요청할 수 있습니다. 모든 게임 클라이언트 요청은 <project_guid>.client-api.unity3dusercontent.com
에서 프로젝트별 하위 도메인에 대해 이루어져야 합니다. 모든 URL은 요청 경로에서 /client_api/v1/로 시작합니다. 이러한 클라이언트 요청은 인증이 필요하지 않습니다.
경로별로 항목의 콘텐츠(예: spaceshooterdata_starfield.bundle
)를 가져오려면 다음을 입력합니다.
https://<project_guid>.client-api.unity3dusercontent.com/client_api/v1/buckets/aee9ee5f-fa01-46d3-a293-731d15f066cf/entry_by_path/content/?path=spaceshooterdata_starfield.bundle
또는 항목 ID별로 항목의 콘텐츠를 가져오려면 다음을 입력합니다.
https://<project_guid>.client-api.unity3dusercontent.com/client_api/v1/buckets/aee9ee5f-fa01-46d3-a293-731d15f066cf/entries/8ac46783-be01-4a47-b23e-74233fc7cc09/content/
현재 항목 상태에서 릴리스를 생성합니다.
$ ucd releases create
Created release (#1) in bucket (aee9ee5f-fa01-46d3-a293-731d15f066cf).
Id: 80653663-eb39-45e7-9323-e34b23df0d75
Created: 2019-08-21 14:27:30
...
이렇게 하면 나중에 해당 항목을 업데이트하거나 제거하더라도 콘텐츠를 요청할 때 해당 항목의 정확한 버전을 사용할 수 있습니다.
릴리스에 대한 자세한 정보를 얻으려면 releases info
커맨드를 사용하고, 방금 생성한 릴리스의 ID를 제공합니다.
$ ucd releases info 80653663-eb39-45e7-9323-e34b23df0d75
Release #1:
Id: 80653663-eb39-45e7-9323-e34b23df0d75
Created: 2019-08-21 14:27:30
Content Size: 123456
Content Hash: b62343cb3582a7de1286dd3cf23c3592
Notes:
Metadata:
Entries:
- remotedemodata_scenes_scene2.bundle (version: d7c69bc0-5c0b-4625-8a7d-94a4972aa236)
- remotedemodata_unitylogo.bundle (version: 97d3659f-0b74-403a-be67-02641ce2dc91)
- spaceshooterdata_done_enemyship.bundle (version: edcedc81-80b6-4006-9732-0444898fcffa)
- remotedemodata_unitylogoprefab.bundle (version: 4edfa2be-7fae-44c9-bb45-f601cc1130db)
- spaceshooterdata_done_bolt-enemy.bundle (version: ef36bfa8-8b24-4b81-a329-b3fad0a0939b)
...
이 버킷에서 생성한 모든 릴리스 리스트를 가져오려면 다음을 입력합니다.
$ ucd releases list
Releases for current bucket (aee9ee5f-fa01-46d3-a293-731d15f066cf):
2019-08-21 14:27:30 #1 (80653663-eb39-45e7-9323-e34b23df0d75)
이제 이 릴리스에 포함된 콘텐츠를 직접 참조할 수 있습니다. 이렇게 하면 나중에 버킷에서 항목을 변경하더라도 CCD가 릴리스 생성에 사용하는 정확한 콘텐츠 집합을 가져올 수 있습니다.
경로별로 항목의 콘텐츠(예: spaceshooterdata_starfield.bundle
)를 가져오려면 다음을 입력합니다.
https://<project_guid>.client-api.unity3dusercontent.com/client_api/v1/buckets/aee9ee5f-fa01-46d3-a293-731d15f066cf/releases/80653663-eb39-45e7-9323-e34b23df0d75/entry_by_path/content/?path=spaceshooterdata_starfield.bundle
또는 항목 ID별로 항목의 콘텐츠를 가져오려면 다음을 입력합니다.
https://<project_guid>.client-api.unity3dusercontent.com/client_api/v1/buckets/aee9ee5f-fa01-46d3-a293-731d15f066cf/releases/80653663-eb39-45e7-9323-e34b23df0d75/entries/8ac46783-be01-4a47-b23e-74233fc7cc09/content/
또한 버킷의 최신 릴리스에 해당하는 콘텐츠를 요청할 수 있으므로 CCD가 새 릴리스를 생성할 때마다 클라이언트가 변경할 필요가 없습니다. 이렇게 하려면 release_by_badge
경로를 사용하도록 요청을 업데이트하고 latest
를 배지 이름으로 지정하십시오(배지 관리 참조). 예를 들면 다음과 같습니다.
https://<project_guid>.client-api.unity3dusercontent.com/client_api/v1/buckets/aee9ee5f-fa01-46d3-a293-731d15f066cf/release_by_badge/latest/entry_by_path/content/?path=spaceshooterdata_starfield.bundle
릴리스를 생성한 후 릴리스를 고유하게 식별하는 배지를 적용할 수 있습니다. 배지는 버킷 내의 단일 릴리스만 가리킬 수 있지만, 릴리스 간에 배지를 이동할 수 있습니다. 런타임 시점에 특정 릴리스 ID 대신 배지 이름을 사용하여 콘텐츠를 쿼리할 수 있으므로 워크플로의 유연성이 향상됩니다.
예를 들어 QA 팀이 사용할 최신 릴리스에 qa_latest
라는 이름의 배지를 적용한 후 프로세스 중에 각 새 릴리스로 해당 배지를 이동할 수 있습니다(수동 또는 자동).
릴리스 생성에서 생성한 릴리스에 my_first_badge
라는 이름의 배지를 추가하려면 다음을 입력합니다.
$ ucd badges add my_first_badge 80653663-eb39-45e7-9323-e34b23df0d75
Added badge 'my_first_badge' to release (80653663-eb39-45e7-9323-e34b23df0d75).
이 버킷에 적용한 모든 배지를 나열하려면 다음을 입력합니다.
$ ucd badges list
Badges for current bucket (aee9ee5f-fa01-46d3-a293-731d15f066cf):
2020-01-07 12:55:41 my_first_badge (80653663-eb39-45e7-9323-e34b23df0d75)
배지가 참조하는 릴리스와 관련된 콘텐츠를 다운로드할 수 있습니다. 이 작업은 항목 ID로 콘텐츠를 직접 다운로드하는 것과 유사한 방식으로 수행할 수 있습니다.
경로별로 항목의 콘텐츠(예: spaceshooterdata_starfield.bundle
)를 가져오려면 다음을 입력합니다.
https://<project_guid>.client-api.unity3dusercontent.com/client_api/v1/buckets/aee9ee5f-fa01-46d3-a293-731d15f066cf/release_by_badge/my_first_badge/entry_by_path/content/?path=spaceshooterdata_starfield.bundle
또는 항목 ID별로 항목의 콘텐츠를 가져오려면 다음을 입력합니다.
https://<project_guid>.client-api.unity3dusercontent.com/client_api/v1/buckets/aee9ee5f-fa01-46d3-a293-731d15f066cf/release_by_badge/my_first_badge/entries/8ac46783-be01-4a47-b23e-74233fc7cc09/content/
Did you find this page useful? Please give it a rating:
Thanks for rating this page!
What kind of problem would you like to report?
Thanks for letting us know! This page has been marked for review based on your feedback.
If you have time, you can provide more information to help us fix the problem faster.
Provide more information
You've told us this page needs code samples. If you'd like to help us further, you could provide a code sample, or tell us about what kind of code sample you'd like to see:
You've told us there are code samples on this page which don't work. If you know how to fix it, or have something better we could use instead, please let us know:
You've told us there is information missing from this page. Please tell us more about what's missing:
You've told us there is incorrect information on this page. If you know what we should change to make it correct, please tell us:
You've told us this page has unclear or confusing information. Please tell us more about what you found unclear or confusing, or let us know how we could make it clearer:
You've told us there is a spelling or grammar error on this page. Please tell us what's wrong:
You've told us this page has a problem. Please tell us more about what's wrong:
Thank you for helping to make the Unity documentation better!
Your feedback has been submitted as a ticket for our documentation team to review.
We are not able to reply to every ticket submitted.