このセクションでは、コマンドラインインターフェース(CLI)を使ったクラウドコンテンツデリバリー(CCD)の使用方法の全例を、以下のトピックを含めて紹介します。
APIキーを使ってサービスにログインします。APIキーの見つけ方がわからない場合は、Getting started のセクションを参照してください。
$ ucd auth login XXXXXXXXXXXX
ログインに成功しました。
auth info
コマンドでログインしているかどうかを確認します。
ucd認証情報
現在のユーザージョースミス
最初のバケットを作成します。バケットは1つのプロジェクトに関連付けられています。この例のプロジェクトIDは e1942cea-12df-4220-aa6d-f8c9c3ab7526
ですが、実際のプロジェクトIDを使う必要があります。しかし、実際のプロジェクトIDのいずれかを使用する必要があります。プロジェクトIDの見つけ方については、Getting started のセクションを参照してください。
このプロジェクトのバケット(この時点では空になっているはず)をリストアップします。
$ ucd バケツリスト e1942cea-12df-4220-aa6d-f8c9c3ab7526
プロジェクトに該当するバケットは見つかりませんでした。
example_bucket
というバケットを今回のプロジェクトのために作成します。
$ ucd buckets create e1942cea-12df-4220-aa6d-f8c9c3ab7526 example_bucket
作成したバケット:example_バケット (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のパラメータとして提供しないようにします)。上記のバケット作成メッセージからバケットのGUID(名前ではありません)をコピーします(aee9ee5f-fa01-46d3-a293-731d15f066cf
この例では )。
$ 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 エントリーリスト
現在のバケツではエントリーが見つかりません。
生成されたAssetBundleを含むローカルフォルダー内のすべてのファイルを同期します。
$ 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
ゲームクライアントは、エントリーに関連付けられたパスを使って、バケット内の個々のファイルのコンテンツをリクエストできるようになりました。ゲームクライアントのリクエストはすべて、 <プロジェクト_guid>.client-api.unity3dusercontent.com
のプロジェクト固有のサブドメインに行います。URLはすべて、リクエストパスが/client_api/v1/で始まっています。これらのクライアントリクエストはいずれも認証を必要としません。
spaceshooterdata_starfield.bundle
のように、エントリの内容をパスごとに取得するには、エンターキーを押します。
https://<プロジェクト_guid>.client-api.unity3dusercontent.com/client_api/v1/buckets/aee9ee5f-fa01-46d3-a293-731d15f066cf/entry_by_path/content/?path=spaceshooterdata_starfield.bundle
また、エントリーIDでエントリーの内容を取得するには、Enter:
https://<プロジェクト_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://<プロジェクト_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でエントリーの内容を取得するには、Enter:
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
のバッジ名を指定します(Managing badges 参照)。例えば、以下のようになります。
https://<プロジェクト_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
リリースを作成した後、そのリリースを一意に識別するバッジを適用することができます。バッジは、バケット内の1つのリリースのみを指すことができますが、リリース間でバッジを移動させることができます。実行時には、特定のリリースIDではなくバッジ名を使ってコンテンツを照会できるため、ワークフローの柔軟性が向上します。
例えば、 qa_latest
というバッジをQAチームが使用するために最新のリリースに適用し、そのバッジをプロセス(手動または自動)の一部として各新しいリリースに移動させることができます。
my_first_badge
という名前のバッジをCreating a release で生成したリリースに追加するには、次のように入力します。
$ ucd badges add my_first_badge 80653663-eb39-45e7-9323-e34b23df0d75
リリース(80653663-eb39-45e7-9323-e34b23df0d75)にバッジ「my_first_badge」を追加しました。
このバケツで適用したすべてのバッジを一覧表示する。
$ 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://<プロジェクト_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でエントリーの内容を取得するには、Enter:
https://<プロジェクト_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.