Skip to content

Latest commit

 

History

History
682 lines (498 loc) · 21.4 KB

NetworksApi.md

File metadata and controls

682 lines (498 loc) · 21.4 KB

NetworksApi

All URIs are relative to https://api.telnyx.com/v2

Method HTTP request Description
createDefaultGateway POST /networks/{id}/default_gateway Create Default Gateway.
createNetwork POST /networks Create a Network
deleteDefaultGateway DELETE /networks/{id}/default_gateway Delete Default Gateway.
deleteNetwork DELETE /networks/{id} Delete a Network
getDefaultGateway GET /networks/{id}/default_gateway Get Default Gateway status.
getNetwork GET /networks/{id} Retrieve a Network
listNetworkInterfaces GET /networks/{id}/network_interfaces List all Interfaces for a Network.
listNetworks GET /networks List all Networks
updateNetwork PATCH /networks/{id} Update a Network

createDefaultGateway

GetDefaultGateway200Response createDefaultGateway(id, defaultGateway)

Create Default Gateway.

Create Default Gateway.

Example

import java.util.UUID;
// Import classes:
import com.telnyx.sdk.ApiClient;
import com.telnyx.sdk.ApiException;
import com.telnyx.sdk.Configuration;
import com.telnyx.sdk.auth.*;
import com.telnyx.sdk.model.*;
import com.telnyx.sdk.api.NetworksApi;

public class Example {
    public static void main(String[] args) {
        ApiClient defaultClient = Configuration.getDefaultApiClient();
        defaultClient.setBasePath("https://api.telnyx.com/v2");
        
        // Configure HTTP bearer authorization: bearerAuth
        HttpBearerAuth bearerAuth = (HttpBearerAuth) defaultClient.getAuthentication("bearerAuth");
        bearerAuth.setBearerToken("BEARER TOKEN");

        NetworksApi apiInstance = new NetworksApi(defaultClient);
        UUID id = UUID.fromString("6a09cdc3-8948-47f0-aa62-74ac943d6c58"); // UUID | Identifies the resource.
        DefaultGateway defaultGateway = new DefaultGateway(); // DefaultGateway | 
        try {
            GetDefaultGateway200Response result = apiInstance.createDefaultGateway(id, defaultGateway);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling NetworksApi#createDefaultGateway");
            System.err.println("Status code: " + e.getCode());
            System.err.println("Reason: " + e.getResponseBody());
            System.err.println("Response headers: " + e.getResponseHeaders());
            e.printStackTrace();
        }
    }
}

Parameters

Name Type Description Notes
id UUID Identifies the resource.
defaultGateway DefaultGateway

Return type

GetDefaultGateway200Response

Authorization

bearerAuth

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

HTTP response details

Status code Description Response headers
200 Successful response -
0 Unexpected error -

createNetwork

CreateNetwork200Response createNetwork(networkCreate)

Create a Network

Create a new Network.

Example

// Import classes:
import com.telnyx.sdk.ApiClient;
import com.telnyx.sdk.ApiException;
import com.telnyx.sdk.Configuration;
import com.telnyx.sdk.auth.*;
import com.telnyx.sdk.model.*;
import com.telnyx.sdk.api.NetworksApi;

public class Example {
    public static void main(String[] args) {
        ApiClient defaultClient = Configuration.getDefaultApiClient();
        defaultClient.setBasePath("https://api.telnyx.com/v2");
        
        // Configure HTTP bearer authorization: bearerAuth
        HttpBearerAuth bearerAuth = (HttpBearerAuth) defaultClient.getAuthentication("bearerAuth");
        bearerAuth.setBearerToken("BEARER TOKEN");

        NetworksApi apiInstance = new NetworksApi(defaultClient);
        NetworkCreate networkCreate = new NetworkCreate(); // NetworkCreate | 
        try {
            CreateNetwork200Response result = apiInstance.createNetwork(networkCreate);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling NetworksApi#createNetwork");
            System.err.println("Status code: " + e.getCode());
            System.err.println("Reason: " + e.getResponseBody());
            System.err.println("Response headers: " + e.getResponseHeaders());
            e.printStackTrace();
        }
    }
}

Parameters

Name Type Description Notes
networkCreate NetworkCreate

Return type

CreateNetwork200Response

Authorization

bearerAuth

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

HTTP response details

Status code Description Response headers
200 Successful response -
422 Unprocessable entity. Check the 'detail' field in response for details. -
0 Unexpected error -

