# 连接不同位置的端口 在部署在不同 IBX 数据中心的 IT 资产之间建立直接、低延迟的连接。 ![](https://docs.equinix.com/zh-Hans/assets/images/connectToMyselfOverview-7f470b80c8b64fa546f9e1ea0727d3dc.png) ## 先决条件[​](#先决条件 "直接链接至先决条件") 1. 验证-提交您的用户凭据,客户端ID和客户端机密以进行OAuth2验证。有关如何致电OAuth API以验证和验证您的凭据的说明,请参阅[API验证](https://docs.equinix.com/zh-Hans/equinix-api/api-authentication.md)。 2. 使用[获取所有端口](https://docs.equinix.com/zh-Hans/api-catalog/fabricv4/ports/getports.md)端点获取A侧和Z侧端口的相关端口信息。 ## 在两个 DOT1Q端口之间创建非冗余连接[​](#在两个-dot1q端口之间创建非冗余连接 "直接链接至在两个 DOT1Q端口之间创建非冗余连接") 要在两个Dot1q端口之间创建非冗余连接,请向端点发送`POST`请求[`/fabric/v4/connections`](https://docs.equinix.com/zh-Hans/api-catalog/fabricv4/connections/createconnection.md)。在请求正文中指定连接的配置详情。 | | **`POST /fabric/v4/connections`** | | -------- | ---------------------------------------------------------------------------------- | | 方法 | `POST` | | 端点 | `/fabric/v4/connections` | | 标题 | `Authorization`,`Content-Type` | | 路径参数 | 不适用 | | 查询参数 | 不适用 | | 身体参数 | `type`,`name`,`order` `bandwidth` `aSide`,,`zSide`,`project`,`notifications` | 在不创建连接的情况下在Production[中](https://docs.equinix.com/zh-Hans/equinix-api/testing/testing-in-production-dry-run.md)安全验证此请求,请参阅[在Production中测试(API Dry Run)](https://docs.equinix.com/zh-Hans/equinix-api/testing/testing-in-production-dry-run.md)。 cURL 请求示例: ``` curl -X POST 'https://api.equinix.com/fabric/v4/connections' -H 'content-type: application/json' -H 'authorization: Bearer ' -d '{     "type": "EVPL_VC",     "name": "Conn-1",     "order": {         "purchaseOrderNumber": "1-129105284100"     },     "geoScope": "CONUS",     "bandwidth": 1000,     "aSide": {         "accessPoint": {             "type": "COLO",             "port": {                 "uuid": "a867f685-41b0-1b07-6de0-320a5c00abdd"             },             "linkProtocol": {                 "type": "DOT1Q",                 "vlanTag": 1001             }         }     },     "zSide": {         "accessPoint": {             "type": "COLO",             "port": {                 "uuid": "20d32a80-0d61-4333-bc03-707b591ae2f4"             },             "linkProtocol": {                 "type": "DOT1Q",                 "vlanTag": 1001             }         }     },     "notifications": [         {             "type": "ALL",             "emails": [                 "test@equinix.com",                 "test@equinix.com"             ]         }     ] }' ``` ## 创建从 DOT1Q端口到 QINQ端口的非冗余连接[​](#创建从-dot1q端口到-qinq端口的非冗余连接 "直接链接至创建从 DOT1Q端口到 QINQ端口的非冗余连接") 要创建从Dot1q端口到QinQ端口的非冗余连接,请向端点发送`POST`请求[`/fabric/v4/connections`](https://docs.equinix.com/zh-Hans/api-catalog/fabricv4/connections/createconnection.md)。在请求正文中指定连接的配置详情。 cURL 请求示例: ``` curl -X POST 'https://api.equinix.com/fabric/v4/connections' -H 'content-type: application/json' -H 'authorization: Bearer ' -d '{     "type": "EVPL_VC",     "name": "Conn-1",     "order": {         "purchaseOrderNumber": "1-129105284100"     },     "geoScope": "CONUS",     "bandwidth": 1000,     "aSide": {         "accessPoint": {             "type": "COLO",             "port": {                 "uuid": "a867f685-41b0-1b07-6de0-320a5c00abdd"             },             "linkProtocol": {                 "type": "DOT1Q",                 "vlanTag": 1001             }         }     },     "zSide": {         "accessPoint": {             "type": "COLO",             "port": {                 "uuid": "20d32a80-0d61-4333-bc03-707b591ae2f4"             },             "linkProtocol": {                 "type": "QINQ",                 "vlanSTag": 2001,                 "vlanCTag": 2002,             }         }     },     "notifications": [         {             "type": "ALL",             "emails": [                 "test@equinix.com",                 "test@equinix.com"             ]         }     ] }' ``` 请求正文中包含的参数特定于此示例。参数及其说明的完整列表,请参见[API参考手册](https://docs.equinix.com/zh-Hans/api-catalog/fabricv4/connections/createconnection.md)。 示例回答: ``` {     "href": "https://api.equinix.com/fabric/v4/connections/3a58dd05-f46d-4b1d-a154-2e85c396ea62",     "type": "EVPL_VC",     "uuid": "3a58dd05-f46d-4b1d-a154-2e85c396ea62",     "name": "Conn-1",     "state": "PENDING_AUTO_APPROVAL",     "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": {         "accessPoint": {             "type": "COLO",             "port": {                 "href": "https://api.equinix.com/fabric/v4/ports/a867f685-41b0-1b07-6de0-320a5c00abdd",                 "type": "XF_PORT",                 "uuid": "20d32a80-0d61-4333-bc03-707b591ae2f4"             },             "linkProtocol": {                 "type": "QINQ",                 "vlanSTag": 2001,                 "vlanCTag": 2002,             }         }     },     "notifications": [         {             "type": "ALL",             "emails": [                 "test@equinix.com",                 "test@equinix.com"             ]         }     ],     "operation": {         "equinixStatus": "PROVISIONING",         "providerStatus": "NOT_AVAILABLE"     },     "changeLog": {         "createdDateTime": "2021-07-15T19:30:29.526Z"     } } ``` 响应负载包括在请求正文中定义的配置参数。有关可能参数及其说明的完整列表,请参阅[API参考手册](https://docs.equinix.com/zh-Hans/api-catalog/fabricv4/connections/createconnection.md)。 ## 创建从 QINQ端口到 DOT1Q端口的非冗余连接[​](#创建从-qinq端口到-dot1q端口的非冗余连接 "直接链接至创建从 QINQ端口到 DOT1Q端口的非冗余连接") 要创建从QinQ端口到Dot1Q端口的非冗余连接,请向端点发送`POST`请求[`/fabric/v4/connections`](https://docs.equinix.com/zh-Hans/api-catalog/fabricv4/connections/createconnection.md)。在请求正文中指定连接的配置详情。 cURL 请求示例: ``` curl -X POST 'https://api.equinix.com/fabric/v4/connections' -H 'content-type: application/json' -H 'authorization: Bearer ' -d '{     "type": "EVPL_VC",     "name": "Conn-1",     "order": {         "purchaseOrderNumber": "1-129105284100"     },     "geoScope": "CONUS",     "bandwidth": 1000,     "aSide": {         "accessPoint": {             "type": "COLO",             "port": {                 "uuid": "a867f685-41b0-1b07-6de0-320a5c00abdd"             },             "linkProtocol": {                 "type": "QINQ",                 "vlanSTag": 1001,                 "vlanCTag": 1002             }         }     },     "zSide": {         "accessPoint": {             "type": "COLO",             "port": {                 "uuid": "20d32a80-0d61-4333-bc03-707b591ae2f4"             },             "linkProtocol": {                 "type": "DOT1Q",                 "vlanTag": 1001             }         }     },     "notifications": [         {             "type": "ALL",             "emails": [                 "test@equinix.com",                 "test@equinix.com"             ]         }     ] }' ``` 请求正文中包含的参数特定于此示例。参数及其说明的完整列表,请参见[API参考手册](https://docs.equinix.com/zh-Hans/api-catalog/fabricv4/connections/createconnection.md)。 ## 在两个 QINQ端口之间创建非冗余连接[​](#在两个-qinq端口之间创建非冗余连接 "直接链接至在两个 QINQ端口之间创建非冗余连接") 要在两个QinQ端口之间创建非冗余连接,请向端点发送`POST`请求[`/fabric/v4/connections`](https://docs.equinix.com/zh-Hans/api-catalog/fabricv4/connections/createconnection.md)。在请求正文中指定连接的配置详情。 cURL 请求示例: ``` curl -X POST 'https://api.equinix.com/fabric/v4/connections' -H 'content-type: application/json' -H 'authorization: Bearer ' -d '{     "type": "EVPL_VC",     "name": "Conn-1",     "order": {         "purchaseOrderNumber": "1-129105284100"     },     "geoScope": "CONUS",     "bandwidth": 1000,     "aSide": {         "accessPoint": {             "type": "COLO",             "port": {                 "uuid": "a867f685-41b0-1b07-6de0-320a5c00abdd"             },             "linkProtocol": {                 "type": "QINQ",                 "vlanSTag": 1001,                 "vlanCTag": 1002             }         }     },     "zSide": {         "accessPoint": {             "type": "COLO",             "port": {                 "uuid": "20d32a80-0d61-4333-bc03-707b591ae2f4"             },             "linkProtocol": {                 "type": "QINQ",                 "vlanSTag": 2001,                 "vlanCTag": 2002,             }         }     },     "notifications": [         {             "type": "ALL",             "emails": [                 "test@equinix.com",                 "test@equinix.com"             ]         }     ] }' ``` 请求正文中包含的参数特定于此示例。参数及其说明的完整列表,请参见[API参考手册](https://docs.equinix.com/zh-Hans/api-catalog/fabricv4/connections/createconnection.md)。 ## 监控连接[​](#监控连接 "直接链接至监控连接") 使用[获取指定的连接](https://docs.equinix.com/zh-Hans/api-catalog/fabricv4/connections/getconnectionbyuuid.md)端点监控连接状态。 | \*\*`equinixStatus`\*\*参数值 | \*\*`providerStatus`\*\*属性值 | **描述** | | ----------------------------- | ------------------------------ | ------------------------------------------------------------------------------------ | | `PENDING_AUTO_APPROVAL` | `NOT_AVAILABLE` | 连接请求已发送,以供自动审批。由于连接在同一组织内(即A侧和Z侧),该连接将被自动批准。 | | `PROVISIONING` | `NOT_AVAILABLE` | 连接正在建立中。 | | `PROVISIONED` | `AVAILABLE` | 连接已建立。 | ![](https://docs.equinix.com/zh-Hans/assets/images/connectToMyselfStatus-8d16029f54b37f20b3e086033d4f91ac.png)