Telstra Programmable Network is a self-provisioning platform that allows its users to create on-demand connectivity services between multiple end-points and add various network functions to those services. Programmable Network enables to connectivity to a global ecosystem of networking services as well as public and private cloud services. Once you are connected to the platform on one or more POPs (points of presence), you can start creating those services based on the use case that you want to accomplish. The Programmable Network API is available to all customers who have registered to use the Programmable Network. To register, please contact your account representative.
The generated SDK relies on Node Package Manager (NPM) being available to resolve dependencies. If you don't already have NPM installed, please go ahead and follow instructions to install NPM from here. The SDK also requires Node to be installed. If Node isn't already installed, please install it from here
NPM is installed by default when Node is installed
To check if node and npm have been successfully installed, write the following commands in command prompt:
node --version
npm -version
Now use npm to resolve all dependencies by running the following command in the root directory (of the SDK folder):
npm install
This will install all dependencies in the node_modules
folder.
Once dependencies are resolved, you will need to move the folder TelstraProgrammableNetworkAPILib
in to your node_modules
folder.
The following section explains how to use the library in a new project.
Open an IDE/Text Editor for JavaScript like Sublime Text. The basic workflow presented here is also applicable if you prefer using a different editor or IDE.
Click on File
and select Open Folder
.
Select the folder of your SDK and click on Select Folder
to open it up in Sublime Text. The folder will become visible in the bar on the left.
Now right click on the folder name and select the New File
option to create a new test file. Save it as index.js
Now import the generated NodeJS library using the following lines of code:
var lib = require('lib');
Save changes.
To run the index.js
file, open up the command prompt and navigate to the Path where the SDK folder resides. Type the following command to run the file:
node index.js
These tests use Mocha framework for testing, coupled with Chai for assertions. These dependencies need to be installed for tests to run. Tests can be run in a number of ways:
- Navigate to the root directory of the SDK folder from command prompt.
- Type
mocha --recursive
to run all the tests.
- Navigate to the
../test/Controllers/
directory from command prompt. - Type
mocha *
to run all the tests.
- Navigate to the
../test/Controllers/
directory from command prompt. - Type
mocha Telstra Programmable Network APIController
to run all the tests in that controller file.
To increase mocha's default timeout, you can change the
TEST_TIMEOUT
parameter's value inTestBootstrap.js
.
API client can be initialized as following:
const lib = require('lib');
- AuthenticationController
- TopologiesController
- VnfsController
- VportsController
- LinksController
- EndpointsController
- CustomersController
- ContractsController
- DatacentresController
The singleton instance of the AuthenticationController
class can be accessed from the API Client.
var controller = lib.AuthenticationController;
Tags:
Skips Authentication
Validate the authentication token and get information about the user (roles, permissions, etc.)
function get100AuthValidatetokenGet(callback)
controller.get100AuthValidatetokenGet(function(error, response, context) {
});
Tags:
Skips Authentication
Create an authentication token
function create100AuthGeneratetokenPost(grantType, username, password, callback)
Parameter | Tags | Description |
---|---|---|
grantType | Required |
TODO: Add a parameter description |
username | Required |
TODO: Add a parameter description |
password | Required |
TODO: Add a parameter description |
var grantType = 'password';
var username = 'username';
var password = 'password';
controller.create100AuthGeneratetokenPost(grantType, username, password, function(error, response, context) {
});
Error Code | Error Description |
---|---|
412 | Provided authorization grant is invalid |
The singleton instance of the TopologiesController
class can be accessed from the API Client.
var controller = lib.TopologiesController;
Tags:
Skips Authentication
Delete a topology tag
function deleteTtms100TopologyTagByTopotaguuidDelete(topotaguuid, callback)
Parameter | Tags | Description |
---|---|---|
topotaguuid | Required |
Unique identifier representing a specific topology tag |
var topotaguuid = 'topotaguuid';
controller.deleteTtms100TopologyTagByTopotaguuidDelete(topotaguuid, function(error, response, context) {
});
Tags:
Skips Authentication
Get information about the specified topology tag
function getTtms100TopologyTagByTopotaguuidGet(topotaguuid, callback)
Parameter | Tags | Description |
---|---|---|
topotaguuid | Required |
Unique identifier representing a specific topology tag |
var topotaguuid = 'topotaguuid';
controller.getTtms100TopologyTagByTopotaguuidGet(topotaguuid, function(error, response, context) {
});
Tags:
Skips Authentication
Create a named topology tag
function createTtms100TopologyTagPost(body, callback)
Parameter | Tags | Description |
---|---|---|
body | Optional |
TODO: Add a parameter description |
var body = new Ttms100TopologyTagRequest({"key":"value"});
controller.createTtms100TopologyTagPost(body, function(error, response, context) {
});
Tags:
Skips Authentication
List all topology tags
function getTtms100TopologyTagGet(callback)
controller.getTtms100TopologyTagGet(function(error, response, context) {
});
Tags:
Skips Authentication
List all objects (Endpoints, Links, VPorts, etc.) associated with the topology tag.
function getTtms100TopologyTagObjectsByTopotaguuidGet(topotaguuid, callback)
Parameter | Tags | Description |
---|---|---|
topotaguuid | Required |
Unique identifier representing a specific topology tag |
var topotaguuid = 'topotaguuid';
controller.getTtms100TopologyTagObjectsByTopotaguuidGet(topotaguuid, function(error, response, context) {
});
Tags:
Skips Authentication
Update a topology tag's name and/or description
function updateTtms100TopologyTagByTopotaguuidPut(topotaguuid, body, callback)
Parameter | Tags | Description |
---|---|---|
topotaguuid | Required |
Unique identifier representing a specific topology tag |
body | Optional |
TODO: Add a parameter description |
var topotaguuid = 'topotaguuid';
var body = new Ttms100TopologyTagRequest({"key":"value"});
controller.updateTtms100TopologyTagByTopotaguuidPut(topotaguuid, body, function(error, response, context) {
});
The singleton instance of the VnfsController
class can be accessed from the API Client.
var controller = lib.VnfsController;
Tags:
Skips Authentication
List images in the Marketplace
function get100MarketplaceImageGet(callback)
controller.get100MarketplaceImageGet(function(error, response, context) {
});
The singleton instance of the VportsController
class can be accessed from the API Client.
var controller = lib.VportsController;
Tags:
Skips Authentication
Get information about the specified VPort
function get100InventoryVportByVportuuidGet(vportuuid, callback)
Parameter | Tags | Description |
---|---|---|
vportuuid | Required |
Unique identifier representing a specific virtual port |
var vportuuid = 'vportuuid';
controller.get100InventoryVportByVportuuidGet(vportuuid, function(error, response, context) {
});
Tags:
Skips Authentication
Create VPort representing a VLAN on a Physical Ethernet Port
function create100InventoryRegularvportPost(body, callback)
Parameter | Tags | Description |
---|---|---|
body | Optional |
TODO: Add a parameter description |
var body = new M100InventoryRegularvportRequest({"key":"value"});
controller.create100InventoryRegularvportPost(body, function(error, response, context) {
});
Tags:
Skips Authentication
Create VNF VPort
function create100InventoryVnfVportPost(body, callback)
Parameter | Tags | Description |
---|---|---|
body | Optional |
TODO: Add a parameter description |
var body = new M100InventoryVnfVportRequest({"key":"value"});
controller.create100InventoryVnfVportPost(body, function(error, response, context) {
});
The singleton instance of the LinksController
class can be accessed from the API Client.
var controller = lib.LinksController;
Tags:
Skips Authentication
Get details of specified link
function get100InventoryLinksByLinkidGet(linkid, callback)
Parameter | Tags | Description |
---|---|---|
linkid | Required |
Unique identifier representing a specific link |
var linkid = 'linkid';
controller.get100InventoryLinksByLinkidGet(linkid, function(error, response, context) {
});
Tags:
Skips Authentication
Get Link history
function get100InventoryLinksHistoryByLinkidGet(linkid, callback)
Parameter | Tags | Description |
---|---|---|
linkid | Required |
Unique identifier representing a specific link |
var linkid = 'linkid';
controller.get100InventoryLinksHistoryByLinkidGet(linkid, function(error, response, context) {
});
Tags:
Skips Authentication
Get active Links
function get100InventoryLinksCustomerByCustomeruuidGet(customeruuid, callback)
Parameter | Tags | Description |
---|---|---|
customeruuid | Required |
Unique identifier representing a specific customer |
var customeruuid = 'customeruuid';
controller.get100InventoryLinksCustomerByCustomeruuidGet(customeruuid, function(error, response, context) {
});
Tags:
Skips Authentication
Create Link and initial Contract
function create100InventoryLinkPost(body, callback)
Parameter | Tags | Description |
---|---|---|
body | Optional |
TODO: Add a parameter description |
var body = new M100InventoryLinkRequest({"key":"value"});
controller.create100InventoryLinkPost(body, function(error, response, context) {
});
The singleton instance of the EndpointsController
class can be accessed from the API Client.
var controller = lib.EndpointsController;
Tags:
Skips Authentication
Create Physical (Port) Endpoint
function create100InventoryRegularendpointPost(body, callback)
Parameter | Tags | Description |
---|---|---|
body | Optional |
TODO: Add a parameter description |
var body = new M100InventoryRegularendpointRequest({"key":"value"});
controller.create100InventoryRegularendpointPost(body, function(error, response, context) {
});
Tags:
Skips Authentication
Create VNF Endpoint
function create100InventoryVnfendpointPost(body, callback)
Parameter | Tags | Description |
---|---|---|
body | Optional |
TODO: Add a parameter description |
var body = new M100InventoryVnfendpointRequest({"key":"value"});
controller.create100InventoryVnfendpointPost(body, function(error, response, context) {
});
Tags:
Skips Authentication
Assign a Topology Tag to an Endpoint
function createEis100EndpointsAssignTopologyTagByEndpointuuidPost(endpointuuid, body, callback)
Parameter | Tags | Description |
---|---|---|
endpointuuid | Required |
Unique identifier representing a specific endpoint |
body | Optional |
TODO: Add a parameter description |
var endpointuuid = 'endpointuuid';
var body = new Eis100EndpointsAssignTopologyTagRequest({"key":"value"});
controller.createEis100EndpointsAssignTopologyTagByEndpointuuidPost(endpointuuid, body, function(error, response, context) {
});
Tags:
Skips Authentication
Get information about the specified endpoint
function get100InventoryEndpointByEndpointuuidGet(endpointuuid, callback)
Parameter | Tags | Description |
---|---|---|
endpointuuid | Required |
Unique identifier representing a specific endpoint |
var endpointuuid = 'endpointuuid';
controller.get100InventoryEndpointByEndpointuuidGet(endpointuuid, function(error, response, context) {
});
Tags:
Skips Authentication
Get list of endpoints for a customer
function get100InventoryEndpointsCustomeruuidByCustomeruuidGet(customeruuid, callback)
Parameter | Tags | Description |
---|---|---|
customeruuid | Required |
Unique identifier representing a specific customer |
var customeruuid = 'customeruuid';
controller.get100InventoryEndpointsCustomeruuidByCustomeruuidGet(customeruuid, function(error, response, context) {
});
The singleton instance of the CustomersController
class can be accessed from the API Client.
var controller = lib.CustomersController;
Tags:
Skips Authentication
Get the account information for the specified customer
function get100AccountByCustomeruuidGet(customeruuid, callback)
Parameter | Tags | Description |
---|---|---|
customeruuid | Required |
Unique identifier representing a specific customer |
var customeruuid = 'customeruuid';
controller.get100AccountByCustomeruuidGet(customeruuid, function(error, response, context) {
});
Error Code | Error Description |
---|---|
401 | Authorization Failed |
Tags:
Skips Authentication
List all users associated with the specified customer
function get100AccountUserByCustomeruuidGet(customeruuid, callback)
Parameter | Tags | Description |
---|---|---|
customeruuid | Required |
Unique identifier representing a specific customer |
var customeruuid = 'customeruuid';
controller.get100AccountUserByCustomeruuidGet(customeruuid, function(error, response, context) {
});
The singleton instance of the ContractsController
class can be accessed from the API Client.
var controller = lib.ContractsController;
Tags:
Skips Authentication
Create new Contract on specified link
function create100InventoryLinksContractByLinkidPost(linkid, body, callback)
Parameter | Tags | Description |
---|---|---|
linkid | Required |
Unique identifier representing a specific link |
body | Optional |
TODO: Add a parameter description |
var linkid = 'linkid';
var body = new M100InventoryLinksContractRequest37({"key":"value"});
controller.create100InventoryLinksContractByLinkidPost(linkid, body, function(error, response, context) {
});
Tags:
Skips Authentication
Update active Contract by ContractID
function update100InventoryLinksContractByLinkidAndContractidPut(linkid, contractid, body, callback)
Parameter | Tags | Description |
---|---|---|
linkid | Required |
Unique identifier representing a specific link |
contractid | Required |
Unique identifier representing a specific contract |
body | Optional |
TODO: Add a parameter description |
var linkid = 'linkid';
var contractid = 'contractid';
var body = new M100InventoryLinksContractRequest({"key":"value"});
controller.update100InventoryLinksContractByLinkidAndContractidPut(linkid, contractid, body, function(error, response, context) {
});
Tags:
Skips Authentication
Get active Contract by ContractID
function get100InventoryLinksContractByLinkidAndContractidGet(linkid, contractid, callback)
Parameter | Tags | Description |
---|---|---|
linkid | Required |
Unique identifier representing a specific link |
contractid | Required |
Unique identifier representing a specific contract |
var linkid = 'linkid';
var contractid = 'contractid';
controller.get100InventoryLinksContractByLinkidAndContractidGet(linkid, contractid, function(error, response, context) {
});
The singleton instance of the DatacentresController
class can be accessed from the API Client.
var controller = lib.DatacentresController;
Tags:
Skips Authentication
Get list of all the data centers
function get100InventoryDatacentersGet(callback)
controller.get100InventoryDatacentersGet(function(error, response, context) {
});
Error Code | Error Description |
---|---|
400 | Request is not correctly formatted |
401 | Missing Token |
403 | Authorization Failed |
404 | Specified object cannot be found |
405 | Method Not Allowed |
409 | Status onflict |
422 | Request is invalid |
0 | Backend Error |