この項では、Oracle Public Cloud MachineでCompute Cloud Serviceを管理するためのoracle-computeコマンドの使用方法の概要を示します。
oracle-compute CLIツールには、次の構文があります。
oracle-compute -u user [ -a url] [ -p file] [options] action object [--parameter1 arg1 --parameter2 arg2 ...]
| コマンド・オプション | 説明 |
|---|---|
|
|
テナント・ユーザー名( デフォルトはORACLE_COMPUTE_USER環境変数に設定されています。 |
|
|
(オプション) Oracle Compute APIサービスのURL。 デフォルトはORACLE_COMPUTE_API環境変数に設定されています。 |
|
|
(オプション)ユーザー・パスワードを含むファイル。 |
|
--options |
(オプション)「一般的なコマンド・オプション」を参照してください。 |
|
action |
実行する操作。 一般的なコマンド・アクションを参照してください。 |
|
object |
アクションのターゲット。 オブジェクト名についてを参照してください。 |
|
--parameters |
(オプション)操作を指示するためのアクション固有およびオブジェクト固有のパラメータ。 |
この項では、すべてのコマンドに共通のオプションをリストします。
-d, --debugリクエストおよびレスポンスの完全な詳細を表示するデバッグ・モードを有効にします。
-f format | --format=formatコマンド出力の形式を指定します。
table (デフォルト): 各フィールドは、別々の列で表示されます。
tabbed: 各レコードは、単一行でタブ区切りリストとして表示されます。
csv: 各レコードは、単一行でカンマ区切りリストとして表示されます。
json: 出力は、JavaScript Object Notation (JSON)形式で表示されます。 この形式を指定すると、CLIによって-Fオプションが無視されます。
xml: 出力は、XML形式で表示されます。 この形式は、userリソースに対するコマンドでのみ使用できます。
-F fields |, --fields=fieldsオブジェクトのタイプに応じて、フィールドを指定します。 このオプションを使用して、大規模な結果の表示のフィールドまたは列をフィルタします。
-h | --helpヘルプ・メッセージを表示して、終了します。
-H | --no-headerデフォルトの表出力で列の見出しを非表示にします。
この項では、オブジェクトに対して実行できるアクションをリストします。 すべてのオブジェクトですべてのアクションを使用できるわけではありません。
addコンテナにオブジェクトを作成します。
deleteオブジェクトを削除します。 レスポンスは返されません。
discover各オブジェクトのlistまたはget権限なしで、コンテナ内のオブジェクトを検出します。 コンテナを指定する必要があります。コンテナは、キー・フィールドの親パスのみにすることができます(たとえば、/または/mytenant)。 そのコンテナ内のオブジェクトと、ユーザーが検出権限を持つサブコンテナの名前のみが返されます。 サブコンテナのコンテンツは返されません。
get特定のオブジェクトの情報を取得します。
list指定したコンテナ内のリストされたオブジェクトに関する情報を取得します。 コンテナは、特定のオブジェクトのキー・フィールド(/mytenant/publicなどのテナント名など)またはキー・フィールドの親パス(たとえば、/または/cloud)のみが、権限を表示することができます。 Oracle Computeオブジェクトのキー・フィールドは通常、オブジェクト名またはIDフィールドです(インスタンスの場合は/mytenant/public/myinstanceなど)。 必ず、特定のコマンドの説明で示された詳細に従って、正しいフィールドをコンテナとして使用してください。 必要に応じて、引数を使用して出力をフィルタします。
updateオブジェクトの情報を更新します。
また、アクション・レベルでOracle Compute CLIコマンドを拡張し、そのアクションに関連付けられたすべてのオブジェクトをリストすることもできます。 たとえば、oracle-compute addコマンドは、addアクションを実行できるすべてのオブジェクトをリストします。
$ oracle-compute add oracle-compute add alertrule <name> <subscriber> [--event] [--event_type] [--severity] [--error_code] [--alert_type] \ [--frequency] oracle-compute add imagelist <name> <description> [--default] oracle-compute add imagelistentry <imagelist name> <machineimages> <version> [--attributes] oracle-compute add machineimage <name> <file> [--attributes] [--quota] oracle-compute add orchestration <filename> oracle-compute add servicenet <name> <type> [--pkey] [--num_provider_nodes] [--description] oracle-compute add snapshot <instance> [--name] [--machineimage] [--quota] oracle-compute add sshkey <name> <key> [--enabled] [--osuser] oracle-compute add storageattachment <instance_name> <storage_volume_name> <index> oracle-compute add storagevolume <name> <size> <properties> [--description] [--source_storagevolume_name] [--imagelist] \ [--imagelist_entry] [--tags] [--quota] oracle-compute add user <username> <fullname> <email> [--role] [--password] oracle-compute add vethernet <name> <description> <type> <id> [--switchports] [--svcnet]
oracle-compute instanceコマンドは、オブジェクトinstanceに関連付けられているすべてのアクションをリストします。 $oracle-compute instance oracle-compute delete instance <name> oracle-compute discover instance <container> oracle-compute get instance <name> oracle-compute list instance <container> [--tags] [--quota] [--vcable_id] oracle-compute restart instance <name> oracle-compute shutdown instance <name> oracle-compute update instance <name> [--shape] [--networking] [--nis] [--tag] [--delete_tag]