機械翻訳について

25 オーケストレーション・オブジェクト

このセクションでは、オーケストレーション・オブジェクトの追加、削除、更新、および表示に使用できるCLIコマンドCompute Classicについて説明します。

オーケストレーション・オブジェクトは、Orchestration v2によって管理されるCompute Classicのオブジェクトです。 これは、オーケストレーションの主要な構成要素です。 各オブジェクトには、作成するコンピューティング、ネットワーキング、またはストレージ・リソースのすべての属性が含まれています。 オーケストレーションでオブジェクトを定義するときは、参照を使用して他のオブジェクトとの依存関係を作成できます。 Oracle Cloud Infrastructure Compute Classicの使用「オブジェクト参照と関係」を参照してください。

オーケストレーションは、最大100の相互依存オブジェクトを処理するように設計されています。 他のコマンドを使用してオブジェクトを作成すると、オーケストレーションが損なわれる可能性があります。

注意:

オーケストレーションを使用して作成したリソースを管理するには、常にオーケストレーションを使用する必要があります。 たとえば、sec-lists addコマンドまたはstorage-snapshot addコマンドを使用する代わりに、実行中のインスタンスにセキュリティ・リストを追加するか、またはアタッチされたストレージ・ボリュームのストレージ・スナップショットを作成するには、orchestration-object addコマンドを使用します。 たとえば、Webコンソール、CLIコマンド、またはREST APIを使用して、オーケストレーションを使用して作成したオブジェクトを削除しないでください。 これにより、オーケストレーションがオブジェクトと関連するリソースを再作成しようとするか、エラー状態になる可能性があります。

また、Orchestrations v1を使用して作成したリソースをOrchestrations v2で参照したり、その逆に使用したり、管理したりしないでください。

次のコマンドを使用すると、オーケストレーション内のオブジェクトを追加したり、オブジェクトを削除したり、オブジェクトを更新したりすることができます。

この節で説明するCLIコマンドを実行する前に、CLIクライアントをインストールして、「CLIを使用するための準備」で説明されているように必要な環境変数を設定していることを確認してください。

orchestration-object add

Compute Classicの指定されたOrchestration v2にオブジェクトを追加します。

追加するオーケストレーション・オブジェクトの動作は、関連付けられているオーケストレーションのdesired_stateによって決まります。

  • オブジェクトは、関連付けられたオーケストレーションのdesired_stateactiveに設定されているときに作成されます。

  • 関連するオーケストレーションのdesired_stateinactiveに設定されていると、オブジェクトは削除されます。

  • 関連付けられたオーケストレーションのdesired_stateが中断に設定されている場合は、非永続オブジェクトだけが削除されます。 関連するオーケストレーションが中断されても、永続オブジェクトは削除されません。 オブジェクトを永続化するには、persistent属性をtrueに設定します。 オブジェクトが持続するように設定されている場合、オブジェクトはオーケストレーションが中断されても削除されません。 永続オブジェクトがまだアクティブ状態でない場合、それらは作成されます。 オーケストレーションが終了すると、すべてのオブジェクトが削除されます。 オブジェクトの永続属性をtrueに設定した場合は、すべての依存オブジェクトの永続属性もtrueに設定する必要があります。 たとえば、永続インスタンスがストレージ・ボリュームを参照する場合、ストレージ・ボリュームも永続的である必要があります。 詳細については、Oracle Cloud Infrastructure Compute Classicの使用「Orchestrations v2のオブジェクトの永続性」を参照してください。

オーケストレーションのdesired_stateを変更するには、orchestration-v2 updateコマンドを実行します。

healthパラメータの値を表示すると、オブジェクトの状況を判別できます。

必要なロール

このタスクを実行するには、Compute_Operationsのロールが必要です。 このロールが自分に割り当てられていない場合または不確実な場合は、システム管理者にOracle Cloud 「Infrastructure Classicコンソール」でそのロールが割り当てられていることを確認するように依頼してください。 「Oracle Cloudの管理とモニタリング」「ユーザー・ロールの変更」を参照してください。

構文

opc compute orchestration-object add [--request-body=FILE.json]

