サービス・インスタンスの削除
次の手順で説明するように、REST APIを使用してOracle Java Cloud Serviceインスタンスを削除できます。
Oracle Public Cloudでサービス・インスタンスによってOracle Exadataデータベースが使用される場合、管理対象サーバー・ノードに関連付けられているIP予約が解放されますが、削除されません。
注意: cURLコマンドの例では、URL構造https://rest_server_url/resource-pathが使用されています。ここで、rest_server_urlはアイデンティティ・ドメインまたはテナント名を問い合せるためのOracle Public CloudまたはOracle Cloud MachineのRESTサーバーです。 Oracle Public CloudまたはOracle Cloud Machineに使用する適切なURL構造の詳細は、リクエストの送信を参照してください。
Oracle Java Cloud Serviceインスタンスを削除する手順:
- Oracle Java Cloud Serviceインスタンスを削除する前に、現在存在するサービス・インスタンスを調べて、削除するサービス・インスタンスの名前を確認します。
curl -i -X GET -u username:userPassword1! -H "X-ID-TENANT-NAME:ExampleIdentityDomain" https://rest_server_url/paas/service/jcs/api/v1.1/instances/ExampleIdentityDomain
cURLコマンドラインで次のオプションを指定します。
出力にHTTPヘッダーを含める-iオプション。 このオプションは省略可能です。
リクエストのタイプ(GET)を指定する-Xオプション。
認証のためのOracle Java Cloud Serviceアカウントのユーザー名とパスワードを指定する-uオプション。
アイデンティティ・ドメインIDまたはテナント名を識別するカスタム・ヘッダーX-ID-TENANT-NAMEを定義する-H。
詳細は、「すべてのサービス・インスタンスの表示」を参照してください。
レスポンス本文の例を次に示します。 この例では、ExampleInstance、My12cServerおよびMy11gServerの3つのサービス・インスタンスがあります。
{ "uri":"https:\/\rest_server_url\/paas\/service\/jcs\/api\/v1.1\/instances\/ExampleIdentityDomain", "service_type":"jaas", "implementation_version":"1.0", "services" : [ { "service_name":"ExampleInstance", "version":"12cR3", "wlsVersion":"12.1.3.0.x", "status":"Running", "error_status_desc": "", "compliance_status": "", "compliance_status_desc": "", "auto_update": "true", "description":"WebLogicEnterprise", "identity_domain":"ExampleIdentityDomain", "creation_time" : "Thu Jun 3 8:19:30 UTC 2014", "last_modified_time" : "Thu Jun 26 22:19:26 UTC 2014", "created_by":"username", "service_uri":"https:\/\/rest_server_url\/paas\/service\/jcs\/api\/v1.1\/instances\/ExampleIdentityDomain\/ExampleInstance" }, { "service_name":"My12cServer", "version":"12cR3", "wlsVersion":"12.1.3.0.x", "status":"Running", "error_status_desc": "", "compliance_status": "", "compliance_status_desc": "", "auto_update": "true", "description":"WebLogicEnterprise", "identity_domain":"ExampleIdentityDomain", "creation_time":"Wed May 28 15:36:57 GMT 2014", "last_modified_time":"Thu May 29 09:15:57 GMT 2014", "created_by":"username", "service_uri":"https:\/\/rest_server_url\/paas/\service\/jcs\/api\/v1.1\/instances\/ExampleIdentityDomain\/My12cServer" }, { "service_name":"My11gServer", "version":"11g", "wlsVersion":"10.3.6.0.xx", "status":"Running", "error_status_desc": "", "compliance_status": "", "compliance_status_desc": "", "auto_update": "true", "description":"", "identity_domain":"ExampleIdentityDomain", "creation_time":"Tue May 27 18:11:41 GMT 2014", "last_modified_time":"Wed May 28 00:35:11 GMT 2014", "created_by":"username", "service_uri":"https:\/\/rest_server_url\/paas\/service\/jcs\/api\/v1.1\/instances\/ExampleIdentityDomain\/My11gServer" }] }
- JSONドキュメントdelete.jsonを作成します。 実行中のプロセスの有無にかかわらず、サービス・インスタンスの削除を強制するには、forceDeleteフラグを有効にします。
Oracle Public Cloudでは、Database Cloud Serviceデータベース・デプロイメントが作成されたときに指定されたデータベース管理者のユーザー名およびパスワードを指定します。
Oracle Cloud Machineでは、データベース・ネットワーク管理者のユーザー名およびパスワードを指定します。
Oracle Public Cloudでのリクエスト・ドキュメントの例を次に示します。
{ "dbaName": "SYS", "dbaPassword": "MyPassword1!", "forceDelete": true }
Oracle Cloud Machineでのリクエスト・ドキュメントの例を次に示します。
{ "dbaName": "mydbadminname", "dbaPassword": "MyPassword1!", "forceDelete": true }
リクエスト属性の詳細は、「サービス・インスタンスの削除」を参照してください。
- ステップ2で定義したJSONドキュメントを渡して、サービス・インスタンスExampleInstanceを削除します。
curl -i -X PUT -u username:userPassword1! -d @delete.json -H "Content-Type:application/vnd.com.oracle.oracloud.provisioning.Service+json" -H "X-ID-TENANT-NAME:ExampleIdentityDomain" https://rest_server_url/paas/service/jcs/api/v1.1/instances/ExampleIdentityDomain/ExampleInstance
cURLコマンドラインで次のオプションを指定します。
出力にHTTPヘッダーを含める-iオプション。 このオプションは省略可能です。
リクエストのタイプ(PUT)を指定する-Xオプション。
認証のためのOracle Java Cloud Serviceアカウントのユーザー名とパスワードを指定する-uオプション。
ローカル・マシン上でJSON形式のリクエスト・ドキュメント(delete.json)を識別する-dオプション。
コンテンツ・タイプをapplication/vnd.com.oracle.oracloud.provisioning.Service+jsonとして識別し、アイデンティティ・ドメインIDまたはテナント名を識別するカスタム・ヘッダーX-ID-TENANT-NAMEを定義する-H。
詳細は、「サービス・インスタンスの削除」を参照してください。
レスポンス・ヘッダーと本文の例を次に示します。
HTTP/1.1 202 Accepted Date: Wed, 24 Jun 2015 19:52:03 GMT Location: https://rest_server_url/paas/service/jcs/api/v1.1/instances/ExampleIdentityDomain/status/delete/job/11 ... { "service_name":"ExampleInstance", "version":"12cR3", "wlsVersion":"12.1.3.0.x", "status":"Terminating", "error_status_desc":"", "compliance_status":"", "compliance_status_desc":"", "auto_update":"true", "description":"ExampleInstance", "identity_domain":"ExampleIdentityDomain", "creation_time":"Wed May 13 0:27:30 UTC 2015", "last_modified_time":"Sat Jun 13 16:10:26 UTC 2015", "created_by":"username", "service_uri":"https:\/\/rest_server_url\/paas\/service\/jcs\/api\/v1.1\/instances\/ExampleIdentityDomain\/ExampleInstance" }
- Locationヘッダーで返されたリソースURIを使用して、削除操作のステータスを確認します。
curl -i -X GET -u username:userPassword1! -H "X-ID-TENANT-NAME:ExampleIdentityDomain" https://rest_server_url/paas/service/jcs/api/v1.1/instances/ExampleIdentityDomain/status/delete/job/11
cURLコマンドラインで次のオプションを指定します。
出力にHTTPヘッダーを含める-iオプション。 このオプションは省略可能です。
リクエストのタイプ(GET)を指定する-Xオプション。
認証のためのOracle Java Cloud Serviceアカウントのユーザー名とパスワードを指定する-uオプション。
アイデンティティ・ドメインIDまたはテナント名を識別するカスタム・ヘッダーX-ID-TENANT-NAMEを定義する-H。
詳細は、「サービス・インスタンス・ライフサイクル操作のステータスの表示」を参照してください。
次の例では、ステータス・メッセージを含めてレスポンス本文のコンテンツを示しています。
{ "service_name": "ExampleInstance", "version": "12cR3", "wlsVersion": "12.1.3.0.x", "status": "Terminating", "error_status_desc": "", "compliance_status": "", "compliance_status_desc": "", "auto_update": "true", "description": "ExampleInstance", "identity_domain": "ExampleIdentityDomain", "creation_time": "Wed May 13 0:27:30 UTC 2015", "last_modified_time": "Sat Jun 13 16:10:26 UTC 2015", "created_by": "username", "service_uri": "https:\/\/rest_server_url\/paas\/service\/jcs\/api\/v1.1\/instances\/ExampleIdentityDomain\/ExampleInstance", "message": [ "Successfully terminated the backup service...", "Stopping Compute resources..." ] }
- サービス・インスタンスが削除されたら、現在存在するサービス・インスタンスを調べて、削除が行われたことを確認します。
curl -i -X GET -u username:userPassword1! -H "X-ID-TENANT-NAME:ExampleIdentityDomain" https://rest_server_url/paas/service/jcs/api/v1.1/instances/ExampleIdentityDomain
cURLコマンドラインで次のオプションを指定します。
出力にHTTPヘッダーを含める-iオプション。 このオプションは省略可能です。
リクエストのタイプ(GET)を指定する-Xオプション。
認証のためのOracle Java Cloud Serviceアカウントのユーザー名とパスワードを指定する-uオプション。
アイデンティティ・ドメインIDまたはテナント名を識別するカスタム・ヘッダーX-ID-TENANT-NAMEを定義する-H。
レスポンス本文の例を次に示します。 この例では、My12cServerとMy11gServerの2つのサービス・インスタンスがあります。 ExampleInstanceは正常に削除されました。
{ "uri":"https:\/\rest_server_url\/paas\/service\/jcs\/api\/v1.1\/instances\/ExampleIdentityDomain", "service_type":"jaas", "implementation_version":"1.0", "services" : [ { "service_name":"My12cServer", "version":"12cR3", "wlsVersion":"12.1.3.0.x", "status":"Running", "error_status_desc": "", "compliance_status": "", "compliance_status_desc": "", "auto_update": "true", "description":"WebLogicEnterprise", "identity_domain":"ExampleIdentityDomain", "creation_time":"Wed May 28 15:36:57 GMT 2014", "last_modified_time":"Thu May 29 09:15:57 GMT 2014", "created_by":"username", "service_uri":"https:\/\/rest_server_url\/paas\/service\/jcs\/api\/v1.1\/instances\/ExampleIdentityDomain\/My12cServer" }, { "service_name":"My11gServer", "version":"11g", "wlsVersion":"10.3.6.0.xx", "status":"Running", "error_status_desc": "", "compliance_status": "", "compliance_status_desc": "", "auto_update": "true", "description":"", "identity_domain":"ExampleIdentityDomain", "creation_time":"Tue May 27 18:11:41 GMT 2014", "last_modified_time":"Wed May 28 00:35:11 GMT 2014", "created_by":"username", "service_uri":"https:\/\/rest_server_url\/paas\/service\/jcs\/api\/v1.1\/instances\/ExampleIdentityDomain\/My11gServer" }] }