使用两个服务令牌进行连接
您可以使用服务令牌中预定义的信息,在您的资产或第三方之间建立连接。服务令牌可以同时为连接的 A 端和 Z 端颁发。
例如,您可以创建从由 a 端服务令牌定义的源到由 z 端服务令牌定义的目标的连接。
先决条件
-
身份验证 - 请提交您的用户凭据、客户端 ID 和客户端密钥以进行 OAuth2 身份验证。有关如何调用 OAuth API 来验证和确认您的凭据的说明,请参阅API 身份验证。
-
从服务提供商处获取 A 面服务令牌详细信息。
-
从提供商处获取 Z 端服务令牌详细信息。
调用创建连接 API 需要此信息。
创建从 A 侧到 Z 侧的服务令牌连接
要在两个服务令牌之间建立连接,请向 /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, redundancy, 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": "AST_TO_ZST_CONNECTION",
"order": {
"purchaseOrderNumber": "1-129105284100" },
"bandwidth": 100,
"redundancy": {
"priority": "PRIMARY" },
"aSide": {
"serviceToken": {
"uuid": "20d32a80-0d61-4333-bc03-707b591ae2f5" }
},
"zSide": {
"serviceToken": {
"uuid": "20d32a80-0d61-4333-bc03-707b591ae2f5" }
},
"notifications": [
{
"type": "ALL",
"emails": [
"test@equinix.com",
"test1@equinix.com" ]
}
]
}'
请求正文中包含的参数仅适用于此示例。有关参数及其说明的完整列表,请参阅API 参考。
示例响应:
{
"href": "https://api.equinix.com/fabric/v4/connections/b067f685-49b0-1a09-6fe0-360a5d00a",
"type": "EVPL_VC",
"uuid": "b067f685-49b0-1a09-6fe0-360a5d00a",
"name": "AST_TO_ZST_CONNECTION",
"state": "ACTIVE",
"operation": {
"providerStatus": "PROVISIONED",
"equinixStatus": "PROVISIONED" },
"notifications": [
{
"type": "ALL",
"emails": [
"test@equinix.com" ]
}
],
"account": {
"accountNumber": 201246,
"orgId": 92610,
"globalOrgId": "0017i000011X250AAC" },
"changeLog": {
"createdBy": "testuser",
"createdDateTime": "2022-05-16T07:50:49.749Z" },
"bandwidth": 100,
"redundancy": {
"group": "b067f685-49b0-1a09-6fe0-360a5d00afdg",
"priority": "PRIMARY" },
"isRemote": true,
"direction": "OUTGOING",
"aSide": {
"serviceToken": {
"href": "https://api.equinix.com/fabric/v4/serviceTokens/b067f685-49b0-1a09-6fe0-360a5d00afdg",
"uuid": "b067f685-49b0-1a09-6fe0-360a5d00afdg" },
"accessPoint": {
"location": {
"metroHref": "https://api.equinix.com/fabric/v4/metros/SV",
"metroCode": "SV" },
"port": {
"href": "https://api.equinix.com/fabric/v4/ports/b067f685-49b0-1a09-6fe0-360a5d00afdg",
"uuid": "b067f685-49b0-1a09-6fe0-360a5d00afdg" },
"linkProtocol": {
"type": "DOT1Q" }
}
},
"zSide": {
"serviceToken": {
"href": "https://api.equinix.com/fabric/v4/serviceTokens/b067f685-49b0-1a09-6fe0-360a5d00afdg",
"uuid": "b067f685-49b0-1a09-6fe0-360a5d00afdg" },
"accessPoint": {
"location": {
"metroHref": "https://api.equinix.com/fabric/v4/metros/SV",
"metroCode": "SV" },
"port": {
"href": "https://api.equinix.com/fabric/v4/ports/b067f685-49b0-1a09-6fe0-360a5d00afdg",
"uuid": "b067f685-49b0-1a09-6fe0-360a5d00afdg" },
"linkProtocol": {
"type": "DOT1Q" }
}
},
"order": {
"purchaseOrderNumber": "1122334",
"billingTier": "Up to 50 MB" }
}
响应有效负载包含在请求正文中定义的配置参数。有关所有可用参数及其说明的完整列表,请参阅API 参考。
监控连接
使用 Get 指定连接 端点来监控连接状态。