# 通过Network Edge订购Internet Access Equinix Internet Access (EIA) 利用多家一级互联网服务提供商 (ISP) 和 Equinix Internet Exchange (IX) 提供混合互联网接入,以实现高可用性、可靠性和高速网络。要通过 API 订购 Internet Access: * 您的网络边缘设备与 Equinix Internet Access 服务配置文件之间的 Fabric 连接是免费提供的。 * 当您[取消配置您的互联网接入服务实例](https://docs.equinix.com/zh-Hans/internet-access/eia-api/deprovision-eia-api.md)时,关联的 Fabric 连接也会被取消配置。 * 如果配置Internet Access服务实例时出现问题,则关联的 Fabric 连接将自动取消配置。 Equinix Internet Access with Network Edge 适用于已加入 [Equinix Identity and Access Management](https://docs.equinix.com/zh-Hans/iam.md) 的组织,并且用于发送 API 请求的帐户必须具有“Equinix Fabric Manager”、“Network Edge Connections Manager”和“Network Edge Device Manager”角色。 ## 先决条件 1. 身份验证 - 提交您的 OAuth2 用户凭据、客户端 ID 和客户端密钥 身份验证。请参阅[API身份验证](https://docs.equinix.com/zh-Hans/equinix-api/api-authentication.md)以获取有关如何调用OAuth API来验证和认证您的凭据的说明。 2. 确定 A 端信息。您需要已配置的网络边缘虚拟设备、冗余设备或集群,并已注册许可证。向 `/ne/v1/devices` 端点或 `/ne/v1/devices/{id}` 端点发送 `GET` 请求。您可以选择设备上的任何可用接口进行连接。但是,如果您未指定接口,Equinix 将自动选择一个。 3. 确定 Z 端信息。互联网接入服务配置文件类型为 `IA_PROFILE`,其 ID 为 `32d81829-0bf8-45d5-84e2-7289a553dbb6`。要确定您的服务所在都市区,请向 `/internetAccess/v2/ibxs` 端点发送 `GET` 请求,以查找互联网接入服务可用的位置。您需要此信息才能订购互联网接入服务。 ## 创建互联网连接 要创建 Internet 接入服务的连接,请向 [`/fabric/v4/connections`](https://docs.equinix.com/zh-Hans/api-catalog/fabricv4.md#tag/Connections/operation/createConnection) 端点发送 `POST` 请求。连接类型为 `IA_VC`。 请在 `aSide` 对象中提供您的虚拟设备信息,包括: * `accessPoint.type` as `VD` * `virtualDevice.type` 作为 `EDGE` * `virtualDevice.uuid` 作为您设备的 UUID 在 `zSide` 对象中提供 Internet 访问服务配置文件,包括: * `accessPoint.type` as `SP`. * `profile.type` 作为 `IA_PROFILE` * `profile.uuid` 作为 `32d81829-0bf8-45d5-84e2-7289a553dbb6` * `metroCode` 是您要连接的Internet Access都会区的两位字母都会区代码。 如果要创建冗余连接,请发出两个请求。其中一个请求的 `redundancy.priority` 应设置为 `PRIMARY`。 并将另一个 `redundancy.priority` 设置为 `SECONDARY`,并且应将 `redundancy.group` 指定为第一个连接的 UUID。 A 侧可以使用虚拟设备集群或一对冗余设备(一个用于主设备,一个用于辅助设备)。 cURL 请求示例: Primary connection example ``` curl -X POST 'https://api.equinix.com/fabric/v4/connections' \ -H 'content-type: application/json' \ -H 'authorization: Bearer ' \ -d '{ "type": "IA_VC", "name": "", "bandwidth": , "redundancy": { "priority": "PRIMARY" }, "aSide": { "accessPoint": { "type": "VD", "virtualDevice": { "type": "EDGE", "uuid": "" } } }, "zSide": { "accessPoint": { "type": "SP", "profile": { "type": "IA_PROFILE", "uuid": "32d81829-0bf8-45d5-84e2-7289a553dbb6" }, "location": { "metroCode": "" } } }, "project": { "projectId": "" }, "order": { "purchaseOrderNumber": "" }, "notifications": [ { "type": "ALL", "emails": [ "" ] } ] }' ``` Secondary connection example ``` curl -X POST 'https://api.equinix.com/fabric/v4/connections' \ -H 'content-type: application/json' \ -H 'authorization: Bearer ' \ -d '{ "type": "IA_VC", "name": "", "bandwidth": , "redundancy": { "priority": "SECONDARY", "group": "" }, "aSide": { "accessPoint": { "type": "VD", "virtualDevice": { "type": "EDGE", "uuid": "" } } }, "zSide": { "accessPoint": { "type": "SP", "profile": { "type": "IA_PROFILE", "uuid": "32d81829-0bf8-45d5-84e2-7289a553dbb6" }, "location": { "metroCode": "" } } }, "project": { "projectId": "" }, "order": { "purchaseOrderNumber": "" }, "notifications": [ { "type": "ALL", "emails": [ "" ] } ] }' ``` 重要的 响应中包含一个 `uuid`,它是您的互联网接入服务的连接 ID。您必须拥有此连接 UUID 才能订购互联网接入服务。 ## 使用提供商分配的 IP 块订购服务 注意 如果您使用冗余连接连接到冗余设备或集群,则仅支持 BGP 路由。 要订购您的互联网接入服务,请向 [`/internetAccess/v2/services`](https://docs.equinix.com/zh-Hans/api-catalog/internetaccessv2.md#tag/EIA-Service/operation/createEquinixInternetAccessv2) 端点发送 `POST` 请求。 当您使用 Equinix 拥有的 (PA) IP 地址订购服务时,请将 `ipBlock.prefixLength` 值设置为您需要的子网大小。 如果您通过单个连接订购服务: * 将 `type` 设置为 `SINGLE`,并将连接 ID 提供给 `connections` 数组。 * 从 `STATIC`、`DIRECT` 或 `BGP` 中选择您的 `routingProtocol.type`。 如果您通过一对冗余连接订购服务: * 将 `type` 设置为 `DUAL`,并将两个连接 ID 都提供给 `connections` 数组。 * 将 `routingProtocol.type` 设置为 `BGP`。 注意 在亚太地区订购位于我们IBX数据中心之一的EIA服务实例时,如果启用了PA IPv4地址块,请务必将`addressingPlans`和`questions`信息添加到`ipBlock`对象中。更多信息,请参阅[API参考](https://docs.equinix.com/zh-Hans/api-catalog/internetaccessv2.md#tag/EIA-Service/operation/createEquinixInternetAccessv2)。 ### 静态路由 有关静态路由的文档可以在这里找到:[../routing/static-routing.md](https://docs.equinix.com/zh-Hans/internet-access/routing/static-routing.md)。 cURL 请求示例: Single Static Service in APAC region example ``` curl -X POST 'https://api.equinix.com/internetAccess/v2/services' \ -H 'content-type: application/json' \ -H 'authorization: Bearer ' \ -d '{ "name": "", "type": "SINGLE", "connections": [ "" ], "routingProtocol": { "type": "STATIC", "ipv4": { "customerRoutes": [ { "ipBlock": { "prefixLength": , "addressingPlans": [ { "afterThreeMonths": , "immediate": , "purpose": "", "size": } ], "questions": [ { "answer": "YES", "type": "PRIVATE_SPACE_CONSIDERED" }, { "answer": "NO", "type": "REFUSED_PREVIOUSLY" }, { "answer": "NO", "type": "RETURNING_ADDRESS_SPACE" } ] } } ] }, "ipv6": { "customerRoutes": [ { "ipBlock": { "prefixLength": } } ] } }, "order": { "purchaseOrder": { "number": "" } } }' ``` ### 直接路由 有关直接路由的文档可以[在这里](https://docs.equinix.com/zh-Hans/internet-access/routing/direct-routing.md)。 cURL 请求示例: Single Direct Service example ``` curl -X POST 'https://api.equinix.com/internetAccess/v2/services' \ -H 'content-type: application/json' \ -H 'authorization: Bearer ' \ -d '{ "name": "", "type": "SINGLE", "connections": [ "" ], "routingProtocol": { "type": "DIRECT", "ipv4": { "customerRoutes": [ { "ipBlock": { "prefixLength": } } ] }, "ipv6": { "customerRoutes": [ { "ipBlock": { "prefixLength": } } ] } }, "order": { "purchaseOrder": { "number": "" } } }' ``` ### BGP路由 在 `routingProtocol` 对象中指定您的 BGP 配置详细信息: * 在 `routingProtocol.exportPolicy` 中指定要向 Internet 通告的路由,可以是 `FULL`、`DEFAULT`、`FULL_DEFAULT` 或 `PARTIAL`。 * 在 `routingProtocol.customerAsnRange` 中提供客户 ASN 范围 BITS\_16(16 位 ASN)或 BITS\_32(32 位 ASN)。 * 如果需要,请在 `routingProtocol.bgpAuthKey` 中提供 bgpAuthKey。 有关 BGP 路由的文档可以在这里找到:[../routing/bgp-routing.md](https://docs.equinix.com/zh-Hans/internet-access/routing/bgp-routing.md)。 cURL 请求示例: Single BGP Service example ``` curl -X POST 'https://api.equinix.com/internetAccess/v2/services' \ -H 'content-type: application/json' \ -H 'authorization: Bearer ' \ -d '{ "name": "", "type": "SINGLE", "connections": [ "" ], "routingProtocol": { "type": "BGP", "customerAsnRange": "", "bgpAuthKey": "", "exportPolicy": "", "ipv4": { "customerRoutes": [ { "ipBlock": { "prefixLength": } } ] }, "ipv6": { "customerRoutes": [ { "ipBlock": { "prefixLength": } } ] } }, "order": { "purchaseOrder": { "number": "" } } }' ``` Dual BGP Service example ``` curl -X POST 'https://api.equinix.com/internetAccess/v2/services' \ -H 'content-type: application/json' \ -H 'authorization: Bearer ' \ -d '{ "name": "", "type": "DUAL", "connections": [ "", "" ], "routingProtocol": { "type": "BGP", "customerAsnRange": "", "bgpAuthKey": "", "exportPolicy": "", "ipv4": { "customerRoutes": [ { "ipBlock": { "prefixLength": } } ] }, "ipv6": { "customerRoutes": [ { "ipBlock": { "prefixLength": } } ] } }, "order": { "purchaseOrder": { "number": "" } } }' ``` ## 使用独立于提供商的 IP 块的订购服务 当您使用自己的 IP 地址块 (PI) 订购服务时,请在 `customerRoutes.prefix` 中指定它。 ### 静态路由 cURL 请求示例: Single Static Service example ``` curl -X POST 'https://api.equinix.com/internetAccess/v2/services' \ -H 'content-type: application/json' \ -H 'authorization: Bearer ' \ -d '{ "name": "", "type": "SINGLE", "connections": [ "" ], "routingProtocol": { "type": "STATIC", "ipv4": { "customerRoutes": [ { "prefix": "" } ] }, "ipv6": { "customerRoutes": [ { "prefix": "" } ] } }, "order": { "purchaseOrder": { "number": "" } } }' ``` ### 直接路由 在“对等互连”对象中指定 IP 块中的哪些 IP 可用于对等互连。 对于单服务类型,请在 `equinixPeerIps` 数组中仅提供一个 IP 地址。 cURL 请求示例: Single Direct Service example ``` curl -X POST 'https://api.equinix.com/internetAccess/v2/services' \ -H 'content-type: application/json' \ -H 'authorization: Bearer ' \ -d '{ "name": "", "type": "SINGLE", "connections": [ "" ], "routingProtocol": { "type": "DIRECT", "ipv4": { "customerRoutes": [ { "prefix": "" } ], "peerings": [ { "equinixPeerIps": [ "" ] } ] }, "ipv6": { "customerRoutes": [ { "prefix": "" } ], "peerings": [ { "equinixPeerIps": [ "" ] } ] } }, "order": { "purchaseOrder": { "number": "" } } }' ``` ### BGP路由 cURL 请求示例: Single BGP Service example ``` curl -X POST 'https://api.equinix.com/internetAccess/v2/services' \ -H 'content-type: application/json' \ -H 'authorization: Bearer ' \ -d '{ "name": "", "type": "SINGLE", "connections": [ "" ], "routingProtocol": { "type": "BGP", "customerAsnRange": "", "bgpAuthKey": "", "exportPolicy": "", "ipv4": { "customerRoutes": [ { "prefix": "" } ] }, "ipv6": { "customerRoutes": [ { "prefix": "" } ] } }, "order": { "purchaseOrder": { "number": "" } } }' ``` Dual BGP Service example ``` curl -X POST 'https://api.equinix.com/internetAccess/v2/services' \ -H 'content-type: application/json' \ -H 'authorization: Bearer ' \ -d '{ "name": "", "type": "DUAL", "connections": [ "", "" ], "routingProtocol": { "type": "BGP", "customerAsnRange": "", "bgpAuthKey": "", "exportPolicy": "", "ipv4": { "customerRoutes": [ { "prefix": "" } ] }, "ipv6": { "customerRoutes": [ { "prefix": "" } ] } }, "order": { "purchaseOrder": { "number": "" } } }' ``` ## 使用 PA 和 PI IP 块的订购服务 当您订购的服务同时包含提供商分配 (PA) 和提供商独立 (PI) IP 块时,请指定两个或多个包含相应字段的客户路由对象: * `ipBlock.prefixLength` 表示Equinix提供的 IP 块 (PA)。 * `customerRoutes.prefix` 表示使用您自己的 IP 块 (PI)。 重要的 只能通过静态路由和 BGP 路由协议请求多个IP 块。 cURL 请求示例: Provider Assigned and Provider Independent IP Blocks example ``` curl -X POST 'https://api.equinix.com/internetAccess/v2/services' \ -H 'content-type: application/json' \ -H 'authorization: Bearer ' \ -d '{ "name": "", "type": "SINGLE", "connections": [ "" ], "routingProtocol": { "type": "STATIC", "ipv4": { "customerRoutes": [ { "ipBlock": { "prefixLength": } }, { "prefix": "" } ] }, "ipv6": { "customerRoutes": [ { "ipBlock": { "prefixLength": } }, { "prefix": "" } ] } }, "order": { "purchaseOrder": { "number": "" } } }' ``` ## 监控您的请求 要查看创建连接请求的状态,请向 [`fabric/v4/connections/{connectionId}`](https://docs.equinix.com/zh-Hans/api-catalog/fabricv4.md#tag/Connections/operation/getConnectionByUuid) 端点发送 `GET` 请求。 要查看您的互联网接入服务的详细信息,请使用 [`internetAccess/v2/services/{serviceId}`](https://docs.equinix.com/zh-Hans/api-catalog/internetaccessv2.md#tag/EIA-Service/operation/getEquinixInternetAccessServiceDetails) 端点。 如果您的互联网接入服务实例配置出现问题,则关联的连接将自动取消配置。