-
Release Notes
- July 8, 2024
- May 22, 2024
- April 17, 2024
- March 20, 2024
- February 22, 2024
- January 18, 2024
- 2023 Releases
- 2022 Releases
-
2021 Releases
- December 20, 2021
- December 1, 2021
- November 22, 2021
- November 4, 2021
- October 26, 2021
- September 30, 2021
- September 22, 2021
- September 2, 2021
- August 16, 2021
- August 2, 2021
- July 19, 2021
- July 1, 2021
- June 17, 2021
- June 1, 2021
- April 30, 2021
- April 8, 2021
- March 25, 2021
- March 15, 2021
- February 25, 2021
- February 8, 2021
- January 28, 2021
- January 21, 2021
- January 13, 2021
- 2020 Releases
- Getting Started
- Ports
- Cross Connects
- Point-to-Point
- Virtual Circuits
- Cloud Connections
- Cloud Router
- Marketplace & IX
- Administration
- Billing
- Troubleshooting & FAQ
- Technical Reference
- Partners Portal
- API & Automation
Provision a Virtual Circuit via the API
Before you begin
Ensure you have a bearer token authorizing all your API calls. For information on authorizing calls, see one of the following pages:
- Using Postman with the PacketFabric API
- Using cURL with the PacketFabric API
- Using Python Requests with the PacketFabric API
API reference
Parameters and attributes
To provision a backbone virtual circuit, you will need the following information:
- Header row
- Parameter
- Required
- Description
- Row 1
-
epl
boolean -
Yes
-
In most cases this should be false.
If true, the circuit will be an Ethernet Private Line connection. If false, the circuit will be an Ethernet Virtual Private Line. For information on the differences between the two, see Ethernet Service Specification.
-
- Row 1
bandwidth
object- Yes
- An object defining speed, billing account, and connection type. (See below)
- Row 1
interfaces
array of objects- Yes
- Specify the A and Z sides of the connection. (See below)
- Row 1
description
string- No
- Brief description of the connection.
- Row 1
rate_limit_in
integer- No
- The upper bound, in Mbps, to limit incoming data by.
- Row 1
rate_limit_out
integer- No
- The lower bound, in Mbps, to limit incoming data by.
- Row 1
published_quote_line_uuid
string- No
- The UUID of the published quote line with which this connection should be associated.
Bandwidth
- Header row
- Parameter
- Required
- Description
- Row 1
account_uuid
string- Yes
- Billing account ID (see below).
- Row 1
-
longhaul_type
string -
Yes
-
This can be “dedicated” “usage” or “hourly.”
- Dedicated (no limits or additional charges) requires a subscription term.
- Usage-based charges per transferred GB and does not require a subscription term or a speed.
- Hourly billing does not require a subscription term, but does require a speed.
-
- Row 1
-
subscription_term
integer -
Maybe
-
Duration of the contract in months: 1, 12, 24, or 36.
Only applicable if
longhaul_type
is “dedicated.”
-
- Row 1
-
speed
string -
Maybe
-
Link speed. Values for hourly (burst) billing accepts multiples of 100Mbps.
For dedicated connections, you can enter “50Mbps” “100Mbps” “200Mbps” “300Mbps” “400Mbps” “500Mbps” “1Gbps” “2Gbps” “5Gbps” “10Gbps” “20Gbps” “30Gbps” “40Gbps” “50Gbps” “60Gbps” “80Gbps” “100Gbps.”
Only applicable if
longhaul_type
is “dedicated” or “hourly.”
-
Interfaces
Enter the following information for both the A and Z side.
- Header row
- Parameter
- Required
- Description
- Row 1
port_circuit_id
string- Yes
- The circuit ID of the port. You can find this in the portal or you can use
https://api.packetfabric.com/v2/ports
to get a list of your ports.
- Row 1
vlan
string- Yes, unless untagged
- Valid VLAN range is from 4-4094, inclusive. You must provide a VLAN unless
untagged
is set to true.
- Row 1
svlan
string- Maybe
- Valid S-VLAN range is from 4-4094, inclusive. This is only applicable to virtual circuits provisioned on ENNI ports.
- Row 1
untagged
boolean- No
- Whether the interface should be untagged. The default is false. For information on untagged VLAN scenarios, see VLAN Tagging.
Find the billing account ID
For information on finding your billing account ID, see Get the Account UUID.
Get your port circuit IDs
The following GET call will return a list of your ports: https://api.packetfabric.com/v2.1/ports
From this list, you want to copy the port_circuit_id
of your A and Z sides.
Provision the virtual circuit
Postman
-
Open Postman and click the plus icon to add a new request.
-
Select POST from the drop-down menu that appears before the URL field.
-
Enter the following API call into the URL field:
https://api.packetfabric.com/v2/services/backbone
-
Select the Body subtab and then select raw. Select JSON from the drop-down menu (see below for an example that you can copy and paste):
-
In the space below, set your parameters. For example (include the curly brackets):
-
Click Send.
JSON sample
Here is a JSON sample for you to copy and then modify accordingly:
{
"description": "My API Virtual Circuit",
"epl": false,
"bandwidth": {
"account_uuid":"your-account-uuid",
"subscription_term": 1,
"longhaul_type": "dedicated",
"speed": "50Mbps"
},
"interfaces": [
{
"port_circuit_id": "PF-AP-Side-A",
"vlan": 11
},
{
"port_circuit_id": "PF-AP-Side-Z",
"vlan": 12
}
]
}
cURL
curl -X POST https://api.packetfabric.com/v2/services/backbone -d @api.json -H "accept: */*" -H "Authorization: Bearer replace_with_api_key"
With the contents of api.json
similar to the following (modified to include your information):
{
"description": "My API Virtual Circuit",
"epl": false,
"bandwidth": {
"account_uuid":"your-account-uuid",
"subscription_term": 1,
"longhaul_type": "dedicated",
"speed": "50Mbps"
},
"interfaces": [
{
"port_circuit_id": "PF-AP-Side-A",
"vlan": 11
},
{
"port_circuit_id": "PF-AP-Side-Z",
"vlan": 12
}
]
}
Requests
import requests
api_key = 'replace_with_api_key'
request_header = {
'Authorization': f'Bearer {api_key}'
}
post_url = 'placeholder_api.packetfabric.com/v2/services/backbone'
post_json = {
"description": "My API Virtual Circuit",
"epl": False,
"bandwidth": {
"account_uuid":"your-account-uuid",
"subscription_term": 1,
"longhaul_type": "dedicated",
"speed": "50Mbps"
},
"interfaces": [
{
"port_circuit_id": "PF-AP-Side-A",
"vlan": 11
},
{
"port_circuit_id": "PF-AP-Side-Z",
"vlan": 12
}
]
}
api = requests.post(post_url, json=post_json, headers=request_header)
print(api)
Updated on 13 Jul 2022