Fabric Cloud Routerの管理
前提条件
Authenticate - OAuth2認証のためのユーザー認証情報、クライアントID、クライアントシークレットを送信します。OAuth APIを呼び出して認証情報を検証および認証する方法については、API Authenticationを参照してください。
Fabric Cloud Router の検索と取得
この API リクエストは、提供された検索条件に一致する Fabric Cloud Router インスタンスを取得します。リクエストの本文に条件を指定して、/fabric/v4/routers/search エンドポイントに POST リクエストを送信します。
| POST /fabric/v4/routers/search | |
|---|---|
| Method | POST |
| URL or Endpoint | /fabric/v4/routers/search |
| Headers | Authorization, Content-Type |
| Path Parameters | Not applicable |
| Query Parameters | Not applicable |
| Body Parameters | filter, pagination, sort |
サンプル curl リクエスト:
curl -X POST 'http: //api.equinix.com/fabric/v4/routers/search'
-H 'content-type: application/json'
-H 'authorization: Bearer <token>'
-d '{
"filter": {
"and": [
{
"property": "/name",
"operator": "LIKE",
"values": [
"%Test%"
]
},
{
"property": "/state",
"operator": "=",
"values": [
"PROVISIONED"
]
},
{
"property": "/project/projectId",
"operator": "=",
"values": [
"995072000433550"
]
},
{
"property": "/location/metroCode",
"operator": "=",
"values": [
"SV"
]
}
]
},
"pagination": {
"offset": 0,
"limit": 20
},
"sort": [
{
"direction": "DESC",
"property": "/changeLog/createdDateTime"
}
]
}'
注目すべきボディ・パラメーター
-
filter(必須) object - 検索条件を定義するオブジェクトです。 -
and(必須) array[object] - 配列内の検索オブジェクトに適用される論理演算子として機能する配列オブジェクト。検索対象は以下のとおりです:property(必須) string - 検索フィールドパラメータ。プロパティ値によって、適用可能な演算子と値のリストが決まることに注意してください。適用可能な値:"/name"、"/uuid"、"/state"、"/location/metroCode"、"/location/metroName"、"/package/code"および全カテゴリ検索"\*"。operator(必須) string - 検索フィールドパラメータ演算子。適用可能な値:"=","!=",">",">=","<","<=",BETWEEN,LIKE,IN,"NOT BETWEEN","NOT LIKE","NOT IN".value(必須) array[文字列] -検索フィールドのパラメータ値。
-
paginationobject -offsetの検索結果のページ分割設定を含むオプションのオブジェクトです。integer_ とlimitinteger_フィールドを持ちます。 -
sortobject -directionで検索結果のソート設定を定義するオプションのオブジェクトです。string_ とproperty文字列フィールド。
検索可能なプロパティ、ページネーションの制限、およびソート可能なプロパティの完全なリストについては、API リファレンス を参照してください。
回答例
{
"pagination": {
"offset": 0,
"limit": 20,
"total": 1,
"next": "/search?offset=4&limit=2",
"previous": "/search?offset=0&limit=2"
},
"data": [
{
"href": "https://api.equinix.com/fabric/v4/routers/201b7346-a9eb-42fe-ae7a-08148c71928d",
"uuid": "201b7346-a9eb-42fe-ae7a-08148c71928d",
"state": "PROVISIONED",
"type": "XF_ROUTER",
"name": "My-Fabric-Cloud-Router",
"location": {
"metroCode": "HH"
},
"package": {
"code": "LAB"
},
"order": {
"purchaseOrderNumber": "1-129105284100"
},
"project": {
"projectId": "12345"
},
"notifications": [
{
"type": "ALL",
"emails": [
"abc@abc.com"
]
}
],
"account": {
"accountNumber": 123
},
"bgpIpv4RoutesCount": 0,
"bgpIpv6RoutesCount": 0,
"connectionsCount": 0,
"changeLog": {
"createdBy": "abc@xyz.com",
"createdByFullName": "abc",
"createdByEmail": "abc@xyz.com",
"createdDateTime": "2021-09-24T06:59:46Z"
}
}
]
}
指定 Fabric Cloud Router の取得
この API リクエストは、指定した Fabric Cloud Router の詳細を取得します。リクエストのパスに uuid を指定して、/fabric/v4/routers/{uid} エンドポイントに GET リクエストを送信します。
| GET /fabric/v4/routers/{uuid} | |
|---|---|
| Method | GET |
| URL or Endpoint | /fabric/v4/routers/{uuid} |
| Headers | Authorization, Content-Type |
| Path Parameters | uuid |
| Query Parameters | Not applicable |
| Body Parameters | Not applicable |
サンプル curl リクエスト:
curl -X
GET 'https://api.equinix.com/fabric/v4/routers/{router_uuid}'
-H 'content-type: application/json'
-H 'authorization: Bearer <token>'
回答例
{
"href": "https://api.equinix.com/fabric/v4/routers/201b7346-a9eb-42fe-ae7a-08148c71928d",
"uuid": "201b7346-a9eb-42fe-ae7a-08148c71928d",
"state": "PROVISIONED",
"type": "XF_ROUTER",
"name": "My-Fabric-Cloud-Router",
"location": {
"metroCode": "HH"
},
"package": {
"code": "LAB"
},
"order": {
"purchaseOrderNumber": "1-129105284100"
},
"project": {
"projectId": "12345"
},
"notifications": [
{
"type": "ALL",
"emails": [
"abc@abc.com"
]
}
],
"account": {
"accountNumber": 123
},
"bgpIpv4RoutesCount": 0,
"bgpIpv6RoutesCount": 0,
"distinctIpv4PrefixesCount": 4,
"distinctIpv6PrefixesCount": 4,
"connectionsCount": 0,
"changeLog": {
"createdBy": "abc@xyz.com",
"createdByFullName": "abc",
"createdByEmail": "abc@xyz.com",
"createdDateTime": "2021-09-24T06:59:46Z"
}
}
ファブリック・クラウド・ルーターを更新する
Fabric Cloud Router を更新するには、/fabric/v4/routers/{routerId} エンドポイントに PATCH リクエストを送信し、リクエスト本文に更新するパラメータを指定します。名前を更新したり、パッケージを変更したりできます。
| PATCH /fabric/v4/routers/{uuid} | |
|---|---|
| Method | PATCH |
| URL or Endpoint | /fabric/v4/routers/{uuid} |
| Headers | Authorization, Content-Type |
| Path Parameters | uuid |
| Query Parameters | Not applicable |
| Body Parameters | op, path, value |
サンプル curl リクエスト:
curl -X
PATCH 'https: //api.equinix.com/fabric/v4/routers/{router_uuid}'
-H 'content-type: application/json'
-H 'authorization: Bearer <token>'
-d '[
{
"op": "replace",
"path": "/name",
"value": "Cloud-Router-2"
}
]'
注目すべきボディ・パラメーター
op(必須) string - 更新要求タイプ。適用可能な値:replace、add、またはremove。path(必須) string - 更新する値のパラメータパス。適用可能な値:"/name"または"/package/code"。value(必須) string - 新しいパラメータ値。
更新可能なフィールドとその値の完全なリストについては、API リファレンス を参照してください。
ファブリック・クラウド・ルーターの削除
Fabric Cloud Router を削除するには、/fabric/v4/routers/{uid} エンドポイントに DELETE リクエストを送信します。パスには削除したいルーターを uuid で指定します。
| DELETE /fabric/v4/routers/{uuid} | |
|---|---|
| Method | DELETE |
| URL or Endpoint | /fabric/v4/routers/{uuid} |
| Headers | Authorization, Content-Type |
| Path Parameters | uuid |
| Query Parameters | Not applicable |
| Body Parameters | Not applicable |
サンプル curl リクエスト:
curl -X
DELETE 'https://api.equinix.com/fabric/v4/routers/{router_uuid}'
-H 'content-type: application/json'
-H 'authorization: Bearer <token>'