Gerenciando roteadores Fabric Cloud
Pré-requisitos
Autenticar - Envie suas credenciais de usuário, ID do Cliente e Segredo do Cliente para autenticação OAuth2. Consulte Autenticação de API para obter instruções sobre como chamar a API OAuth para validar e autenticar suas credenciais.
Pesquisar e recuperar roteadores Fabric Cloud
Esta solicitação de API recupera instâncias do Fabric Cloud Router que correspondem aos critérios de pesquisa fornecidos. Envie uma solicitação POST para o endpoint /fabric/v4/routers/search, especificando seus critérios no corpo da solicitação.
| 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 |
Exemplo de solicitar de 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"
}
]
}'
Parâmetros corporais notáveis:
-
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.
-
paginationobject - Optional object containing search results pagination settings withoffsetinteger andlimitinteger fields. -
sortobject - Optional object that defines your search result sorting settings withdirectionstring andpropertystring fields.
Para obter uma lista completa das propriedades pesquisáveis, limites de paginação e propriedades classificáveis, consulte a referência da API.
Exemplo de resposta:
{
"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"
}
}
]
}
Obtenha o roteador Fabric Cloud especificado
Esta solicitação de API recupera detalhes de um Fabric Cloud Router específico. Envie uma solicitação GET para o endpoint /fabric/v4/routers/{uuid} com o uuid no caminho da solicitação.
| 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 |
Exemplo de solicitar de curl:
curl -X
GET 'https://api.equinix.com/fabric/v4/routers/{router_uuid}'
-H 'content-type: application/json'
-H 'authorization: Bearer <token>'
Exemplo de resposta:
{
"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"
}
}
Atualizar um roteador Fabric Cloud
Para atualizar um Fabric Cloud Router, envie uma solicitação PATCH para o endpoint /fabric/v4/routers/{routerId} com os parâmetros que você está atualizando no corpo da solicitação. Você pode atualizar o nome ou alterar o pacote.
| 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 |
Exemplo de solicitar de 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"
}
]'
Parâmetros corporais notáveis:
op(required) string - Update request type. Applicable values:replace,add, orremove.path(required) string - Parameter path of the value you are updating. Applicable values:"/name"or"/package/code".value(required) string - The new parameter value.
Para obter uma lista completa dos campos atualizáveis e seus valores, consulte a referência da API.
Excluir o roteador de nuvem de tecido
Para excluir um Fabric Cloud Router, envie uma solicitação DELETE para o endpoint /fabric/v4/routers/{uuid}. Especifique o roteador que deseja excluir pelo uuid no caminho.
| 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 |
Exemplo de solicitar de curl:
curl -X
DELETE 'https://api.equinix.com/fabric/v4/routers/{router_uuid}'
-H 'content-type: application/json'
-H 'authorization: Bearer <token>'