使用服务令牌连接到目标
您可以使用服务令牌中预定义的信息,在您的资产或第三方之间建立连接。服务令牌可以同时为连接的 A 端和 Z 端颁发。
例如,您可以创建从端口到由服务令牌提供的目的地的连接。可以为端口、Network Edge虚拟设备或网络颁发 z 端服务令牌。

先决条件
-
身份验证 - 请提交您的用户凭据、客户端 ID 和客户端密钥以进行 OAuth2 身份验证。有关如何调用 OAuth API 来验证和确认您的凭据的说明,请参阅API 身份验证。
-
确定您的 A 端端口信息。使用 获取所有端口 端点获取相关端口信息。
-
从服务提供商处获取 z 端服务令牌详细信息。调用创建连接 API 需要此信息。
创建从 DOT1Q 端口到服务令牌的连接
要从 DOT1Q 端口创建到服务令牌定义目标的连接,请向 /fabric/v4/connections 端点发送 POST 请求。在请求正文中指定 A 端端口信息和 Z 端服务令牌详细信息。
注意
服务令牌可以发送给多个接收者,并且每个接收者只能使用一次。
| POST /fabric/v4/connections | |
|---|---|
| Method | POST |
| Endpoint | /fabric/v4/connections |
| Headers | Authorization, Content-Type |
| Path Parameters | Not applicable |
| Query Parameters | Not applicable |
| Body Parameters | type, name, order, bandwidth, aSide, zSide, notifications |
要在生产环境中安全地验证此请求而不创建连接,请参阅生产环境中的测试(API 试运行)。
示例 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": "COLO",
"port": {
"uuid": "a867f685-41b0-1b07-6de0-320a5c00abdd"
},
"linkProtocol": {
"type": "DOT1Q",
"vlanTag": 1001
}
}
},
"zSide": {
"serviceToken": {
"uuid": "20d32a80-0d61-4333-bc03-707b591ae2f4"
}
},
"notifications": [
{
"type": "ALL",
"emails": [
"test@equinix.com",
"test2@equinix.com"
]
}
]
}'
请求正文中包含的参数仅适用于此示例。有关参数及其说明的完整列表,请参阅API 参考。
示例响应:
{
"href": "https://api.equinix.com/fabric/v4/connections/3a58dd05-f46d-4b1d-a154-2e85c396ea62",
"type": "EVPL_VC",
"uuid": "3a58dd05-f46d-4b1d-a154-2e85c396ea62",
"state": "PROVISIONING",
"name": "Conn-1",
"order": {
"purchaseOrderNumber": "1-129105284100",
"billingTier": "Up to 1 Gbps"
},
"bandwidth": 1000,
"aSide": {
"accessPoint": {
"type": "COLO",
"port": {
"href": "https://api.equinix.com/fabric/v4/ports/a867f685-41b0-1b07-6de0-320a5c00abdd",
"type": "XF_PORT",
"uuid": "a867f685-41b0-1b07-6de0-320a5c00abdd"
},
"linkProtocol": {
"type": "DOT1Q",
"vlanTag": 1001
}
}
},
"zSide": {
"serviceToken": {
"href": "https://api.equinix.com/fabric/v4/serviceTokens/25acdea5-1eeb-4f0b-8ca9-6c505f46847d",
"uuid": "25acdea5-1eeb-4f0b-8ca9-6c505f46847d"
},
"accessPoint": {
"location": {
"metroHref" : "https://api.equinix.com/fabric/v4/metros/DC",
"region": "AMER",
"metroName": "Ashburn",
"metroCode": "DC"
},
"port": {
"type": "XF_PORT",
"href": "https://api.equinix.com/fabric/v4/ports/c5720fcc-4ae7-ae7e-13e0-306a5c00adaf",
"uuid": "c5720fcc-4ae7-ae7e-13e0-306a5c00adaf",
"name": "eqx-nfv-CX-DC6-L-Dot1q-BO-10G-PRI-JUN-7"
},
"linkProtocol": {
"type": "DOT1Q",
"vlanTag": 3132
}
}
},
"notifications": [
{
"type": "ALL",
"emails": [
"test@equinix.com",
"test2@equinix.com"
]
}
],
"operation": {
"equinixStatus": "PROVISIONING",
"providerStatus": "NOT_AVAILABLE"
},
"changeLog": {
"createdDateTime": "2021-07-15T19:30:29.526Z"
}
}
响应有效负载包含在请求正文中定义的配置参数。有关所有可用参数及其说明的完整列表,请参阅API 参考。
创建从 QINQ端口到服务令牌的连接
要从 QINQ 端口创建到服务令牌定义的目标的连接,请向 /fabric/v4/connections 端点发送 POST 请求。在请求正文中指定 A 端端口信息和 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": "COLO",
"port": {
"uuid": "a867f685-41b0-1b07-6de0-320a5c00abdd"
},
"linkProtocol": {
"type": "QINQ",
"vlanCTag": 1001,
"vlanSTag": 1002
}
}
},
"zSide": {
"serviceToken": {
"uuid": "20d32a80-0d61-4333-bc03-707b591ae2f4"
}
},
"notifications": [
{
"type": "ALL",
"emails": [
"test@equinix.com",
"test2@equinix.com"
]
}
]
}'
请求正文中包含的参数仅适用于此示例。有关参数及其说明的完整列表,请参阅API 参考。
监控连接
使用 Get 指定连接 端点来监控连接状态。