Skip to main content

Gestion des routeurs du Fabric Cloud Router

Conditions préalables

Authentifier - Soumettez vos informations d'identification de l'utilisateur, l'ID du client et le secret du client pour l'authentification OAuth2. Reportez-vous à API Authentication pour savoir comment appeler l'API OAuth afin de valider et d'authentifier vos informations d'identification.

Recherche et récupération des routeurs Fabric Cloud Router

Cette demande d'API récupère les instances de Fabric Cloud Router qui correspondent aux critères de recherche fournis. Envoyez une requête POST au point de terminaison /fabric/v4/routers/search, en spécifiant vos critères dans le corps de la requête.

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

Exemple de requête 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"
        }
    ]
}'

Paramètres corporels remarquables :

  • 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.

Pour une liste complète des propriétés consultables, des limites de pagination et des propriétés triables, consultez la [référence API] (/api-catalog/fabricv4#operation/searchCloudRouters).

Exemple de réponse :

{
    "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"
            }
        }
    ]
}

Obtenir la spécification d'un routeur Fabric Cloud Router

Cette demande d'API récupère les détails d'un routeur Cloud Fabric spécifié, envoyez une demande GET au point de terminaison /fabric/v4/routers/{uuid} avec l'uuuid dans le chemin de la demande.

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

Exemple de requête curl :

curl -X
GET 'https://api.equinix.com/fabric/v4/routers/{router_uuid}'
-H 'content-type: application/json'
-H 'authorization: Bearer <token>'

Exemple de réponse :

{
    "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"
    }
}

Mise à jour d'un routeur Fabric Cloud Router

Pour mettre à jour un Fabric Cloud Router, envoyez une requête PATCH au point de terminaison /fabric/v4/routers/{routerId} avec les paramètres que vous mettez à jour dans le corps de la requête. Vous pouvez mettre à jour le nom ou modifier le paquet.

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

Exemple de requête 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"
    }
]'

Paramètres corporels remarquables :

  • 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.

Pour une liste complète des champs actualisables et de leurs valeurs, consultez la [référence API] (/api-catalog/fabricv4#operation/updateCloudRouterByUuid).

Supprimer le Fabric Cloud Router

Pour supprimer un Fabric Cloud Router, envoyez une requête DELETE au point de terminaison /fabric/v4/routers/{uuid}. Spécifiez le routeur que vous voulez supprimer par uuid dans le chemin.

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

Exemple de requête curl :

curl -X
DELETE 'https://api.equinix.com/fabric/v4/routers/{router_uuid}'
-H 'content-type: application/json'
-H 'authorization: Bearer <token>'
Cette page vous a-t-elle été utile ?