Skip to content

telstra/Programmable-Network-SDK-java

Repository files navigation

Build Status

Telstra Programmable Network

Requirements

Building the API client library requires Maven to be installed.

Installation

To install the API client library to your local Maven repository, simply execute:

mvn install

To deploy it to a remote Maven repository instead, configure the settings of the repository and execute:

mvn deploy

Refer to the official documentation for more information.

Maven users

Add this dependency to your project's POM:

<dependency>
    <groupId>IO.TelstraTPN</groupId>
    <artifactId>TelstraTPN</artifactId>
    <version>1.0.0</version>
    <scope>compile</scope>
</dependency>

Gradle users

Add this dependency to your project's build file:

compile "IO.TelstraTPN:TelstraTPN:1.0.0"

Others

At first generate the JAR by executing:

mvn package

Then manually install the following JARs:

  • target/TelstraTPN-1.0.0.jar
  • target/lib/*.jar

Getting Started

Please follow the installation instruction and execute the following Java code:

import invalidPackageName.*;
import invalidPackageName.auth.*;
import TelstraTPN.*;
import TelstraTPN.AuthenticationApi;

import java.io.File;
import java.util.*;

public class AuthenticationApiExample {

    public static void main(String[] args) {
        ApiClient defaultClient = Configuration.getDefaultApiClient();
        
        // Configure OAuth2 access token for authorization: auth
        OAuth auth = (OAuth) defaultClient.getAuthentication("auth");
        auth.setAccessToken("YOUR ACCESS TOKEN");

        AuthenticationApi apiInstance = new AuthenticationApi();
        String grantType = "password"; // String | 
        String username = "username_example"; // String | 
        String password = "password_example"; // String | 
        try {
            Model100AuthGeneratetokenResponse result = apiInstance.createAnAuthenticationToken(grantType, username, password);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling AuthenticationApi#createAnAuthenticationToken");
            e.printStackTrace();
        }
    }
}

Documentation for API Endpoints

All URIs are relative to https://penapi.pacnetconnect.com

Class Method HTTP request Description
AuthenticationApi createAnAuthenticationToken POST /1.0.0/auth/generatetoken Create an authentication token
AuthenticationApi validateAuthenticationToken GET /1.0.0/auth/validatetoken Validate authentication token
ContractsApi createNewContractOnSpecifiedLink POST /1.0.0/inventory/links/{linkid}/contract Create new Contract on specified link
ContractsApi getActiveContractByContractID GET /1.0.0/inventory/links/{linkid}/contract/{contractid} Get active Contract by ContractID
ContractsApi updateActiveContractByContractID PUT /1.0.0/inventory/links/{linkid}/contract/{contractid} Update active Contract by ContractID
CustomersApi getAccountInformationDetails GET /1.0.0/account/{customeruuid} Get account information details
CustomersApi listUsers GET /1.0.0/account/{customeruuid}/user List users
DatacentresApi getListOfAllTheDataCenters GET /1.0.0/inventory/datacenters Get list of all the data centers
EndpointsApi createPhysicalPortEndpoint POST /1.0.0/inventory/regularendpoint Create Physical (Port) Endpoint
EndpointsApi createVNFEndpoint POST /1.0.0/inventory/vnfendpoint Create VNF Endpoint
EndpointsApi getInformationAboutTheSpecifiedEndpoint GET /1.0.0/inventory/endpoint/{endpointuuid} Get information about the specified endpoint
EndpointsApi getListOfEndpointsForACustomer GET /1.0.0/inventory/endpoints/customeruuid/{customeruuid} Get list of endpoints for a customer
LinksApi createLinkAndInitialContract POST /1.0.0/inventory/link Create Link and initial Contract
LinksApi getActiveLinks GET /1.0.0/inventory/links/customer/{customeruuid} Get active Links
LinksApi getDetailsOfSpecifiedLink GET /1.0.0/inventory/links/{linkid} Get details of specified link
LinksApi getLinkHistory GET /1.0.0/inventory/links/history/{linkid} Get Link history
TopologiesApi createANamedTopologyTag POST /ttms/1.0.0/topology_tag Create a named topology tag
TopologiesApi getInformationAboutTheSpecifiedTopologyTag GET /ttms/1.0.0/topology_tag/{topotaguuid}/ Get information about the specified topology tag
TopologiesApi listAllTopologyTags GET /ttms/1.0.0/topology_tag List all topology tags
TopologiesApi listObjectsForTopology GET /ttms/1.0.0/topology_tag/{topotaguuid}/objects/ List objects for Topology
VnfsApi listImagesInTheMarketplace GET /1.0.0/marketplace/image List images in the Marketplace
VportsApi createVNFVPort POST /1.0.0/inventory/vnf/vport Create VNF VPort
VportsApi createVPortForPhysicalEndpoint POST /1.0.0/inventory/regularvport Create VPort for physical endpoint
VportsApi getInformationAboutTheSpecifiedVPort GET /1.0.0/inventory/vport/{vportuuid} Get information about the specified VPort

Documentation for Models

Documentation for Authorization

Authentication schemes defined for the API:

auth

  • Type: OAuth
  • Flow: password
  • Authorization URL:
  • Scopes: N/A

Recommendation

It's recommended to create an instance of ApiClient per thread in a multithreaded environment to avoid any potential issues.