deleteDefaultGateway

GetDefaultGateway200Response deleteDefaultGateway(id)

Delete Default Gateway.

Delete Default Gateway.

Example

import java.util.UUID;
// Import classes:
import com.telnyx.sdk.ApiClient;
import com.telnyx.sdk.ApiException;
import com.telnyx.sdk.Configuration;
import com.telnyx.sdk.auth.*;
import com.telnyx.sdk.model.*;
import com.telnyx.sdk.api.NetworksApi;

public class Example {
    public static void main(String[] args) {
        ApiClient defaultClient = Configuration.getDefaultApiClient();
        defaultClient.setBasePath("https://api.telnyx.com/v2");
        
        // Configure HTTP bearer authorization: bearerAuth
        HttpBearerAuth bearerAuth = (HttpBearerAuth) defaultClient.getAuthentication("bearerAuth");
        bearerAuth.setBearerToken("BEARER TOKEN");

        NetworksApi apiInstance = new NetworksApi(defaultClient);
        UUID id = UUID.fromString("6a09cdc3-8948-47f0-aa62-74ac943d6c58"); // UUID | Identifies the resource.
        try {
            GetDefaultGateway200Response result = apiInstance.deleteDefaultGateway(id);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling NetworksApi#deleteDefaultGateway");
            System.err.println("Status code: " + e.getCode());
            System.err.println("Reason: " + e.getResponseBody());
            System.err.println("Response headers: " + e.getResponseHeaders());
            e.printStackTrace();
        }
    }
}

Parameters

Name Type Description Notes
id UUID Identifies the resource.

Return type

GetDefaultGateway200Response

Authorization

bearerAuth

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

HTTP response details

Status code Description Response headers
200 Successful response -
0 Unexpected error -

deleteNetwork

CreateNetwork200Response deleteNetwork(id)

Delete a Network

Delete a Network.

Example

import java.util.UUID;
// Import classes:
import com.telnyx.sdk.ApiClient;
import com.telnyx.sdk.ApiException;
import com.telnyx.sdk.Configuration;
import com.telnyx.sdk.auth.*;
import com.telnyx.sdk.model.*;
import com.telnyx.sdk.api.NetworksApi;

public class Example {
    public static void main(String[] args) {
        ApiClient defaultClient = Configuration.getDefaultApiClient();
        defaultClient.setBasePath("https://api.telnyx.com/v2");
        
        // Configure HTTP bearer authorization: bearerAuth
        HttpBearerAuth bearerAuth = (HttpBearerAuth) defaultClient.getAuthentication("bearerAuth");
        bearerAuth.setBearerToken("BEARER TOKEN");

        NetworksApi apiInstance = new NetworksApi(defaultClient);
        UUID id = UUID.fromString("6a09cdc3-8948-47f0-aa62-74ac943d6c58"); // UUID | Identifies the resource.
        try {
            CreateNetwork200Response result = apiInstance.deleteNetwork(id);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling NetworksApi#deleteNetwork");
            System.err.println("Status code: " + e.getCode());
            System.err.println("Reason: " + e.getResponseBody());
            System.err.println("Response headers: " + e.getResponseHeaders());
            e.printStackTrace();
        }
    }
}

Parameters

Name Type Description Notes
id UUID Identifies the resource.

Return type

CreateNetwork200Response

Authorization

bearerAuth

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

HTTP response details

Status code Description Response headers
200 Successful response -
0 Unexpected error -

getDefaultGateway

GetDefaultGateway200Response getDefaultGateway(id)

Get Default Gateway status.

Get Default Gateway status.

Example

import java.util.UUID;
// Import classes:
import com.telnyx.sdk.ApiClient;
import com.telnyx.sdk.ApiException;
import com.telnyx.sdk.Configuration;
import com.telnyx.sdk.auth.*;
import com.telnyx.sdk.model.*;
import com.telnyx.sdk.api.NetworksApi;

