# API - 连接到经典版 IBM Cloud Direct Link 与 Classic 上的 IBM Cloud™ 直接 Link 建立连接,以将您的IBX共置资产连接到您的 IBM Cloud 资源。 ![](https://docs.equinix.com/zh-Hans/assets/images/connectToIbmDirectLink20-d03a5f72aff4e50771a2f6d848d6952d.jpg) ## 识别您的 IBM 帐户 ID[​](#识别您的-ibm-帐户-id "直接链接至识别您的 IBM 帐户 ID") 登录到[IBM Cloud控制台](https://cloud.ibm.com/login),然后选择“*管理*>*账户*”以找到您的IBM账户ID。 ## Fabric API 先决条件[​](#fabric-api-先决条件 "直接链接至Fabric API 先决条件") 1. 身份验证 - 提交您的 OAuth2 用户凭据、客户端 ID 和客户端密钥 验证。有关如何致电OAuth API以验证和验证您的凭据的说明,请参阅[API验证](https://docs.equinix.com/zh-Hans/equinix-api/api-authentication.md)。 2. 确定A侧信息。使用[获取所有端口](https://docs.equinix.com/zh-Hans/api-catalog/fabricv4/ports/getports.md)API请求检索您的Equinix Fabric端口信息。 3. 选择Z侧都会区位置。使用[获取所有都会区](https://docs.equinix.com/zh-Hans/api-catalog/fabricv4/metros/getmetros.md)API请求查找Equinix Fabric可用的所有都会区并确定目标位置。 4. 确定服务配置文件。使用[检索服务配置文件](https://docs.equinix.com/zh-Hans/api-catalog/fabricv4/service-profiles/searchserviceprofiles.md)API请求搜索特定的服务配置文件,或使用[列出服务配置文件](https://docs.equinix.com/zh-Hans/api-catalog/fabricv4/service-profiles/listserviceprofiles.md)API请求列出所有可用的服务[配置](https://docs.equinix.com/zh-Hans/api-catalog/fabricv4/service-profiles/listserviceprofiles.md)文件并确定 你想联系的个人资料。 ## 通过 DOT1Q 端口连接到 Classic 上的 IBM Cloud Direct Link[​](#通过-dot1q-端口连接到-classic-上的-ibm-cloud-direct-link "直接链接至通过 DOT1Q 端口连接到 Classic 上的 IBM Cloud Direct Link") 在Classic上,若要创建从您的Dot1q端口到IBM Cloud Direct Link的连接,请向端点发送`POST`请求[`/fabric/v4/connections`](https://docs.equinix.com/zh-Hans/api-catalog/fabricv4/connections/createconnection.md)。在请求正文中指定连接的配置详情。 | | **发布/fabric/v4/connections** | | -------- | ------------------------------------------------------------------------------------------------------- | | 方法 | `POST` | | 端点 | `/fabric/v4/connections` | | 标题 | `Authorization`,`Content-Type` | | 路径参数 | 不适用 | | 查询参数 | 不适用 | | 身体参数 | `type`,`name`,`order` `bandwidth` `redundancy`,,`aSide`,`zSide`,`additionalInfo`,`notifications` | 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"     },     "bandwidth": 1000,     "redundancy": {         "priority": "PRIMARY"     },     "aSide": {         "accessPoint": {             "type": "COLO",             "port": {                 "uuid": "a867f685-41b0-1b07-6de0-320a5c00abdd"             },             "linkProtocol": {                 "type": "DOT1Q",                 "vlanTag": 1001             }         }     },     "zSide": {         "accessPoint": {             "type": "SP",             "profile": {                 "uuid": "20d32a80-0d61-4333-bc03-707b591ae2f5"             },             "location": {                 "metroCode": "SV"             },             "authenticationKey": "xx-xxx-xx",             "sellerRegion": "us-west-1"         }     },     "additionalInfo": [         {             "key": "ASN",             "value": "12345"         },         {             "key": "Global",             "value": "false"         }     ],     "notifications": [         {             "type": "ALL",             "emails": [                 "test@equinix.com",                 "test2@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": "PROVISIONING",     "order": {         "purchaseOrderNumber": "1-129105284100",         "billingTier": "Up to 1 Gbps"     },     "bandwidth": 1000,     "redundancy": {         "group": "m167f685-41b0-1b07-6de0-320a5c00abeu",         "priority": "PRIMARY"     },     "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": "SP",             "profile": {                 "href": "https://api.equinix.com/fabric/v4/services/serviceProfiles/20d32a80-0d61-4333-bc03-707b591ae2f5",                 "type": "L2_PROFILE",                 "uuid": "20d32a80-0d61-4333-bc03-707b591ae2f5"             },             "location": {                 "href": "https://api.equinix.com/v4/metros/SV",                 "metroCode": "SV",                 "region": "AMER"             },             "sellerRegion": "us-west-1"         }     },     "additionalInfo": [         {             "key": "ASN",             "value": "12345"         },         {             "key": "Global",             "value": "false"         }     ],     "notifications": [         {             "type": "ALL",             "emails": [                 "test@equinix.com",                 "test2@equinix.com"             ]         }     ],     "operation": {         "equinixStatus": "PROVISIONING",         "providerStatus": "PROVISIONING"     },     "changeLog": {         "createdDateTime": "2021-07-15T19:30:29.526Z"     } } ``` 响应负载包括在请求正文中定义的配置参数。有关可能参数及其说明的完整列表,请参阅[API参考手册](https://docs.equinix.com/zh-Hans/api-catalog/fabricv4/connections/createconnection.md)。 ## 从 QINQ端口连接到 Classic 上的 IBM Cloud 直接 Link[​](#从-qinq端口连接到-classic-上的-ibm-cloud-直接-link "直接链接至从 QINQ端口连接到 Classic 上的 IBM Cloud 直接 Link") 在Classic上,要创建从QinQ端口到IBM Cloud Direct Link的连接,请向端点发送`POST`请求[`/fabric/v4/connections`](https://docs.equinix.com/zh-Hans/api-catalog/fabricv4/connections/createconnection.md)。在请求正文中指定连接的配置详情。 ``` 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"     },     "bandwidth": 1000,     "redundancy": {         "priority": "PRIMARY"     },     "aSide": {         "accessPoint": {             "type": "COLO",             "port": {                 "uuid": "a867f685-41b0-1b07-6de0-320a5c00abdd"             },             "linkProtocol": {                 "type": "QINQ",                 "vlanCTag": 1001,                 "vlanSTag": 1002             }         }     },     "zSide": {         "accessPoint": {             "type": "SP",             "profile": {                 "uuid": "20d32a80-0d61-4333-bc03-707b591ae2f5"             },             "location": {                 "metroCode": "SV"             },             "authenticationKey": "xx-xxx-xx",             "sellerRegion": "us-west-1"         }     },     "additionalInfo": [         {             "key": "ASN",             "value": "12345"         },         {             "key": "Global",             "value": "false"         }     ],     "notifications": [         {             "type": "ALL",             "emails": [                 "test@equinix.com",                 "test2@equinix.com"             ]         }     ] }' ``` 请求正文中包含的参数特定于此示例。参数及其说明的完整列表,请参见[API参考手册](https://docs.equinix.com/zh-Hans/api-catalog/fabricv4/connections/createconnection.md)。 ## 监控连接状态[​](#监控连接状态 "直接链接至监控连接状态") 向端点发送`GET`监控连接状态的请求[`fabric/v4/connections/{connectionId}`](https://docs.equinix.com/zh-Hans/api-catalog/fabricv4/connections/getconnectionbyuuid.md)。 | `equinixStatus`属性值 | `providerStatus`属性值 | **IBM直接链接**状态 | **描述** | | ----------------------- | ---------------------------- | ------------------- | ------------------------ | | `PROVISIONING` | `PROVISIONING` | - | 连接请求尚未发送给 IBM。 | | `PENDING_PROVIDER_VLAN` | `PENDING_APPROVAL` | 创建待批准 | 连接等待批准。 | | `PROVISIONED` | `PROVISIONING / PROVISIONED` | 正在创建 | 连接正在建立中。 | | `PROVISIONED` | `PROVISIONED` | 已配置 | 连接已建立。 | ## 接受连接[​](#接受连接 "直接链接至接受连接") 登录[IBM Cloud控制台](https://cloud.ibm.com/login)并导航至[IBM](https://cloud.ibm.com/classic/network/directlink/exchange)[Cloud Direct Link Exchange页面](https://cloud.ibm.com/classic/network/directlink/exchange)以查看并接受待处理连接。