このコマンドのパラメータとオプションのヘルプについては、-hオプションを指定してコマンドを実行してください。

opc -f json compute orchestration-object add --request-body=addObject.json

addObject.jsonの例

以下は、デフォルトの属性値を持つセキュリティ・リストを作成するためのaddObject.jsonファイル内のコンテンツの例を示しています。 persistenttrueに設定されると、永続的なセキュリティ・リストが作成されます。 オーケストレーションが中断されても、永続オブジェクトは削除されません。/Compute-acme/jack.jones@example.com/seclist1は作成される永続セキュリティ・リストの名前で、/Compute-acme/jack.jones@example.com/myOrchestration/seclist1はこのセキュリティ・リストを追跡するオーケストレーション・オブジェクトの名前です。 セキュリティ・リストの状態は、関連付けられたオーケストレーションのdesired_state/Compute-acme/jack.jones@example.com/myOrchestrationによって決定されます。

{
  "type":"SecList",
  "orchestration": "/Compute-acme/jack.jones@example.com/myOrchestration",
  "name": "/Compute-acme/jack.jones@example.com/myOrchestration/seclist1",
  "label": "mySeclist1",
  "persistent": true,
  "template": {
   "name": "/Compute-acme/jack.jones@example.com/seclist1"
      },
  "description": "a persistent security list"
}

サンプル出力

出力のhealthパラメータの値を調べることにより、オブジェクトの現行の状況を見つけることができます。 関連オーケストレーションのdesired_stateinactiveであるため、セキュリティ・リスト・オブジェクトもinactiveです。

{
	"relationships": [],
	"account": "/Compute-acme/default",
	"time_updated": null,
	"description": "a persistent security list",
	"user": "/Compute-acme/jack.jones@example.com",
	"persistent": true,
	"uri": "https://api-z999.compute.us0.oraclecloud.com/platform/v1/object/Compute-acme/jack.jones@example.com/myOrchestration/seclist1",
	"template": {
		"name": "/Compute-acme/jack.jones@example.com/seclist1"
	},
	"label": "mySeclist1",
	"time_audited": null,
	"version": 1,
	"health": {
		"status": "inactive"
	},	
  "time_created": "2017-03-10T11:05:39Z",
	"orchestration": "/Compute-acme/jack.jones@example.com/myOrchestration",
	"type": "SecList",
	"name": "/Compute-acme/jack.jones@example.com/myOrchestration/seclist1"
}

orchestration-object list

利用可能なすべてのオーケストレーション・オブジェクトの詳細を取得し、指定された問合せ条件に一致します。 検索結果をフィルタリングするには、1つ以上のオーケストレーション名を問合せオプションとして渡すことができます。 これにより、指定されたオーケストレーションに属するオブジェクトの名前のみが取得されます。 問合せ条件を指定しないと、コンテナ内のすべてのオーケストレーション・オブジェクトの詳細が表示されます。

必要なロール

このタスクを実行するには、Compute_MonitorまたはCompute_Operationsのロールが必要です。 このロールが自分に割り当てられていない場合または不確実な場合は、システム管理者にOracle Cloud 「Infrastructure Classicコンソール」でそのロールが割り当てられていることを確認するように依頼してください。 「Oracle Cloudの管理とモニタリング」「ユーザー・ロールの変更」を参照してください。

構文

opc compute orchestration-object list container [--orchestration orchestration-name]

このコマンドのパラメータとオプションのヘルプについては、-hオプションを指定してコマンドを実行してください。

opc -f json compute orchestration-object list /Compute-acme/jack.jones@example.comfirstOrchestration

サンプル出力