public class Example {
    public static void main(String[] args) {
        ApiClient defaultClient = Configuration.getDefaultApiClient();
        defaultClient.setBasePath("https://api.telnyx.com/v2");
        
        // Configure HTTP bearer authorization: bearerAuth
        HttpBearerAuth bearerAuth = (HttpBearerAuth) defaultClient.getAuthentication("bearerAuth");
        bearerAuth.setBearerToken("BEARER TOKEN");

        NetworksApi apiInstance = new NetworksApi(defaultClient);
        UUID id = UUID.fromString("6a09cdc3-8948-47f0-aa62-74ac943d6c58"); // UUID | Identifies the resource.
        try {
            GetDefaultGateway200Response result = apiInstance.getDefaultGateway(id);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling NetworksApi#getDefaultGateway");
            System.err.println("Status code: " + e.getCode());
            System.err.println("Reason: " + e.getResponseBody());
            System.err.println("Response headers: " + e.getResponseHeaders());
            e.printStackTrace();
        }
    }
}

Parameters

Name Type Description Notes
id UUID Identifies the resource.

Return type

GetDefaultGateway200Response

Authorization

bearerAuth

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

HTTP response details

Status code Description Response headers
200 Successful response -
0 Unexpected error -

getNetwork

CreateNetwork200Response getNetwork(id)

Retrieve a Network

Retrieve a Network.

Example

import java.util.UUID;
// Import classes:
import com.telnyx.sdk.ApiClient;
import com.telnyx.sdk.ApiException;
import com.telnyx.sdk.Configuration;
import com.telnyx.sdk.auth.*;
import com.telnyx.sdk.model.*;
import com.telnyx.sdk.api.NetworksApi;

public class Example {
    public static void main(String[] args) {
        ApiClient defaultClient = Configuration.getDefaultApiClient();
        defaultClient.setBasePath("https://api.telnyx.com/v2");
        
        // Configure HTTP bearer authorization: bearerAuth
        HttpBearerAuth bearerAuth = (HttpBearerAuth) defaultClient.getAuthentication("bearerAuth");
        bearerAuth.setBearerToken("BEARER TOKEN");

        NetworksApi apiInstance = new NetworksApi(defaultClient);
        UUID id = UUID.fromString("6a09cdc3-8948-47f0-aa62-74ac943d6c58"); // UUID | Identifies the resource.
        try {
            CreateNetwork200Response result = apiInstance.getNetwork(id);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling NetworksApi#getNetwork");
            System.err.println("Status code: " + e.getCode());
            System.err.println("Reason: " + e.getResponseBody());
            System.err.println("Response headers: " + e.getResponseHeaders());
            e.printStackTrace();
        }
    }
}

Parameters

Name Type Description Notes
id UUID Identifies the resource.

Return type

CreateNetwork200Response

Authorization

bearerAuth

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

HTTP response details

Status code Description Response headers
200 Successful response -
0 Unexpected error -

listNetworkInterfaces

ListNetworkInterfaces200Response listNetworkInterfaces(id, pageNumber, pageSize, filterName, filterType, filterStatus)

List all Interfaces for a Network.

List all Interfaces for a Network.

Example

import java.util.UUID;
// Import classes:
import com.telnyx.sdk.ApiClient;
import com.telnyx.sdk.ApiException;
import com.telnyx.sdk.Configuration;
import com.telnyx.sdk.auth.*;
import com.telnyx.sdk.model.*;
import com.telnyx.sdk.api.NetworksApi;

public class Example {
    public static void main(String[] args) {
        ApiClient defaultClient = Configuration.getDefaultApiClient();
        defaultClient.setBasePath("https://api.telnyx.com/v2");
        
        // Configure HTTP bearer authorization: bearerAuth
        HttpBearerAuth bearerAuth = (HttpBearerAuth) defaultClient.getAuthentication("bearerAuth");
        bearerAuth.setBearerToken("BEARER TOKEN");

        NetworksApi apiInstance = new NetworksApi(defaultClient);
        UUID id = UUID.fromString("6a09cdc3-8948-47f0-aa62-74ac943d6c58"); // UUID | Identifies the resource.
        Integer pageNumber = 1; // Integer | The page number to load
        Integer pageSize = 20; // Integer | The size of the page
        String filterName = "test interface"; // String | The interface name to filter on.
        String filterType = "wireguard_interface"; // String | The interface type to filter on.
        InterfaceStatus filterStatus = InterfaceStatus.fromValue("created"); // InterfaceStatus | The interface status to filter on.
        try {
            ListNetworkInterfaces200Response result = apiInstance.listNetworkInterfaces(id, pageNumber, pageSize, filterName, filterType, filterStatus);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling NetworksApi#listNetworkInterfaces");
            System.err.println("Status code: " + e.getCode());
            System.err.println("Reason: " + e.getResponseBody());
            System.err.println("Response headers: " + e.getResponseHeaders());
            e.printStackTrace();
        }
    }
}

