跳至内容

管理 Fabric 云路由器

先决条件

身份验证 - 请提交您的用户凭据、客户端 ID 和客户端密钥以进行 OAuth2 身份验证。有关如何调用 OAuth API 来验证和确认您的凭据的说明,请参阅API 身份验证

搜索和检索 Fabric 云路由器

此 API 请求用于检索符合指定搜索条件的 Fabric Cloud Router 实例。向 /fabric/v4/routers/search 端点发送 POST 请求,并在请求正文中指定您的搜索条件。

POST /fabric/v4/routers/search
MethodPOST
URL or Endpoint/fabric/v4/routers/search
HeadersAuthorization, Content-Type
Path ParametersNot applicable
Query ParametersNot applicable
Body Parametersfilter, 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 (required) object - The object that defines your search conditions.

  • and (required) array[object] - An array object that serves as the logical operator applied on the search objects in the array. You can search on:

    • property (required) string - Search field parameter. Note that the property value determines the list of applicable operators and values. Applicable values: "/name", "/uuid", "/state", "/location/metroCode", "/location/metroName", "/package/code" and an all-category search "\*".
    • operator (required) string - Search field parameter operator. Applicable values: "=", "!=", ">", ">=", "<", "<=", BETWEEN, LIKE, IN, "NOT BETWEEN", "NOT LIKE", "NOT IN".
    • value (required) array[string] - Search field parameter value.
  • pagination object - Optional object containing search results pagination settings with offset integer and limit integer fields.

  • sort object - Optional object that defines your search result sorting settings with direction string and property string fields.

有关可搜索属性、分页限制和可排序属性的完整列表,请参阅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 云路由器的详细信息,向 /fabric/v4/routers/{uuid} 端点发送 GET 请求,并在请求路径中使用 uuid

GET /fabric/v4/routers/{uuid}
MethodGET
URL or Endpoint/fabric/v4/routers/{uuid}
HeadersAuthorization, Content-Type
Path Parametersuuid
Query ParametersNot applicable
Body ParametersNot 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 路由器

要更新 Fabric 云路由器,请向 /fabric/v4/routers/{routerId} 端点发送 PATCH 请求,并在请求正文中附上要更新的参数。您可以更新名称或更改包名。

PATCH /fabric/v4/routers/{uuid}
MethodPATCH
URL or Endpoint/fabric/v4/routers/{uuid}
HeadersAuthorization, Content-Type
Path Parametersuuid
Query ParametersNot applicable
Body Parametersop, 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 (required) string - Update request type. Applicable values: replace, add, or remove.
  • path (required) string - Parameter path of the value you are updating. Applicable values: "/name" or "/package/code".
  • value (required) string - The new parameter value.

有关可更新字段及其值的完整列表,请参阅API 参考

删除 Fabric 云路由器

要删除 Fabric 云路由器,请向 /fabric/v4/routers/{uuid} 端点发送 DELETE 请求。在路径中通过 uuid 指定要删除的路由器。

DELETE /fabric/v4/routers/{uuid}
MethodDELETE
URL or Endpoint/fabric/v4/routers/{uuid}
HeadersAuthorization, Content-Type
Path Parametersuuid
Query ParametersNot applicable
Body ParametersNot applicable

示例 curl 请求:

curl -X
DELETE 'https://api.equinix.com/fabric/v4/routers/{router_uuid}'
-H 'content-type: application/json'
-H 'authorization: Bearer <token>'
此页面有帮助吗?