---
schema_version: "1"
id: 277f674f2e811f71eb2a141313674eff5e6f8bea36997679ec3dd6b723501415
title: CloudHub API
collection: mulesoft
version: current
locale: ja-jp
portal_url: https://docs.salesforce.com/mulesoft/current/ja-jp/cloudhub/cloudhub-api.md
canonical_url: https://docs.mulesoft.com/jp/cloudhub/cloudhub-api
source_site: docs.mulesoft.com
content_type: documentation
content_hash: 244cf9e37c7637d6ba566d7d75b15f4e57679c1027bb2f5ee07dd285c8d03016
description: MuleSoft Documentation Site
latest: true
---
# CloudHub API

CloudHub 管理 API (CloudHub API) を使用すると、Anypoint Runtime Manager の次の機能にプログラムでアクセスできます。

- アプリケーションの管理:
    
    - CloudHub でアプリケーションを作成、デプロイ、開始、終了、リスト、削除する。
    - ワーカー数、Mule Runtime Engine バージョン、システムプロパティなどのアプリケーションのメタデータを更新する。
    - アプリケーションやワーカーの統計情報を取得する。
    - アプリケーションのトランザクションやトランザクションのイベントを取得する。
    - 再生データを確認し、トランザクションのフローを再生して、アプリケーションの再生データを削除する。
    - 静的 IP アドレスを管理して、アプリケーションに関連付けられている未使用の IP アドレスを解放する。
    - アプリケーションの Mule パッケージをダウンロードする。
    - スケジュールの全部または一部を更新、有効化、無効化、または実行する。
- ログ、通知、アラートの管理:
    
    - アプリケーションのログレベルを追加、更新、取得する。
    - アプリケーションまたはインスタンスのログファイルをダウンロードする。
    - 通知を作成、更新、取得する。
    - 通知を既読または未読としてマークする。
    - アプリケーションによってトリガーされるアラートを作成、更新、削除する。
    - アラートとアラート履歴を取得する。
- ロードバランサーの管理:
    
    - ロードバランサーを作成、更新、削除する。
    - 組織内のロードバランサーをリストする。
    - ロードバランサールールをテストして、入力に適用されるルールの数を返す。
- VPC、VPN、TGW の管理:
    
    - VPC を作成、更新、リスト、削除する。
    - VPN 接続を作成、削除する。
    - Anypoint Platform 組織への複数の AWS トランジットゲートウェイアタッチメントを追加、変更、削除する。
- 永続的なキューの管理:
    
    - 永続的なキューの統計情報を取得する。
    - 永続的なキューからエントリをクリアする。
- 以下に関する追加情報を取得する:
    
    - サポート対象の Mule バージョン
    - 現在の組織 (使用状況の統計情報を含む)
    - ワーカー (スレッドダンプとワーカー領域を含む)
    - ユーザー (権限を含む)
    - 使用可能なドメイン名

