Skip to content

Latest commit

 

History

History
497 lines (394 loc) · 15.8 KB

PrivateNetworksApi.md

File metadata and controls

497 lines (394 loc) · 15.8 KB

Org.OpenAPITools.Api.PrivateNetworksApi

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

Method HTTP request Description
CreateNetwork POST /private-networks Create a Private Network
DeleteNetwork DELETE /private-networks/{network-id} Delete a private network
GetNetwork GET /private-networks/{network-id} Get a private network
ListNetworks GET /private-networks List Private Networks
UpdateNetwork PUT /private-networks/{network-id} Update a Private Network

CreateNetwork

GetNetwork200Response CreateNetwork (CreateNetworkRequest? createNetworkRequest = null)

Create a Private Network

Create a new Private Network in a region. Deprecated: Use Create VPC instead. Private networks should use RFC1918 private address space: 10.0.0.0 - 10.255.255.255 (10/8 prefix) 172.16.0.0 - 172.31.255.255 (172.16/12 prefix) 192.168.0.0 - 192.168.255.255 (192.168/16 prefix)

Example

using System.Collections.Generic;
using System.Diagnostics;
using Org.OpenAPITools.Api;
using Org.OpenAPITools.Client;
using Org.OpenAPITools.Model;

namespace Example
{
    public class CreateNetworkExample
    {
        public static void Main()
        {
            Configuration config = new Configuration();
            config.BasePath = "https://api.vultr.com/v2";
            // Configure Bearer token for authorization: API Key
            config.AccessToken = "YOUR_BEARER_TOKEN";

            var apiInstance = new PrivateNetworksApi(config);
            var createNetworkRequest = new CreateNetworkRequest?(); // CreateNetworkRequest? | Include a JSON object in the request body with a content type of **application/json**. (optional) 

            try
            {
                // Create a Private Network
                GetNetwork200Response result = apiInstance.CreateNetwork(createNetworkRequest);
                Debug.WriteLine(result);
            }
            catch (ApiException  e)
            {
                Debug.Print("Exception when calling PrivateNetworksApi.CreateNetwork: " + e.Message);
                Debug.Print("Status Code: " + e.ErrorCode);
                Debug.Print(e.StackTrace);
            }
        }
    }
}

Using the CreateNetworkWithHttpInfo variant

This returns an ApiResponse object which contains the response data, status code and headers.

try
{
    // Create a Private Network
    ApiResponse<GetNetwork200Response> response = apiInstance.CreateNetworkWithHttpInfo(createNetworkRequest);
    Debug.Write("Status Code: " + response.StatusCode);
    Debug.Write("Response Headers: " + response.Headers);
    Debug.Write("Response Body: " + response.Data);
}
catch (ApiException e)
{
    Debug.Print("Exception when calling PrivateNetworksApi.CreateNetworkWithHttpInfo: " + e.Message);
    Debug.Print("Status Code: " + e.ErrorCode);
    Debug.Print(e.StackTrace);
}

Parameters

Name Type Description Notes
createNetworkRequest CreateNetworkRequest? Include a JSON object in the request body with a content type of application/json. [optional]

Return type

GetNetwork200Response

Authorization

