# 创建端口 ## 先决条件[​](#先决条件 "直接链接至先决条件") 验证-提交您的用户凭据,客户端ID和客户端机密以进行OAuth2 验证。有关如何致电OAuth API以验证和验证您的凭据的说明,请参阅[API验证](https://docs.equinix.com/zh-Hans/equinix-api/api-authentication.md)。 ## 创建端口[​](#创建端口-1 "直接链接至创建端口") 要创建端口,请向端点发送`POST`请求[`/fabric/v4/ports`](https://docs.equinix.com/zh-Hans/api-catalog/fabricv4/ports/createport.md)。 | | | | ---------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | 方法 | `POST` | | URL 或端点 | `/fabric/v4/ports` | | 标题 | `Authorization`,`Content-Type` | | 路径参数 | 不适用 | | 查询参数 | `dryRun` | | 身体参数 | `type`,`id`,`uuid` `name` `description`,,`physicalPortsSpeed`,`connectionsCount`,`physicalPortsType` `physicalPortsCount` `connectivitySourceType`,,`bmmrType`,`project`,`state` `order` `cvpId`,,`operation`,`account`,`change` `changeLog` `availableBandwidth`,,`usedBandwidth`,`location`,`device` `interface` `demarcationPointIbx`,,`tetherIbx`,`demarcationPoint`,`redundancy` `encapsulation` `lagEnabled`,,`lag`,`asn`,`package` `settings` `physicalPortQuantity`,,`notifications`,`additionalInfo`,`endCustomer` `physicalPorts`,,`loas` | 在不创建或更改资源的情况下,在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 请求 - 主机托管、非 LAG端口: ``` curl -X POST 'https://api.equinix.com/fabric/v4/ports' -H 'Content-Type: application/json' -H 'Authorization: Bearer ' -d '{ "type": "XF_PORT", "physicalPortsSpeed": 1000, "physicalPortsType": "1000BASE_LX", "connectivitySourceType": "COLO", "location": { "metroCode": "GV" }, "demarcationPointIbx": "GV1", "package": { "code": "STANDARD" }, "lagEnabled": false, "encapsulation": { "type": "DOT1Q", "tagProtocolId": 33024 }, "project": { "projectId": "8f23b36f-db8f-44c8-a6e5-606e1b485931" }, "account": { "accountNumber": 270848 }, "notifications": [ { "registeredUsers": [ "jaguarsuser-port-order" ], "type": "TECHNICAL" } ], "order": { "purchaseOrder": { "number": 156576, "amount": 10, "startDate": "2018-06-11T22:25:52.206Z", "endDate": "2018-07-11T22:25:52.206Z", "type": "NEW" }, "signature": { "signatory": "DELEGATE", "delegate": { "firstName": "John", "lastName": "Doe", "email": "john.doe@company.com" } } }, "physicalPorts": [ { "demarcationPoint": { "ibx": "GV1", "cabinetUniqueSpaceId": "Demarc", "cageUniqueSpaceId": "GV1:01:002174", "patchPanel": "CP:Demarc:1259684", "connectorType": "SC" } } ] }' ``` 示例回答: ``` { "type": "XF_PORT", "physicalPortsType": "10GBASE_L", "physicalPortsSpeed": 10000, "physicalPortsCount": 1, "location": { "metroCode": "AM" }, "demarcationPointIbx": "AM1", "redundancy": { "group": 1, "priority": "PRIMARY" }, "lagEnabled": true, "encapsulation": { "type": "DOT1Q", "tagProtocolId": 33024 }, "package": { "code": "STANDARD" }, "settings": { "sharedPortType": false }, "project": { "projectId": 567 }, "account": { "accountNumber": 1000 }, "order": { "orderNumber": "1-207799950758", "signature": { "signatory": "DELEGATE", "delegate": { "email": "testEmail1@equinix.com" } } }, "notifications": [ { "type": "TECHNICAL", "registeredUsers": [ "jaguarsuser-port-order" ] }, { "type": "NOTIFICATION", "registeredUsers": [ "jaguarsuser-port-order" ] }, { "type": "PEERING", "registeredUsers": [ "jaguarsuser-port-order" ] }, { "type": "ESCALATION", "registeredUsers": [ "jaguarsuser-port-order" ] } ] } ``` 有关响应的详细描述或更多示例,请参阅[API参考](https://docs.equinix.com/zh-Hans/api-catalog/fabricv4/ports/createport.md)。