{
  "result": [
     {
      "relationships": [
        
      ],
      "account": "/Compute-acme/default",
      "time_updated": "2017-03-10T08:42:39Z",
      "description": "",
      "user": "/Compute-acme/jack.jones@example.com",
      "persistent": false,
      "uri": "https://api-z999.compute.us0.oraclecloud.com/platform/v1/object/Compute-acme/jack.jones@example.com/firstOrchestration/my-seclist",
      "template": {
        "name": "/Compute-acme/jack.jones@example.com/my-seclist"
      },
      "label": "my-seclist",
      "time_audited": "2017-03-10T12:29:43Z",
      "version": 2,
      "health": {
        "status": "active",
        "object": {
          "account": "/Compute-acme/default",
          "description": "",
          "uri": "https://api-z999.compute.us0.oraclecloud.com/seclist/Compute-acme/jack.jones@example.com/my-seclist",
          "outbound_cidr_policy": "PERMIT",
          "policy": "DENY",
          "name": "/Compute-acme/jack.jones@example.com/my-seclist"
        }
      },
      "time_created": "2017-03-09T11:05:43Z",
      "orchestration": "/Compute-acme/jack.jones@example.com/firstOrchestration",
      "type": "SecList",
      "name": "/Compute-acme/jack.jones@example.com/firstOrchestration/my-seclist"
    },
    {
      "relationships": [
        
      ],
      "account": "/Compute-acme/default",
      "time_updated": "2017-03-10T08:44:45Z",
      "description": "a persistent storage volume",
      "user": "/Compute-acme/jack.jones@example.com",
      "persistent": true,
      "uri": "https://api-z999.compute.us0.oraclecloud.com/platform/v1/object/Compute-acme/jack.jones@example.com/firstOrchestration/volume1",
      "template": {
        "size": "2G",
        "properties": [
          "/oracle/public/storage/default"
        ],
        "name": "/Compute-acme/jack.jones@example.com/volume1"
      },
      "label": "myVolume1",
      "time_audited": "2017-03-20T16:04:20Z",
      "version": 4,
      "health": {
        "status": "active",
        "object": {
          "managed": true,
          "snapshot_id": null,
          "snapshot_account": null,
          "machineimage_name": null,
          "status_timestamp": "2017-03-20T15:57:57Z",
          "imagelist": null,
          "writecache": false,
          "size": "2147483648",
          "platform": null,
          "readonly": false,
          "storage_pool": "/Compute-acme/storagepool/iscsi/thruput_1",
          "shared": false,
          "status": "Online",
          "hash": 1665999033,
          "description": null,
          "tags": [
            
          ],
          "quota": null,
          "status_detail": null,
          "properties": [
            "/oracle/public/storage/default"
          ],
          "account": "/Compute-acme/default",
          "name": "/Compute-acme/jack.jones@example.com/volume1",
          "bootable": false,
          "hypervisor": null,
          "uri": "http://api-z999.compute.us0.oraclecloud.com/storage/volume/Compute-acme/jack.jones@example.com/volume1",
          "imagelist_entry": -1,
          "snapshot": null
        }
      },
      "time_created": "2017-03-10T07:05:24Z",
      "orchestration": "/Compute-acme/jack.jones@example.com/firstOrchestration",
      "type": "StorageVolume",
      "name": "/Compute-acme/jack.jones@example.com/firstOrchestration/volume1"
    }
  ]
}

orchestration-object get

指定されたオーケストレーション・オブジェクトの詳細を取得します。

getコマンドを使用して、addおよびupdate操作が正常に完了したかどうかを確認できます。 -Fオプション(たとえば、-F status)を使用して、特定の属性の出力をフィルタリングします。

必要なロール

このタスクを実行するには、Compute_MonitorまたはCompute_Operationsのロールが必要です。 このロールが自分に割り当てられていない場合または不確実な場合は、システム管理者にOracle Cloud 「Infrastructure Classicコンソール」でそのロールが割り当てられていることを確認するように依頼してください。 「Oracle Cloudの管理とモニタリング」「ユーザー・ロールの変更」を参照してください。

構文

opc compute orchestration-object get name

このコマンドのパラメータとオプションのヘルプについては、-hオプションを指定してコマンドを実行してください。

opc -f json compute orchestration-object get /Compute-acme/jack.jones@example.com/myOrchestration/seclist1

サンプル出力