[API Key](../README.md#API Key)

HTTP request headers

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

HTTP response details

Status code Description Response headers
201 Created -
400 Bad Request -
401 Unauthorized -
404 Not Found -

[Back to top] [Back to API list] [Back to Model list] [Back to README]

DeleteNetwork

void DeleteNetwork (string networkId)

Delete a private network

Delete a Private Network.

Deprecated: Use Delete VPC instead.

Example

using System.Collections.Generic;
using System.Diagnostics;
using Org.OpenAPITools.Api;
using Org.OpenAPITools.Client;
using Org.OpenAPITools.Model;

namespace Example
{
    public class DeleteNetworkExample
    {
        public static void Main()
        {
            Configuration config = new Configuration();
            config.BasePath = "https://api.vultr.com/v2";
            // Configure Bearer token for authorization: API Key
            config.AccessToken = "YOUR_BEARER_TOKEN";

            var apiInstance = new PrivateNetworksApi(config);
            var networkId = "networkId_example";  // string | The [Network id](#operation/list-networks).

            try
            {
                // Delete a private network
                apiInstance.DeleteNetwork(networkId);
            }
            catch (ApiException  e)
            {
                Debug.Print("Exception when calling PrivateNetworksApi.DeleteNetwork: " + e.Message);
                Debug.Print("Status Code: " + e.ErrorCode);
                Debug.Print(e.StackTrace);
            }
        }
    }
}

Using the DeleteNetworkWithHttpInfo variant

This returns an ApiResponse object which contains the response data, status code and headers.

try
{
    // Delete a private network
    apiInstance.DeleteNetworkWithHttpInfo(networkId);
}
catch (ApiException e)
{
    Debug.Print("Exception when calling PrivateNetworksApi.DeleteNetworkWithHttpInfo: " + e.Message);
    Debug.Print("Status Code: " + e.ErrorCode);
    Debug.Print(e.StackTrace);
}

Parameters

Name Type Description Notes
networkId string The Network id.

Return type

void (empty response body)

Authorization

[API Key](../README.md#API Key)

HTTP request headers

  • Content-Type: Not defined
  • Accept: Not defined

HTTP response details

Status code Description Response headers
204 No Content -
400 Bad Request -
401 Unauthorized -
403 Forbidden -
404 Not Found -

[Back to top] [Back to API list] [Back to Model list] [Back to README]

GetNetwork

GetNetwork200Response GetNetwork (string networkId)

Get a private network

Get information about a Private Network.

Deprecated: Use Get VPC instead.

Example

using System.Collections.Generic;
using System.Diagnostics;
using Org.OpenAPITools.Api;
using Org.OpenAPITools.Client;
using Org.OpenAPITools.Model;

namespace Example
{
    public class GetNetworkExample
    {
        public static void Main()
        {
            Configuration config = new Configuration();
            config.BasePath = "https://api.vultr.com/v2";
            // Configure Bearer token for authorization: API Key
            config.AccessToken = "YOUR_BEARER_TOKEN";

            var apiInstance = new PrivateNetworksApi(config);
            var networkId = "networkId_example";  // string | The [Network id](#operation/list-networks).

            try
            {
                // Get a private network
                GetNetwork200Response result = apiInstance.GetNetwork(networkId);
                Debug.WriteLine(result);
            }
            catch (ApiException  e)
            {
                Debug.Print("Exception when calling PrivateNetworksApi.GetNetwork: " + e.Message);
                Debug.Print("Status Code: " + e.ErrorCode);
                Debug.Print(e.StackTrace);
            }
        }
    }
}

Using the GetNetworkWithHttpInfo variant

This returns an ApiResponse object which contains the response data, status code and headers.

try
{
    // Get a private network
    ApiResponse<GetNetwork200Response> response = apiInstance.GetNetworkWithHttpInfo(networkId);
    Debug.Write("Status Code: " + response.StatusCode);
    Debug.Write("Response Headers: " + response.Headers);
    Debug.Write("Response Body: " + response.Data);
}
catch (ApiException e)
{
    Debug.Print("Exception when calling PrivateNetworksApi.GetNetworkWithHttpInfo: " + e.Message);
    Debug.Print("Status Code: " + e.ErrorCode);
    Debug.Print(e.StackTrace);
}

Parameters

Name Type Description Notes
networkId string The Network id.

Return type

GetNetwork200Response

Authorization

[API Key](../README.md#API Key)

HTTP request headers

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

HTTP response details

Status code Description Response headers
200 OK -
400 Bad Request -
401 Unauthorized -
403 Forbidden -
404 Not Found -

[Back to top] [Back to API list] [Back to Model list] [Back to README]

ListNetworks

ListNetworks200Response ListNetworks (int? perPage = null, string? cursor = null)

List Private Networks

Get a list of all Private Networks in your account.

Deprecated: Use List VPCs instead.

Example

using System.Collections.Generic;
using System.Diagnostics;
using Org.OpenAPITools.Api;
using Org.OpenAPITools.Client;
using Org.OpenAPITools.Model;

namespace Example
{
    public class ListNetworksExample
    {
        public static void Main()
        {
            Configuration config = new Configuration();
            config.BasePath = "https://api.vultr.com/v2";
            // Configure Bearer token for authorization: API Key
            config.AccessToken = "YOUR_BEARER_TOKEN";

            var apiInstance = new PrivateNetworksApi(config);
            var perPage = 56;  // int? | Number of items requested per page. Default is 100 and Max is 500. (optional) 
            var cursor = "cursor_example";  // string? | Cursor for paging. See [Meta and Pagination](#section/Introduction/Meta-and-Pagination). (optional) 

            try
            {
                // List Private Networks
                ListNetworks200Response result = apiInstance.ListNetworks(perPage, cursor);
                Debug.WriteLine(result);
            }
            catch (ApiException  e)
            {
                Debug.Print("Exception when calling PrivateNetworksApi.ListNetworks: " + e.Message);
                Debug.Print("Status Code: " + e.ErrorCode);
                Debug.Print(e.StackTrace);
            }
        }
    }
}

Using the ListNetworksWithHttpInfo variant

This returns an ApiResponse object which contains the response data, status code and headers.

try
{
    // List Private Networks
    ApiResponse<ListNetworks200Response> response = apiInstance.ListNetworksWithHttpInfo(perPage, cursor);
    Debug.Write("Status Code: " + response.StatusCode);
    Debug.Write("Response Headers: " + response.Headers);
    Debug.Write("Response Body: " + response.Data);
}
catch (ApiException e)
{
    Debug.Print("Exception when calling PrivateNetworksApi.ListNetworksWithHttpInfo: " + e.Message);
    Debug.Print("Status Code: " + e.ErrorCode);
    Debug.Print(e.StackTrace);
}

Parameters

Name Type Description Notes
perPage int? Number of items requested per page. Default is 100 and Max is 500. [optional]
cursor string? Cursor for paging. See Meta and Pagination. [optional]

Return type

ListNetworks200Response

Authorization

[API Key](../README.md#API Key)

HTTP request headers

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

HTTP response details

Status code Description Response headers
200 OK -
400 Bad Request -
401 Unauthorized -
403 Forbidden -
404 Not Found -

[Back to top] [Back to API list] [Back to Model list] [Back to README]

UpdateNetwork

void UpdateNetwork (string networkId, UpdateNetworkRequest? updateNetworkRequest = null)

Update a Private Network

Update information for a Private Network.

Deprecated: Use Update VPC instead.

Example

using System.Collections.Generic;
using System.Diagnostics;
using Org.OpenAPITools.Api;
using Org.OpenAPITools.Client;
using Org.OpenAPITools.Model;

namespace Example
{
    public class UpdateNetworkExample
    {
        public static void Main()
        {
            Configuration config = new Configuration();
            config.BasePath = "https://api.vultr.com/v2";
            // Configure Bearer token for authorization: API Key
            config.AccessToken = "YOUR_BEARER_TOKEN";

            var apiInstance = new PrivateNetworksApi(config);
            var networkId = "networkId_example";  // string | The [Network id](#operation/list-networks).
            var updateNetworkRequest = new UpdateNetworkRequest?(); // UpdateNetworkRequest? | Include a JSON object in the request body with a content type of **application/json**. (optional) 

            try
            {
                // Update a Private Network
                apiInstance.UpdateNetwork(networkId, updateNetworkRequest);
            }
            catch (ApiException  e)
            {
                Debug.Print("Exception when calling PrivateNetworksApi.UpdateNetwork: " + e.Message);
                Debug.Print("Status Code: " + e.ErrorCode);
                Debug.Print(e.StackTrace);
            }
        }
    }
}

Using the UpdateNetworkWithHttpInfo variant

This returns an ApiResponse object which contains the response data, status code and headers.

try
{
    // Update a Private Network
    apiInstance.UpdateNetworkWithHttpInfo(networkId, updateNetworkRequest);
}
catch (ApiException e)
{
    Debug.Print("Exception when calling PrivateNetworksApi.UpdateNetworkWithHttpInfo: " + e.Message);
    Debug.Print("Status Code: " + e.ErrorCode);
    Debug.Print(e.StackTrace);
}

Parameters

Name Type Description Notes
networkId string The Network id.
updateNetworkRequest UpdateNetworkRequest? Include a JSON object in the request body with a content type of application/json. [optional]

Return type

void (empty response body)

Authorization

[API Key](../README.md#API Key)

HTTP request headers

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

HTTP response details

Status code Description Response headers
204 No Content -
400 Bad Request -
401 Unauthorized -
403 Forbidden -
404 Not Found -

[Back to top] [Back to API list] [Back to Model list] [Back to README]