Parameters

Name Type Description Notes
id UUID Identifies the resource.
pageNumber Integer The page number to load [optional] [default to 1]
pageSize Integer The size of the page [optional] [default to 20]
filterName String The interface name to filter on. [optional]
filterType String The interface type to filter on. [optional]
filterStatus InterfaceStatus The interface status to filter on. [optional] [enum: created, provisioning, provisioned, deleting]

Return type

ListNetworkInterfaces200Response

Authorization

bearerAuth

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

HTTP response details

Status code Description Response headers
200 Successful response -
0 Unexpected error -

listNetworks

ListNetworks200Response listNetworks(pageNumber, pageSize, filterName)

List all Networks

List all Networks.

Example

// Import classes:
import com.telnyx.sdk.ApiClient;
import com.telnyx.sdk.ApiException;
import com.telnyx.sdk.Configuration;
import com.telnyx.sdk.auth.*;
import com.telnyx.sdk.model.*;
import com.telnyx.sdk.api.NetworksApi;

public class Example {
    public static void main(String[] args) {
        ApiClient defaultClient = Configuration.getDefaultApiClient();
        defaultClient.setBasePath("https://api.telnyx.com/v2");
        
        // Configure HTTP bearer authorization: bearerAuth
        HttpBearerAuth bearerAuth = (HttpBearerAuth) defaultClient.getAuthentication("bearerAuth");
        bearerAuth.setBearerToken("BEARER TOKEN");

        NetworksApi apiInstance = new NetworksApi(defaultClient);
        Integer pageNumber = 1; // Integer | The page number to load
        Integer pageSize = 20; // Integer | The size of the page
        String filterName = "test network"; // String | The network name to filter on.
        try {
            ListNetworks200Response result = apiInstance.listNetworks(pageNumber, pageSize, filterName);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling NetworksApi#listNetworks");
            System.err.println("Status code: " + e.getCode());
            System.err.println("Reason: " + e.getResponseBody());
            System.err.println("Response headers: " + e.getResponseHeaders());
            e.printStackTrace();
        }
    }
}

Parameters

Name Type Description Notes
pageNumber Integer The page number to load [optional] [default to 1]
pageSize Integer The size of the page [optional] [default to 20]
filterName String The network name to filter on. [optional]

Return type

ListNetworks200Response

Authorization

bearerAuth

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

HTTP response details

Status code Description Response headers
200 Successful response -
0 Unexpected error -

updateNetwork

CreateNetwork200Response updateNetwork(id, networkCreate)

Update a Network

Update a Network.

Example

import java.util.UUID;
// Import classes:
import com.telnyx.sdk.ApiClient;
import com.telnyx.sdk.ApiException;
import com.telnyx.sdk.Configuration;
import com.telnyx.sdk.auth.*;
import com.telnyx.sdk.model.*;
import com.telnyx.sdk.api.NetworksApi;

public class Example {
    public static void main(String[] args) {
        ApiClient defaultClient = Configuration.getDefaultApiClient();
        defaultClient.setBasePath("https://api.telnyx.com/v2");
        
        // Configure HTTP bearer authorization: bearerAuth
        HttpBearerAuth bearerAuth = (HttpBearerAuth) defaultClient.getAuthentication("bearerAuth");
        bearerAuth.setBearerToken("BEARER TOKEN");

        NetworksApi apiInstance = new NetworksApi(defaultClient);
        UUID id = UUID.fromString("6a09cdc3-8948-47f0-aa62-74ac943d6c58"); // UUID | Identifies the resource.
        NetworkCreate networkCreate = new NetworkCreate(); // NetworkCreate | 
        try {
            CreateNetwork200Response result = apiInstance.updateNetwork(id, networkCreate);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling NetworksApi#updateNetwork");
            System.err.println("Status code: " + e.getCode());
            System.err.println("Reason: " + e.getResponseBody());
            System.err.println("Response headers: " + e.getResponseHeaders());
            e.printStackTrace();
        }
    }
}

Parameters

Name Type Description Notes
id UUID Identifies the resource.
networkCreate NetworkCreate

Return type

CreateNetwork200Response

Authorization

bearerAuth

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

HTTP response details

Status code Description Response headers
200 Successful response -
0 Unexpected error -