{
  "relationships": [],
  "account": "/Compute-acme/default",
  "time_updated": "2017-03-10T11:17:42Z",
  "description": "a persistent security list",
  "user": "/Compute-acme/jack.jones@example.com",
  "persistent": true,
  "uri": "https://api-z999.compute.us0.oraclecloud.com/platform/v1/object/Compute-acme/jack.jones@example.com/myOrchestration/seclist1",
  "template": {
    "name": "/Compute-acme/jack.jones@example.com/seclist1"
  },
  "label": "mySeclist1",
  "time_audited": "2017-03-10T11:27:44Z",
  "version": 2,
  "health": {
    "status": "active",
    "object": {
      "account": "/Compute-acme/default",
      "description": "",
      "uri": "https://api-z999.compute.us0.oraclecloud.com/seclist/Compute-acme/jack.jones@example.com/seclist1",
      "outbound_cidr_policy": "PERMIT",
      "policy": "DENY",
      "name": "/Compute-acme/jack.jones@example.com/seclist1"
    }
  },
  "time_created": "2017-03-10T11:05:39Z",
  "orchestration": "/Compute-acme/jack.jones@example.com/myOrchestration",
  "type": "SecList",
  "name": "/Compute-acme/jack.jones@example.com/myOrchestration/seclist1"
}

orchestration-object discover

必要なロール

このタスクを実行するには、Compute_MonitorまたはCompute_Operationsのロールが必要です。 このロールが自分に割り当てられていない場合または不確実な場合は、システム管理者にOracle Cloud 「Infrastructure Classicコンソール」でそのロールが割り当てられていることを確認するように依頼してください。 「Oracle Cloudの管理とモニタリング」「ユーザー・ロールの変更」を参照してください。

構文

opc compute orchestration-object discover container

このコマンドのパラメータとオプションのヘルプについては、-hオプションを指定してコマンドを実行してください。

opc compute orchestration-object discover /Compute-acme/jack.jones@example.com/myOrchestration

サンプル出力

result
-------------------------------------------------------------
/Compute-acme/jack.jones@example.com/myOrchestration/seclist1
/Compute-acme/jack.jones@example.com/myOrchestration/c18a1d1b-fdf4-48fd-b6f7-271bfa4d8bd7

orchestration-object update

指定したオーケストレーション・オブジェクトを更新します。 オーケストレーション・オブジェクトの次のフィールドを更新することができます:descriptionlabelpersistentrelationships、およびtemplateを含む。 オブジェクトが含まれているオーケストレーションが一時的な状態(activatingdeactivatingsuspendingなど)の間にオブジェクトを更新することはできません。

また、あるオーケストレーションから別のオーケストレーションにオブジェクトを移動することはできません。

オーケストレーション・オブジェクトを更新するには:

  1. orchestration-object getコマンドを実行して、JSON形式のオーケストレーション・オブジェクトの詳細を取得します。

  2. オーケストレーション・オブジェクトのversionに注意してください。 updateコマンドを実行している間、オーケストレーション・オブジェクトのバージョンを指定する必要があります。

  3. 要件に応じてJSONファイルを変更します。 オーケストレーション・オブジェクトの次のフィールドを更新することができます:descriptionlabelpersistentrelationships、およびtemplateを含む。 他のフィールドの値は更新できません。

  4. JSONファイルを更新したら、それを検証する必要があります。 これは、JSONLintなどのサードパーティ・ツールか、または任意の他の検証ツールを使用して行うことができます。 JSON形式が有効でない場合、オーケストレーション・オブジェクトを更新すると、エラー・メッセージが表示されます。

  5. このコマンドのリクエスト本文として、変更されたJSONを提供します。

必要なロール

このタスクを実行するには、Compute_Operationsのロールが必要です。 このロールが自分に割り当てられていない場合または不確実な場合は、システム管理者にOracle Cloud 「Infrastructure Classicコンソール」でそのロールが割り当てられていることを確認するように依頼してください。 「Oracle Cloudの管理とモニタリング」「ユーザー・ロールの変更」を参照してください。

構文

opc compute orchestration-object update name [--request-body=FILE.json]

このコマンドのパラメータとオプションのヘルプについては、-hオプションを指定してコマンドを実行してください。

opc compute orchestration-object update /Compute-acme/jack.jones@example.com/myOrchestration/seclist1 --request-body=update_object.json

update_object.jsonファイルの例

