-
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 Hosted AWS Connection 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
- Request a new Hosted AWS connection
- Get port list
- Get a list of cloud locations filtered by query params
Parameters and attributes
To provision an AWS connection, you will need the following information:
-
Header row
- Parameter
- Required
- Description
-
Row 1
-
aws_account_id
string -
Yes
-
The AWS account ID to connect with. Must be 12 characters long.
You can find this by logging in to the AWS management console.
-
-
Row 1
account_uuid
string- Yes
- Billing account ID (see below).
-
Row 1
description
string- Yes
- Brief description of the connection.
-
Row 1
-
pop
string -
Yes
-
The AWS on-ramp POP code.
For a list of our cloud on-ramp locations, use
/v2/locations/cloud
with filters as needed or see our locations page.
-
-
Row 1
port
string- Yes
- The circuit ID of the PacketFabric port that the Hosted connection will land on. 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
- Valid VLAN range is from 4-4094, inclusive.
-
Row 1
src_svlan
string- No
- Valid S-VLAN range is from 4-4094, inclusive. This is only applicable if your source port is an ENNI port.
-
Row 1
speed
string- Yes
- The connection speed. You have the following options: “50Mbps” “100Mbps” “200Mbps” “300Mbps” “400Mbps” “500Mbps” “1Gbps” “2Gbps” “5Gbps” “10Gbps”
-
Row 1
zone
string- No
- The desired zone for the new connection. This is the zone in the AWS on-ramp location.
-
Row 1
published_quote_line_uuid
string- No
- The UUID of the published quote line with which this connection should be associated.
Find the billing account ID
For information on finding your billing account ID, see Get the Account UUID.
Get your AWS ID
You can get this from the AWS management console by opening the user menu in the upper right:
Get on-ramp locations
You can use the following GET call to filter for AWS Hosted on-ramp locations:
https://api.packetfabric.com/v2/locations/cloud?cloud_provider=aws&cloud_connection_type=hosted
However, the response is lengthy, so you should try to include as many filters as you can. For a full list of the filters, see Get a list of cloud locations filtered by query params.
For example, this will return all AWS on-ramps in the Washington D.C./Ashburn market:
https://api.packetfabric.com/v2/locations/cloud?cloud_provider=aws&cloud_connection_type=hosted&market=WDC
From the list that is returned, note the pop
value of the on-ramp you want to use. Optionally, you can also note the availability zone to include in you API request
NOTE: For cURL users, you would format the above GET call as follows:
- Unix-based:
https://api.packetfabric.com/v2/locations/cloud?cloud_provider=aws\&cloud_connection_type=hosted\&market=WDC
(escaping the&
) - Windows:
"https://api.packetfabric.com/v2/locations/cloud?cloud_provider=aws&cloud_connection_type=hosted&market=WDC"
(enclosed in double quotation marks)
TIP: You can also browse locations from the portal or from our website.
If you would prefer to only use the API, you can use /v2/locations/markets
and /v2/locations/regions
to get lists of our markets and regions.
Request the Hosted connection
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/cloud/hosted/aws
-
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.
If the request is successful, the response will include detailed information about your connection, including the circuit ID for this connection. You can use the circuit ID in other API requests to manage the connection.
JSON sample
Here is a JSON sample for you to copy and then modify accordingly:
{
"aws_account_id": "your-aws-id",
"account_uuid": "your-account-uuid",
"description": "My API AWS connection",
"pop": "POP1",
"port": "PF-AP-ABC-000000",
"vlan": 28,
"speed": "50Mbps"
}
cURL
curl -X POST https://api.packetfabric.com/v2/services/cloud/hosted/aws -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):
{
"aws_account_id": "your-aws-id",
"account_uuid": "your-account-uuid",
"description": "My API AWS connection",
"pop": "POP1",
"port": "PF-AP-ABC-000000",
"vlan": 28,
"speed": "50Mbps"
}
Requests
import requests
api_key = 'replace_with_api_key'
request_header = {
'Authorization': f'Bearer {api_key}'
}
post_url = 'placeholder_api.packetfabric.com/v2/services/cloud/hosted/aws'
post_json = {
"aws_account_id": "your-aws-id",
"account_uuid": "your-account-uuid",
"description": "My API AWS connection",
"pop": "POP1",
"port": "PF-AP-ABC-000000",
"vlan": 28,
"speed": "50Mbps"
}
api = requests.post(post_url, json=post_json, headers=request_header)
print(api)
Updated on 13 Jul 2022