import Telnyx from 'telnyx';
const client = new Telnyx({
apiKey: 'My API Key',
});
const publicInternetGateway = await client.publicInternetGateways.create();
console.log(publicInternetGateway.data);{
"data": {
"id": "6a09cdc3-8948-47f0-aa62-74ac943d6c58",
"record_type": "public_internet_gateway",
"created_at": "2018-02-02T22:25:27.521Z",
"updated_at": "2018-02-02T22:25:27.521Z",
"network_id": "6a09cdc3-8948-47f0-aa62-74ac943d6c58",
"name": "test interface",
"status": "provisioned",
"public_ip": "127.0.0.1",
"region_code": "ashburn-va",
"region": {
"code": "ashburn-va",
"name": "Ashburn",
"record_type": "region"
}
}
}Create a new Public Internet Gateway.
import Telnyx from 'telnyx';
const client = new Telnyx({
apiKey: 'My API Key',
});
const publicInternetGateway = await client.publicInternetGateways.create();
console.log(publicInternetGateway.data);{
"data": {
"id": "6a09cdc3-8948-47f0-aa62-74ac943d6c58",
"record_type": "public_internet_gateway",
"created_at": "2018-02-02T22:25:27.521Z",
"updated_at": "2018-02-02T22:25:27.521Z",
"network_id": "6a09cdc3-8948-47f0-aa62-74ac943d6c58",
"name": "test interface",
"status": "provisioned",
"public_ip": "127.0.0.1",
"region_code": "ashburn-va",
"region": {
"code": "ashburn-va",
"name": "Ashburn",
"record_type": "region"
}
}
}Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Successful response
Show child attributes
Identifies the resource.
"6a09cdc3-8948-47f0-aa62-74ac943d6c58"
Identifies the type of the resource. Identifies the type of the resource.
"public_internet_gateway"
ISO 8601 formatted date-time indicating when the resource was created.
"2018-02-02T22:25:27.521Z"
ISO 8601 formatted date-time indicating when the resource was updated.
"2018-02-02T22:25:27.521Z"
The id of the network associated with the interface.
"6a09cdc3-8948-47f0-aa62-74ac943d6c58"
A user specified name for the interface.
"test interface"
The current status of the interface deployment.
created, provisioning, provisioned, deleting "provisioned"
The publically accessible ip for this interface.
"127.0.0.1"
The region interface is deployed to.
"ashburn-va"
Was this page helpful?