次の例は、/Compute-acme/jack.jones@example.com/myOrchestrationオーケストレーションに存在する /Compute-acme/jack.jones@example.com/myOrchestration/mySeclistオブジェクトを更新するためのupdate_object.jsonファイルの内容を示しています。 このオブジェクトの次のフィールドが更新されます:persistentfalselabeldescriptionに設定され、outbound_cidr_policyPERMITに設定される。

{
  "type": "SecList",
  "orchestration": "/Compute-acme/jack.jones@example.com/myOrchestration",
  "name": "/Compute-acme/jack.jones@example.com/myOrchestration/seclist1",
  "label": "my-Security-list-1",
  "persistent": false,
  "template": {
   "name": "/Compute-acme/jack.jones@example.com/seclist1",
   "outbound_cidr_policy": "PERMIT", 
   "policy": "DENY"
   },
  "version": 2,
  "description": "an updated security list which is not persistent"
}

サンプル出力

読みやすくするため、一部の行は省略記号(...)を使用して省略されています。 実際の環境でコマンドを実行すると、完全な出力が表示されます。

{
  "relationships": [   
  ],
  "account": "/Compute-acme/default",
  "time_updated": "2016-11-10T22:36:23Z",
  "name": "/Compute-acme/jack.jones@example.com/mySeclist",
  "persistent": false,
  "uri": "https://api-z999.compute.us0.oraclecloud.com/platform/v1/object/Compute-acme/jack.jones@example.com/myOrchestration/mySeclist",
  "time_created": "2016-11-10T16:47:05Z",
  "label": "my-seclist",
  "time_audited": "2016-11-10T22:36:16Z",
  "orchestration": "/Compute-acme/jack.jones@example.com/myOrchestration",
  "version": 3,
  "health": {
    "status": "inactive"
    "object": {
      "account": "/Compute-acme/default",
      "description": "",
      "uri": null,
      "outbound_cidr_policy": "PERMIT",
      "policy": "DENY",
      "name": "/Compute-acme/jack.jones@example.com/seclist1"
    } 
  },
  "user": "/Compute-acme/jack.jones@example.com",
  "template": {
    "name": "/Compute-acme/jack.jones@example.com/seclist1"
    "policy": "PERMIT", 
    "outbound_cidr_policy": "PERMIT",
  },
  "type": "SecList",
  "description": "an updated security list which is not persistent"
}

orchestration-object delete

指定されたオーケストレーション・オブジェクトとその下にあるオブジェクトを削除します。 たとえば、/Compute-acme/jack.jones@example.com/myOrchestration/mySeclistオーケストレーション・オブジェクトの削除リクエストを送信すると、基になる/Compute-acme/jack.jones@example.com/mySeclistセキュリティ・リストも削除されます。

このコマンドのレスポンスは返されません。

必要なロール

このタスクを実行するには、Compute_Operationsのロールが必要です。 このロールが自分に割り当てられていない場合または不確実な場合は、システム管理者にOracle Cloud 「Infrastructure Classicコンソール」でそのロールが割り当てられていることを確認するように依頼してください。 「Oracle Cloudの管理とモニタリング」「ユーザー・ロールの変更」を参照してください。

構文

opc compute orchestration-object delete name [--terminate=true]

このコマンドのパラメータとオプションのヘルプについては、-hオプションを指定してコマンドを実行してください。

例1 : 非アクティブなオブジェクトの削除

次の例は、inactive状態にあるオブジェクト/Compute-acme/jack.jones@example.com/myOrchestration/mySeclistを削除する方法を示しています。

opc compute orchestration-object delete /Compute-acme/jack.jones@example.com/myOrchestration/mySeclist

例2 : アクティブなオブジェクトの削除

次の例は、active状態にあるオブジェクト/Compute-acme/jack.jones@example.com/myOrchestration/Seclist1を削除する方法を示しています。 任意のactive状態のオーケストレーション・オブジェクトを削除するには、terminate=Trueオプションを指定して、オーケストレーション・オブジェクトを削除します。

opc compute orchestration-object delete /Compute-acme/jack.jones@example.com/myOrchestration/Seclist1 --terminate=True