使用服务令牌连接Network Edge设备
使用服务令牌使用结构API在Network Edge设备和结构上的网络资源之间建立连接。
Fabric API 先决条件
-
身份验证 - 提交您的 OAuth2 用户凭据、客户端 ID 和客户端密钥 身份验证。有关如何调用OAuth API以验证和验证凭据的说明,请参阅API身份验证。
-
使用获取虚拟设备或获取虚拟设备{uuid}检索Network Edge设备信息。如果是冗余设备,请选择主设备或辅助设备的唯一ID。同样,对于群集设备,请选择或的唯一ID
node0``node1。即使您的设备是冗余/群集,也只有一个连接。 -
呼叫"获取所有服务令牌"终结点以获取可用的服务令牌以及允许的连接设置。
使用服务令牌进行连接
要使用服务令牌在Network Edge虚拟设备与结构上的另一个网络位置之间创建连接,请向终结点发送POST请求/fabric/v4/connections。指定请求正文中的虚拟设备,服务令牌和连接配置。网络位置的详细信息由服务令牌提供。
服务令牌可以发送给多个接收者,并且对于其中任何一个接收者来说都是一次有效的。
| POST /fabric/v4/connections | |
|---|---|
| 方法 | POST |
| 端点 | /fabric/v4/connections |
| 标题 | Authorization,Content-Type |
| 路径参数 | 不适用 |
| 查询参数 | 不适用 |
| 身体参数 | type``name,,order redundancy bandwidth,,aSide,zSide,notifications |
在这个例子中,a 侧是Network Edge设备,服务令牌用于 z 侧目的地。
cURL 请求示例:
curl -X
POST 'https://api.equinix.com/fabric/v4/connections'
-H 'content-type: application/json'
-H 'authorization: Bearer <token>'
-d '{
"type": "EVPL_VC",
"name": "Conn-1",
"order": {
"purchaseOrderNumber": "1-129105284100"
},
"bandwidth": 1000,
"aSide": {
"accessPoint": {
"type": "VD",
"virtualDevice": {
"type": "EDGE",
"uuid": "fd5342f3-d067-4683-a24f-be952279630b"
},
"interface": {
"type": "NETWORK",
"id": 5
}
}
},
"zSide": {
"serviceToken": {
"uuid": "20d32a80-0d61-4333-bc03-707b591ae2f4"
}
},
"notifications": [
{
"type": "ALL",
"emails": [
"test@equinix.com",
"test2@equinix.com"
]
}
]
}'
请求正文中包含的参数特定于此示例。有关参数及其说明的完整列表, 请参见API参考。
示例回答:
{
"type": "EVPL_VC",
"href": "https://api.equinix.com/fabric/v4/connections/ebc37e2e-c36b-4e93-86a4-fc4efce7abc8",
"uuid": "ebc37e2e-c36b-4e93-86a4-fc4efce7abc8",
"name": "Test ST",
"state": "ACTIVE",
"operation": {
"providerStatus": "AVAILABLE",
"equinixStatus": "PROVISIONED"
},
"notifications": [
{
"type": "ALL",
"emails": [
"testNEuser2@equinix.com"
]
}
],
"account": {
"accountNumber": 270235,
"orgId": 92794,
"globalOrgId": "0016u000003JZ55AAG"
},
"changeLog": {
"createdBy": "testNEuser2",
"createdDateTime": "2022-10-05T19:37:12.748Z",
"updatedBy": "testNEuser2",
"updatedDateTime": "2022-10-05T19:37:12.748Z"
},
"bandwidth": 50,
"redundancy": {
"group": "b64dad2a-2763-4084-bc50-b36ef4f67137",
"priority": "PRIMARY"
},
"isRemote": true,
"direction": "INTERNAL",
"aSide": {
"accessPoint": {
"interface": {
"uuid": "11fd6067-149f-4142-a5b4-54a8dd6f53fe",
"id": 6,
"type": "CLOUD"
},
"type": "VD",
"account": {
"accountNumber": 270217,
"organizationName": "eqx-nfv"
},
"location": {
"region": "AMER",
"metroName": "Ashburn",
"metroCode": "DC"
},
"virtualDevice": {
"href": "https://api.equinix.com/ne/v1/devices/3539f96c-7f67-4696-90f3-7b6d2fdcde5f",
"uuid": "3539f96c-7f67-4696-90f3-7b6d2fdcde5f",
"name": "testing1234",
"type": "EDGE"
}
}
},
"zSide": {
"serviceToken": {
"uuid": "e05f4f23-d098-4d7c-a9ca-c2897b465107",
"account": {
"orgId": 92794
}
},
"accessPoint": {
"type": "COLO",
"account": {
"accountNumber": 270235,
"organizationName": "testNEuser2-270235"
},
"location": {
"region": "AMER",
"metroName": "Ashburn",
"metroCode": "DC"
},
"port": {
"href": "https://qa3api.corp.equinix.com/fabric/v4/ports/c791f8cb-59d0-9d00-8ce0-306a5c00a4ee",
"uuid": "c791f8cb-59d0-9d00-8ce0-306a5c00a4ee",
"name": "testNEuser2-DC6-NL-Dot1q-STD-SEC-10G-JN-216"
},
"linkProtocol": {
"type": "DOT1Q",
"vlanTag": 553
}
}
}
}
响应有效负载包括在请求正文中定义的配置参数。有关可能的参数及其说明的完整列表, 请参见API参考。
监控您的连接
使用Get Specified Connection API端点监视连接状态。