跳到主要内容

管理 Fabric Cloud Router

先决条件​

验证-提交您的用户凭据,客户端ID和客户端机密以进行OAuth2验证。有关如何致电OAuth API以验证和验证您的凭据的说明,请参阅API验证。

搜索和检索 Fabric Cloud Router​

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

发布/fabric/v4/routers/search
方法POST
URL 或端点/fabric/v4/routers/search
标题Authorization,Content-Type
路径参数不适用
查询参数不适用
身体参数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 对象-定义搜索条件的对象。

  • andarray[对象]:数组对象,用作应用于数组中搜索对象的逻辑运算符。您可以搜索:

    • property(必填)字符串-搜索字段参数。注意,属性值决定适用运算符和值的列表。适用值:"/name","/uuid","/state" "/location/metroCode" "/location/metroName",,"/package/code" 以及全类别搜索"\*"。
    • operator(必填)字符串-搜索字段参数运算符。适用值: "=","!=",">" ">=" "<",,"<=",BETWEEN,LIKE IN "NOT BETWEEN",,"NOT LIKE","NOT IN"。
    • valuearray[string]—搜索字段参数值。
  • pagination对象-包含带有 _整数_和limit _整数_字段的搜索结果分页设置的可选对象offset。

  • sort对象-定义搜索结果排序设置的可选对象,包含direction _字符串_和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的详细信息,并将请求发送GET至/fabric/v4/routers/{uuid}端点,请求路径中包含uuid。

获取/abric/v4/routers/{uuid}
方法GET
URL 或端点/fabric/v4/routers/{uuid}
标题Authorization,Content-Type
路径参数uuid
查询参数不适用
身体参数不适用

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 Cloud Router,请在请求正文中使用您正在更新的参数向端点发送PATCH请求/fabric/v4/routers/{routerId}。您可以更新名称或更改套餐。

patch /abric/v4/routers/{uuid}
方法补丁
URL 或端点/fabric/v4/routers/{uuid}
标题Authorization,Content-Type
路径参数uuid
查询参数不适用
身体参数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 (必填)字符串-更新请求类型。适用值:replace,add或remove。
  • path(必填)字符串-您要更新的值的参数路径。适用值:"/name"或"/package/code"。
  • value(必填)字符串-新参数值。

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

删除 Fabric Cloud Router​

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

删除/fabric/v4/routers/{uuid}
方法删除
URL 或端点/fabric/v4/routers/{uuid}
标题Authorization,Content-Type
路径参数uuid
查询参数不适用
身体参数不适用

curl 请求示例:

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