サポートされているリソース、メソッド、必須プロパティ、予想される応答の対話型リファレンスについては、 [「CloudHub API」](https://anypoint.mulesoft.com/exchange/portals/anypoint-platform/f1e97bc6-315a-4490-82a7-23abe036327a.anypoint-platform/cloudhub-api/)​を参照してください。

CloudHub API は、クラウドベースバージョンの Runtime Manager にデプロイされたアプリケーションのみを管理します。 API を使用したオンプレミスアプリケーションの管理については、 [「Runtime Manager REST サービス」](https://anypoint.mulesoft.com/exchange/portals/anypoint-platform/f1e97bc6-315a-4490-82a7-23abe036327a.anypoint-platform/arm-rest-services)​を参照してください。

## [](#cloudhub-api-の使用)CloudHub API の使用

アプリケーションの操作に慣れてから開始してください。

CloudHub API ではどの HTTP クライアントでも使用できます。 Java を使用する場合は、JSON 用の [Jackson](https://github.com/codehaus/jackson)​ がサポートされている [Jersey クライアント](https://jersey.github.io/)​または [HttpClient](http://hc.apache.org/httpclient-3.x/index.html)​ を使用してください。

CloudHub API の操作にアクセスするには、以下を行う必要があります。

1. API を使用して認証するには認証ベアラートークン (​AUTH\_BEARER\_TOKEN​) を生成します。
    
    アクセストークンを取得するには、組織のシステム管理者ロールが割り当てられたユーザーの Anypoint Platform ユーザー名とパスワードが必要です。 [「アクセス管理 API」](https://anypoint.mulesoft.com/exchange/portals/anypoint-platform/f1e97bc6-315a-4490-82a7-23abe036327a.anypoint-platform/access-management-api/minor/1.0/pages/home/)​の [「認証」](https://anypoint.mulesoft.com/exchange/portals/anypoint-platform/f1e97bc6-315a-4490-82a7-23abe036327a.anypoint-platform/access-management-api/minor/1.0/pages/Authentication/)​を参照してください。
    
    ユーザー名により、アクセスする環境が指定されます。 たとえば、ユーザー名が ​`consuela`​ で環境が ​`Development`​ の場合、ユーザー名は ​`consuela@Development`​ になります。 環境を指定しない場合の API のデフォルトは ​`Production`​ です。
2. 組織 ID (​ORG\_ID​) を取得します。
    
    [「アクセス管理 API」](https://anypoint.mulesoft.com/exchange/portals/anypoint-platform/f1e97bc6-315a-4490-82a7-23abe036327a.anypoint-platform/access-management-api/minor/1.0/pages/home/)​の [`/api/me`](https://anypoint.mulesoft.com/exchange/portals/anypoint-platform/f1e97bc6-315a-4490-82a7-23abe036327a.anypoint-platform/access-management-api/minor/1.0/console/method/%234250/)​ エンドポイントを参照してください。
3. 環境 ID (​ENV\_ID​) を取得します。
    
    [「アクセス管理 API」](https://anypoint.mulesoft.com/exchange/portals/anypoint-platform/f1e97bc6-315a-4490-82a7-23abe036327a.anypoint-platform/access-management-api/minor/1.0/pages/home/)​の [`/api/organizations/_ORG_ID_/environments`​_ORG\_ID_](https://anypoint.mulesoft.com/exchange/portals/anypoint-platform/f1e97bc6-315a-4490-82a7-23abe036327a.anypoint-platform/access-management-api/minor/1.0/console/method/%234762/)​ エンドポイントを参照してください。

### [](#アプリケーションのリストの取得)アプリケーションのリストの取得

CloudHub にデプロイされたアプリケーションのリストを取得するには、次の ​`curl`​ コマンドを実行します。

curl -X GET \\
  --url https://anypoint.mulesoft.com/cloudhub/api/applications \\
  -H 'authorization: Bearer AUTH\_BEARER\_TOKEN' \\
  -H 'X-ANYPNT-ENV-ID: ENV\_ID' \\
  -H 'X-ANYPNT-ORG-ID: ORG\_ID'

## [](#データ形式)データ形式

型を返すまたは受け入れるリソースやメソッドは、JSON データ形式を使用します。 アプリケーションの取得要求への応答として JSON 形式で受信するデータの例を示します。

```json
{
  "versionId": "xxxxxxxx",
  "domain": "hello",
  "fullDomain": "hello.us-e1.cloudhub.io",
  "properties": {
    "foo":"bar"
  },
  "propertiesOptions": {},
  "status": "STARTED",
  "workers": {
    "type": {
      "name": "Micro",
      "weight": 0.1,
      "cpu": "0.1 vCores",
      "memory": "500 MB memory"
    },
    "amount": 1,
    "remainingOrgWorkers": 223.7,
    "totalOrgWorkers": 1000.0
  },
  "workerStatuses": [
    {
      "id": "i-xxxxxxxx",
      "host": "xxx.xxx.xxx.xxx",
      "port": 0,
      "status": "STARTED",
      "deployedRegion": "us-east-1",
      "staticIPEnabled": false
    }
  ],
  "lastUpdateTime": 1589868960908,
  "fileName": "hello.zip",
  "muleVersion": {
    "version": "4.3.0",
    "updateId": "xxxxxxxx",
    "latestUpdateId": "xxxxxxxx",
    "endOfSupportDate": 1633737600000
  },
  ...
}
```

## [](#レート制限)レート制限

CloudHub 管理 API は、グローバル使用制限を適用しますが、いくつかの例外があります。

### [](#cloudhub-管理-api-のグローバルレート制限)CloudHub 管理 API のグローバルレート制限

[グローバルレート制限の例外](#グローバルレート制限の例外)​に示す例外を除いた CloudHub 管理 API エンドポイントのレート制限を下表に示します。

アプリケーションがレート制限に達すると、CloudHub は 503 状況コードを返します。

<table class="tableblock frame-all grid-all stretch">
<colgroup>
<col style="width: 28.5714%;">
<col style="width: 28.5714%;">
<col style="width: 28.5714%;">
<col style="width: 14.2858%;">
</colgroup>
<thead>
<tr>
<th class="tableblock halign-left valign-top">エンドポイント</th>
<th class="tableblock halign-left valign-top">コントロールプレーン</th>
<th class="tableblock halign-left valign-top">クライアント IP アドレスごとのレート制限</th>
<th class="tableblock halign-left valign-top">状況コード</th>
</tr>
</thead>
<tbody>
<tr>
<td class="tableblock halign-left valign-top" rowspan="3"><p class="tableblock">指定されたエンドポイント以外のすべてのエンドポイント</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">米国</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">75 要求/秒</p></td>
<td class="tableblock halign-left valign-top" rowspan="3"><p class="tableblock"><code>503</code></p></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock">EU</p></td>
<td class="tableblock halign-left valign-top" rowspan="2"><p class="tableblock">25 要求/秒</p></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock">Government Cloud</p></td>
</tr>
</tbody>
</table>

### [](#グローバルレート制限の例外)グローバルレート制限の例外

[CloudHub 管理 API のグローバルレート制限](#cloudhub-管理-api-のグローバルレート制限)​の例外を下表に示します。

アプリケーションがレート制限に達すると、CloudHub は下表の状況コードを返します。

<table class="tableblock frame-all grid-all stretch">
<colgroup>
<col style="width: 28.5714%;">
<col style="width: 28.5714%;">
<col style="width: 28.5714%;">
<col style="width: 14.2858%;">
</colgroup>
<thead>
<tr>
<th class="tableblock halign-left valign-top">エンドポイント</th>
<th class="tableblock halign-left valign-top">コントロールプレーン</th>
<th class="tableblock halign-left valign-top">クライアント IP アドレスごとのレート制限</th>
<th class="tableblock halign-left valign-top">状況コード</th>
</tr>
</thead>
<tbody>
<tr>
<td class="tableblock halign-left valign-top" colspan="4"><p class="tableblock"><code>/api</code> ​<strong>下のエンドポイント</strong>​</p></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top" rowspan="3"><p class="tableblock"><code>/notifications</code></p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">米国</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">75 要求/分</p></td>
<td class="tableblock halign-left valign-top" rowspan="3"><p class="tableblock"><code>503</code></p></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock">EU</p></td>
<td class="tableblock halign-left valign-top" rowspan="2"><p class="tableblock">25 要求/分</p></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock">Government Cloud</p></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top" colspan="4"><p class="tableblock"><code><strong>v2/applications/{domain}</strong></code> ​<strong>下のエンドポイント</strong></p></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock"><code>/logs</code>​</p></td>
<td class="tableblock halign-left valign-top" rowspan="4"><p class="tableblock">すべて</p></td>
<td class="tableblock halign-left valign-top" rowspan="3"><p class="tableblock">10 要求/秒</p></td>
<td class="tableblock halign-left valign-top" rowspan="3"><p class="tableblock"><code>429</code></p></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock"><code>/deployments/{deploymentId}/logs</code></p></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock"><code>/instances/{instanceId}/logs</code></p></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock"><code>/instances/{instanceId}/log-file</code></p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">1 要求/分</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock"><code>500</code></p></td>
</tr>
</tbody>
</table>

## [](#状況コードとエラー処理)状況コードとエラー処理

CloudHub API をコールすると、次の状況コードが返されます。

<table class="tableblock frame-all grid-all stretch">
<colgroup>
<col style="width: 16.6666%;">
<col style="width: 83.3334%;">
</colgroup>
<thead>
<tr>
<th class="tableblock halign-left valign-top">状況コード</th>
<th class="tableblock halign-left valign-top">説明</th>
</tr>
</thead>
<tbody>
<tr>
<td class="tableblock halign-left valign-top"><div class="content"><div class="paragraph">
<p>200</p>
</div></div></td>
<td class="tableblock halign-left valign-top"><div class="content"><div class="paragraph">
<p>操作に成功した。</p>
</div></div></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><div class="content"><div class="paragraph">
<p>201</p>
</div></div></td>
<td class="tableblock halign-left valign-top"><div class="content"><div class="paragraph">
<p>リソース (アプリケーションなど) が作成された。</p>
</div>
<div class="paragraph">
<p><code>Location</code>​ ヘッダーには、リソースの場所が含まれています。</p>
</div></div></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><div class="content"><div class="paragraph">
<p>404</p>
</div></div></td>
<td class="tableblock halign-left valign-top"><div class="content"><div class="paragraph">
<p>リソースが見つからなかった。</p>
</div></div></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><div class="content"><div class="paragraph">
<p>409</p>
</div></div></td>
<td class="tableblock halign-left valign-top"><div class="content"><div class="paragraph">
<p>リソース (サーバー、サーバーグループ、デプロイメントなど) の作成時に同じ名前のリソースがすでに存在していた。</p>
</div></div></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><div class="content"><div class="paragraph">
<p>429</p>
</div></div></td>
<td class="tableblock halign-left valign-top"><div class="content"><div class="paragraph">
<p>レート制限に達したために操作に失敗した。</p>
</div></div></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><div class="content"><div class="paragraph">
<p>500</p>
</div></div></td>
<td class="tableblock halign-left valign-top"><div class="content"><div class="paragraph">
<p>操作に失敗した。</p>
</div>
<div class="paragraph">
<p>詳細は、HTTP 本文を参照してください。</p>
</div></div></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><div class="content"><div class="paragraph">
<p>503</p>
</div></div></td>
<td class="tableblock halign-left valign-top"><div class="content"><div class="paragraph">
<p>一時的なじょうたい (例: サーバーの過負荷、レート制限に達した) のために操作に失敗した。</p>
</div>
<div class="paragraph">
<p>操作を再試行します。</p>
</div></div></td>
</tr>
</tbody>
</table>

エラーが発生した場合 (500 状況コードなど)、HTTP 応答には JSON 応答とエラーメッセージが含まれます。

```json
500
Content-Type: application/json
Server: Apache-Coyote/1.1
Date: Mon, 10 Aug 2015 00:12:55 GMT

{
  message : "Some error message."
}
```

## [](#関連情報)関連情報

- [CloudHub API](https://anypoint.mulesoft.com/exchange/portals/anypoint-platform/f1e97bc6-315a-4490-82a7-23abe036327a.anypoint-platform/cloudhub-api/)
- [アクセス管理 API](https://anypoint.mulesoft.com/exchange/portals/anypoint-platform/f1e97bc6-315a-4490-82a7-23abe036327a.anypoint-platform/access-management-api/)
- [デプロイメントオプション](https://docs.mulesoft.com/jp/runtime-manager/deployment-strategies)
- [CloudHub へのデプロイ](https://docs.mulesoft.com/jp/cloudhub/deploying-to-cloudhub)
- [CloudHub でのアプリケーションの管理](https://docs.mulesoft.com/jp/cloudhub/managing-applications-on-cloudhub)
- [CloudHub のアプリケーションの開発](https://docs.mulesoft.com/jp/cloudhub/developing-applications-for-cloudhub)
- [アプリケーションとサーバーの監視](https://docs.mulesoft.com/jp/runtime-manager/monitoring)