機械翻訳について

2 Oracle Compute CLIの概要

この項では、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 ...]
コマンド・オプション 説明

-u username| --user=username

テナント・ユーザー名(/tenant_name/username)またはテナント管理者(/tenant_name/username)

デフォルトはORACLE_COMPUTE_USER環境変数に設定されています。

-a url| --address=url

(オプション) Oracle Compute APIサービスのURL。

デフォルトはORACLE_COMPUTE_API環境変数に設定されています。

-p file| --pass=file

(オプション)ユーザー・パスワードを含むファイル。

--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 CLIでも、オブジェクトに対して実行できるすべてのアクションがリストされます。 たとえば、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]

オブジェクト名について

CLIコマンドを実行できる各Oracle Computeオブジェクトは、URIで一意に識別されます。 インスタンス、ストレージ・ボリュームまたはSSH鍵などのオブジェクトには、コンテナの階層内の位置に基づいた名前が付けられています。

たとえば、オブジェクト名/mytenant/public/8e7c16ad-1bc4-4743-a9ce-781be4e26f24は、このインスタンス8e7c16ad-1bc4-4743-a9ce-781be4e26f24がコンテナpublic,にあり、publicがコンテナmytenantにあることを示します。