IBM Cloud API Docs

Introduction

IBM Cloud Direct Link Connect is a multi-tenant service that allows customers to connect their on-premises networks to their IBM Cloud private networks. This "Provider API" allows partners to create and manage Direct Link Connect gateways in customer' IBM Cloud accounts, providing a seamless, integrated experience. This API supports Direct Link Connect gateways that can be connected to the Virtual Private Cloud (VPC) infrastructure as well as the "Classic" SoftLayer infrastructure supported by the existing Direct Link on Classic API. Direct Link can also connect to IBM Cloud transit gateways.

It is assumed that the IBM partner has worked with IBM Cloud Direct Link Offering Management (OM) to onboard to the IBM Cloud platform. This includes business level agreements, provisioning NNIs at various locations, defining port labels, and so on. After this process is completed, partners can request access to the Provider API, which requires the completion of a few simple steps.

The code examples on this tab use the client library that is provided for Go.

Installation

go get -u github.com/IBM/networking-go-sdk

The code examples on this tab use the client library that is provided for Java.

Maven

<dependency>
    <groupId>com.ibm.cloud</groupId>
    <artifactId>direct-link-provider</artifactId>
    <version>X.X.X</version>
</dependency>

Gradle:

compile 'com.ibm.cloud:direct-link-provider:X.X.X'

The code examples on this tab use the client library that is provided for Node.js.

Installation

npm install ibm-networking-services

The code examples on this tab use the client library that is provided for Python.

Installation

pip install --upgrade "ibm-cloud-networking-services>=X.X.X"

Setting up a service identity for Provider API

  1. Create an IBM Cloud account. If you have one already, you can reuse it.

  2. Create a Service ID in this account. Then, share this Service ID with IBM. In the UI, right-click the Service ID link (for example, ServiceId-...) and copy the URL, which includes the ID. You can share the full URL, or just the Service ID.

    IBM associates the Direct Link Connect offering with your Service ID when processing Provider API invocations.

  3. Generate an API key for the Service ID.

Provider API authentication

The IBM Cloud Direct Link Provider API uses an Identity and Access Management (IAM) access token passed via the "Authorization" header. This mechanism is described in the following documents in detail:

The SDK provides initialization methods for each form of authentication.

  • Use the API key to have the SDK manage the lifecycle of the access token. The SDK requests an access token, ensures that the access token is valid, and refreshes it if necessary.
  • Use the access token to manage the lifecycle yourself. You must periodically refresh the token.

For more information, see Authentication with the SDK.

SDK managing the IAM token. Replace {apikey}, {version}, and {url}.

IamAuthenticator authenticator = new IamAuthenticator("{apikey}");
DirectLinkProvider directLinkProvider = new DirectLinkProvider("{version}", "{serviceName}",authenticator);

SDK managing the IAM token. Replace {apikey}, {version}, and {url}.

const DirectLinkProviderV2 = require('ibm-networking-services/direct-link-provider');
const { IamAuthenticator } = require('ibm-cloud-sdk-core');

const directLinkProviderV2 = new DirectLinkProviderV2({
  authenticator: new IamAuthenticator({
    apikey: '{apikey}'
  }),
  version: '${version}',
});

SDK managing the IAM token. Replace {apikey} , {version}, and {url}.

from ibm_cloud_networking_services import DirectLinkProviderV2
from ibm_cloud_sdk_core.authenticators import IAMAuthenticator

authenticator = IAMAuthenticator('{apikey}')
direct_link_provider = DirectLinkProviderV2(
    version='{version}',
    authenticator=authenticator
)

SDK managing the IAM token. Replace {apikey}, {version}, and {url}.

import (
  "github.com/IBM/go-sdk-core/core"
  "github.com/IBM/networking-go-sdk/directlinkproviderv2"
)

func main() {
  authenticator := &core.IamAuthenticator{
    ApiKey: "{apikey}",
  }

  options := &directlinkproviderv2.DirectLinkProviderV2Options{
    Version: "{version}",
    Authenticator: authenticator,
  }

  directLinkProvider, directLinkProviderErr := directlinkproviderv2.NewDirectLinkProviderV2UsingExternalConfig(options)

  if directLinkProviderErr != nil {
    panic(directLinkProviderErr)
  }
}

API endpoint

https://directlink.cloud.ibm.com

Versioning

All API requests require a major version in the path (/v2/) and a date-based version as a query parameter in the format version=YYYY-MM-DD.

For example: GET /provider/v2/gateways?version=2020-06-02

Best practices

To minimize regressions from changes, the following best practices are recommended when you call the Provider API:

  • Dedicate an account for Provider APIs. Do not use this account for any other purpose.
  • Use an organizational identity as the owner of this account instead of the identity of an individual employee.
  • Use IBM Cloud IAM to restrict access to the account, especially the Service ID and its API key on an as-needed basis. For more information, see Managing your account, resources, and access.
  • Safeguard your API key using your organization's security best practices. You might consider using an IBM Cloud service, such as Key Protect for this purpose.
  • Replace your API key periodically (ideally at least one time every quarter). Delete the old key after a new one is generated.

Error handling

The Direct Link API uses standard HTTP response codes to indicate whether a method completed successfully. A 2xx response indicates success. A 4xx type response indicates a failure, and a 5xx type response indicates an internal system error.

HTTP Error Code Description Recovery
200 Success The request was successful.
400 Bad Request Invalid request. The input parameters in the request body are either incomplete, in the wrong format, or resources are in an incorrect state. See the specific error message for more details.
401 Unauthorized You are not authorized to make this request. Log in to IBM Cloud and try again. If this error persists, contact the account owner to check your permissions.
403 Forbidden The supplied authentication is not authorized to access the requested action.
404 Not Found The requested resource might not exist, or the supplied authentication is not authorized to access it. See the specific error message for resource details, verify that the specified resource exists, or contact the account owner to check your permissions to view it.
500 Internal Server Error IBM Cloud API is currently unavailable. Your request might not be processed. Wait a few minutes and try again. If the problem persists, contact IBM Support.

Methods

List gateways

List all Direct Link Connect gateways created by this provider.

List all Direct Link Connect gateways created by this provider.

List all Direct Link Connect gateways created by this provider.

List all Direct Link Connect gateways created by this provider.

List all Direct Link Connect gateways created by this provider.

GET /gateways
ServiceCall<ProviderGatewayCollection> listProviderGateways(ListProviderGatewaysOptions listProviderGatewaysOptions)
listProviderGateways(params)
list_provider_gateways(self,
        *,
        start: str = None,
        limit: int = None,
        **kwargs
    ) -> DetailedResponse
(directLinkProvider *DirectLinkProviderV2) ListProviderGateways(listProviderGatewaysOptions *ListProviderGatewaysOptions) (result *ProviderGatewayCollection, response *core.DetailedResponse, err error)
(directLinkProvider *DirectLinkProviderV2) ListProviderGatewaysWithContext(ctx context.Context, listProviderGatewaysOptions *ListProviderGatewaysOptions) (result *ProviderGatewayCollection, response *core.DetailedResponse, err error)

Request

Use the ListProviderGatewaysOptions.Builder to create a ListProviderGatewaysOptions object that contains the parameter values for the listProviderGateways method.

Instantiate the ListProviderGatewaysOptions struct and set the fields to provide parameter values for the ListProviderGateways method.

Query Parameters

  • Requests the version of the API as a date in the format YYYY-MM-DD. Any date from 2020-04-28 up to the current date may be provided. Specify the current date to request the latest version.

    Possible values: Value must match regular expression ^[0-9]{4}-[0-9]{2}-[0-9]{2}$

  • A server-supplied token determining which resource to start the page on

  • The number of resources to return on a page

    Possible values: 1 ≤ value ≤ 100

    Default: 50

The listProviderGateways options.

parameters

  • A server-supplied token determining which resource to start the page on.

  • The number of resources to return on a page.

    Possible values: 1 ≤ value ≤ 100

parameters

  • A server-supplied token determining which resource to start the page on.

  • The number of resources to return on a page.

    Possible values: 1 ≤ value ≤ 100

WithContext method only

The ListProviderGateways options.

  • curl -X GET   https://$DL_ENDPOINT/provider/v2/gateways?version=2020-04-28   -H "authorization: Bearer $IAM_TOKEN"
  • package main
    
    import (
      "fmt"
      "github.com/IBM/go-sdk-core/v4/core"
      "github.com/IBM/networking-go-sdk/directlinkproviderv2"
      "os"
    )
    
    func main() {
      // For creating {directLinkProvider} refer Authentication
    
      listProviderGatewayOptions := directLinkProvider.NewListProviderGatewaysOptions()
      result, _, responseErr := directLinkProvider.ListProviderGateways(listProviderGatewayOptions)
      if responseErr != nil {
        panic(responseErr)
      }
      res, _ := json.MarshalIndent(result, "", "  ")
      fmt.Println(string(res))
    }
  • import json
    from ibm_cloud_networking_services import DirectLinkProviderV2
    
    apikey='<Provider API Key>'version = '2020-06-02'url = 'https://directlink.cloud.ibm.com/provider/v2/' # Initializing {direct_link_provider} refer Authentication
    
    direct_link_provider.set_service_url(url)
    gateways = direct_link_provider.list_provider_gateways().get_result().get('gateways')
    print(json.dumps(gateways, indent=2))
    
  • // For instantiating {directLinkProviderV2} refer Authenticaion
    directLinkProviderV2.listProviderGateways({})
      .then(response => {
        const gateways = response.result.gateways;
        console.log(gateways);
      })
      .catch(err => {
        console.log('error:', err);
      });
  • ListProviderGatewaysOptions listProviderGatewaysOptionsModel = new ListProviderGatewaysOptions.Builder().build();
    
    // For instantiating {directLinkProvider} refer Authenticaion
    Response<ProviderGatewayCollection> response = directLinkProvider.listProviderGateways(listProviderGatewaysOptionsModel).execute();
    int statusCode = response.getStatusCode();
    ProviderGatewayCollection gateways = response.getResult();
    System.out.println(gateways.toString());
    

Response

A paginated collection of resources

A paginated collection of resources.

A paginated collection of resources.

A paginated collection of resources.

A paginated collection of resources.

Status Code

  • List gateways success

  • invalid request

  • request not authorized

Example responses
  • {
      "gateways": [
        {
          "bgp_asn": 64999,
          "bgp_cer_cidr": "10.254.30.78/30",
          "bgp_ibm_asn": 13884,
          "bgp_ibm_cidr": "10.254.30.77/30",
          "bgp_status": "active",
          "created_at": "2020-11-03T00:23:01.300Z",
          "crn": "crn:[...]",
          "customer_account_id": "4111d05f36894e3cb9b46a43556d9000",
          "id": "ef4dcb1a-fee4-41c7-9e11-9cd99e65c1f4",
          "name": "example-gateway",
          "operational_status": "configuring",
          "port": {
            "id": "fffdcb1a-fee4-41c7-9e11-9cd99e65c777"
          },
          "provider_api_managed": true,
          "speed_mbps": 1000,
          "type": "connect",
          "vlan": 10
        }
      ]
    }
  • {
      "gateways": [
        {
          "bgp_asn": 64999,
          "bgp_cer_cidr": "10.254.30.78/30",
          "bgp_ibm_asn": 13884,
          "bgp_ibm_cidr": "10.254.30.77/30",
          "bgp_status": "active",
          "created_at": "2020-11-03T00:23:01.300Z",
          "crn": "crn:[...]",
          "customer_account_id": "4111d05f36894e3cb9b46a43556d9000",
          "id": "ef4dcb1a-fee4-41c7-9e11-9cd99e65c1f4",
          "name": "example-gateway",
          "operational_status": "configuring",
          "port": {
            "id": "fffdcb1a-fee4-41c7-9e11-9cd99e65c777"
          },
          "provider_api_managed": true,
          "speed_mbps": 1000,
          "type": "connect",
          "vlan": 10
        }
      ]
    }
  • {
      "errors": [
        {
          "code": "bad_request",
          "message": "Required parameter missing.",
          "more_info": "https://cloud.ibm.com/apidocs/direct_link#error-handling",
          "target": {
            "name": "name",
            "type": "field"
          }
        }
      ],
      "trace": "request_id"
    }
  • {
      "errors": [
        {
          "code": "bad_request",
          "message": "Required parameter missing.",
          "more_info": "https://cloud.ibm.com/apidocs/direct_link#error-handling",
          "target": {
            "name": "name",
            "type": "field"
          }
        }
      ],
      "trace": "request_id"
    }
  • {
      "errors": [
        {
          "code": "not_authorized",
          "message": "request not authorized.",
          "more_info": "https://cloud.ibm.com/apidocs/direct_link#error-handling"
        }
      ],
      "trace": "request_id"
    }
  • {
      "errors": [
        {
          "code": "not_authorized",
          "message": "request not authorized.",
          "more_info": "https://cloud.ibm.com/apidocs/direct_link#error-handling"
        }
      ],
      "trace": "request_id"
    }

Create gateway

Create a Direct Link Connect gateway based on the supplied template in the specified customer account.

The gateway will be 'provider_api_managed=true'.

Create a Direct Link Connect gateway based on the supplied template in the specified customer account.

The gateway will be 'provider_api_managed=true'.

Create a Direct Link Connect gateway based on the supplied template in the specified customer account.

The gateway will be 'provider_api_managed=true'.

Create a Direct Link Connect gateway based on the supplied template in the specified customer account.

The gateway will be 'provider_api_managed=true'.

Create a Direct Link Connect gateway based on the supplied template in the specified customer account.

The gateway will be 'provider_api_managed=true'.

POST /gateways
ServiceCall<ProviderGateway> createProviderGateway(CreateProviderGatewayOptions createProviderGatewayOptions)
createProviderGateway(params)
create_provider_gateway(self,
        bgp_asn: int,
        customer_account_id: str,
        name: str,
        port: 'ProviderGatewayPortIdentity',
        speed_mbps: int,
        *,
        bgp_cer_cidr: str = None,
        bgp_ibm_cidr: str = None,
        vlan: int = None,
        check_only: str = None,
        **kwargs
    ) -> DetailedResponse
(directLinkProvider *DirectLinkProviderV2) CreateProviderGateway(createProviderGatewayOptions *CreateProviderGatewayOptions) (result *ProviderGateway, response *core.DetailedResponse, err error)
(directLinkProvider *DirectLinkProviderV2) CreateProviderGatewayWithContext(ctx context.Context, createProviderGatewayOptions *CreateProviderGatewayOptions) (result *ProviderGateway, response *core.DetailedResponse, err error)

Request

Use the CreateProviderGatewayOptions.Builder to create a CreateProviderGatewayOptions object that contains the parameter values for the createProviderGateway method.

Instantiate the CreateProviderGatewayOptions struct and set the fields to provide parameter values for the CreateProviderGateway method.

Query Parameters

  • Requests the version of the API as a date in the format YYYY-MM-DD. Any date from 2020-04-28 up to the current date may be provided. Specify the current date to request the latest version.

    Possible values: Value must match regular expression ^[0-9]{4}-[0-9]{2}-[0-9]{2}$

  • When true, perform request validation only and do not create a gateway

The Direct Link Gateway template

The createProviderGateway options.

parameters

  • BGP ASN.

    For a 2-byte range, enter a value between 1-64495 or 64999. For a 2-byte or 4-byte range, enter a value between 131072-4199999999. For a 4-byte range, enter a value between 4201000000-4201064511.

    Examples:
    value
    _source
    _lines
    _html
  • Customer IBM Cloud account ID for the new gateway. A gateway object containing the pending create request will become available in the specified account.

    Possible values: length = 32, Value must match regular expression /^[a-f0-9]+$/

    Examples:
    value
    _source
    _lines
    _html
  • The unique user-defined name for this gateway.

    Examples:
    value
    _source
    _lines
    _html
  • Select Port Label for the gateway.

  • Gateway speed in megabits per second.

    Examples:
    value
    _source
    _lines
    _html
  • BGP customer edge router CIDR.

    For auto IP assignment, omit bgp_cer_cidr and bgp_ibm_cidr. IBM will automatically select values for bgp_cer_cidr and bgp_ibm_cidr.

    For manual IP assignment set a valid bgp_cer_cidr and bgp_ibm_cidr CIDR, the value must reside in one of "10.254.0.0/16", "172.16.0.0/12", "192.168.0.0/16", "169.254.0.0/16" or an owned public CIDR. bgp_cer_cidr and bgp_ibm_cidr must have matching network and subnet mask values.

    Examples:
    value
    _source
    _lines
    _html
  • BGP IBM CIDR.

    For auto IP assignment, omit bgp_cer_cidr and bgp_ibm_cidr. IBM will automatically select values for bgp_cer_cidr and bgp_ibm_cidr.

    For manual IP assignment set a valid bgp_cer_cidr and bgp_ibm_cidr CIDR, the value must reside in one of "10.254.0.0/16", "172.16.0.0/12", "192.168.0.0/16", "169.254.0.0/16" or an owned public CIDR. bgp_cer_cidr and bgp_ibm_cidr must have matching network and subnet mask values.

    Examples:
    value
    _source
    _lines
    _html
  • VLAN requested for this gateway.

    VLAN provided should be in the range 2 to 3967.

    Examples:
    value
    _source
    _lines
    _html
  • When true, perform request validation only and do not create a gateway.

parameters

  • BGP ASN.

    For a 2-byte range, enter a value between 1-64495 or 64999. For a 2-byte or 4-byte range, enter a value between 131072-4199999999. For a 4-byte range, enter a value between 4201000000-4201064511.

    Examples:
    value
    _source
    _lines
    _html
  • Customer IBM Cloud account ID for the new gateway. A gateway object containing the pending create request will become available in the specified account.

    Possible values: length = 32, Value must match regular expression /^[a-f0-9]+$/

    Examples:
    value
    _source
    _lines
    _html
  • The unique user-defined name for this gateway.

    Examples:
    value
    _source
    _lines
    _html
  • Select Port Label for the gateway.

  • Gateway speed in megabits per second.

    Examples:
    value
    _source
    _lines
    _html
  • BGP customer edge router CIDR.

    For auto IP assignment, omit bgp_cer_cidr and bgp_ibm_cidr. IBM will automatically select values for bgp_cer_cidr and bgp_ibm_cidr.

    For manual IP assignment set a valid bgp_cer_cidr and bgp_ibm_cidr CIDR, the value must reside in one of "10.254.0.0/16", "172.16.0.0/12", "192.168.0.0/16", "169.254.0.0/16" or an owned public CIDR. bgp_cer_cidr and bgp_ibm_cidr must have matching network and subnet mask values.

    Examples:
    value
    _source
    _lines
    _html
  • BGP IBM CIDR.

    For auto IP assignment, omit bgp_cer_cidr and bgp_ibm_cidr. IBM will automatically select values for bgp_cer_cidr and bgp_ibm_cidr.

    For manual IP assignment set a valid bgp_cer_cidr and bgp_ibm_cidr CIDR, the value must reside in one of "10.254.0.0/16", "172.16.0.0/12", "192.168.0.0/16", "169.254.0.0/16" or an owned public CIDR. bgp_cer_cidr and bgp_ibm_cidr must have matching network and subnet mask values.

    Examples:
    value
    _source
    _lines
    _html
  • VLAN requested for this gateway.

    VLAN provided should be in the range 2 to 3967.

    Examples:
    value
    _source
    _lines
    _html
  • When true, perform request validation only and do not create a gateway.

WithContext method only

The CreateProviderGateway options.

  • curl -X POST   https://$DL_ENDPOINT/provider/v2/gateways?version=2020-04-28   -H "authorization: Bearer $IAM_TOKEN"   -d '{
            "bgp_asn": 1000,
            "name": "example-gateway",
            "customer_account_id": "00000000000000000000000000000abc",
            "port": {"id": "00000000-0000-0000-0000-000000000abc"},
            "speed_mbps": 1000
          }'
  • package main
    
    import (
      "fmt"
      "github.com/IBM/go-sdk-core/v4/core"
      "github.com/IBM/networking-go-sdk/directlinkproviderv2"
      "os"
    )
    
    func main() {
      // For creating {directLinkProvider} refer Authentication
    
      // Construct an instance of the ProviderGatewayPortIdentity model
      providerGatewayPortIdentityModel := new(directlinkproviderv2.ProviderGatewayPortIdentity)
      providerGatewayPortIdentityModel.ID = ${portID}
    
      gatewayOptions := new(directlinkproviderv2.CreateProviderGatewayOptions)
      gatewayOptions.BgpAsn = core.Int64Ptr(int64(64999))
      gatewayOptions.CustomerAccountID = core.StringPtr('57a7d05f36894e3cb9b46a43556d903e')
      gatewayOptions.Name = core.StringPtr(${gatewayName})
      gatewayOptions.Port = providerGatewayPortIdentityModel
      gatewayOptions.SpeedMbps = core.Int64Ptr(1000)
    
      result, _, responseErr := directLinkProvider.CreateProviderGateway(gatewayOptions)
      if responseErr != nil {
        panic(responseErr)
      }
      res, _ := json.MarshalIndent(result, "", "  ")
      fmt.Println(string(res))
    }
  • import json
    from ibm_cloud_networking_services import DirectLinkProviderV2
    
    name = "gateway-name"
    bgpAsn = 64999
    speedMbps = 1000
    customerAccount = '57a7d05f36894e3cb9b46a43556d903e'
    port = ProviderGatewayPortIdentity(id=${port_id})
    
    # Initializing {direct_link_provider} refer Authentication
    
    gateway = direct_link_provider.create_provider_gateway(bgp_asn=bgpAsn,
                                                        customer_account_id=customerAccount,
                                                        name=name,
                                                        port=port,
                                                        speed_mbps=speedMbps).get_result()
    print(json.dumps(gateway, indent=2))
  • const params = {
        name: 'gateway-name',
        speedMbps: 1000,
        bgpAsn: 64999,
        metered: false,
        customerAccountId: '57a7d05f36894e3cb9b46a43556d903e',
        port: { id: ${portId} }
    };
    
    // For instantiating {directLinkProviderV2} refer Authenticaion
    directLinkProviderV2.createProviderGateway(params)
      .then(response => {
        const gateway = response.result;
        console.log(gateway);
      })
      .catch(err => {
        console.log('error:', err);
      });
  • ProviderGatewayPortIdentity portIdentity = new ProviderGatewayPortIdentity.Builder(portId).build();
    CreateProviderGatewayOptions createProviderGatewayOptionsModel = new CreateProviderGatewayOptions.Builder()
       .bgpAsn(bgpAsn).customerAccountId(customerAccId).name(gatewayName).speedMbps(speedMbps).port(portIdentity).build();
    
    // For instantiating {directLinkProvider} refer Authenticaion
    Response<ProviderGateway> response = directLinkProvider.createProviderGateway(createProviderGatewayOptionsModel).execute();
    int statusCode = response.getStatusCode();
    ProviderGateway gateway = response.getResult();
    System.out.println(gateway.toString());
    

Response

gateway

gateway.

gateway.

gateway.

gateway.

Status Code

  • Gateway create success

  • Checks passed for check_only=true request. No gateway was created.

  • Invalid template supplied

  • request not authorized

  • Port not found

Example responses
  • {
      "bgp_asn": 64999,
      "bgp_cer_cidr": "10.254.30.78/30",
      "bgp_ibm_asn": 13884,
      "bgp_ibm_cidr": "10.254.30.77/30",
      "bgp_status": "active",
      "created_at": "2020-11-03T00:23:01.300Z",
      "crn": "crn:[...]",
      "customer_account_id": "4111d05f36894e3cb9b46a43556d9000",
      "id": "ef4dcb1a-fee4-41c7-9e11-9cd99e65c1f4",
      "name": "example-gateway",
      "operational_status": "configuring",
      "port": {
        "id": "fffdcb1a-fee4-41c7-9e11-9cd99e65c777"
      },
      "provider_api_managed": true,
      "speed_mbps": 1000,
      "type": "connect",
      "vlan": 10
    }
  • {
      "bgp_asn": 64999,
      "bgp_cer_cidr": "10.254.30.78/30",
      "bgp_ibm_asn": 13884,
      "bgp_ibm_cidr": "10.254.30.77/30",
      "bgp_status": "active",
      "created_at": "2020-11-03T00:23:01.300Z",
      "crn": "crn:[...]",
      "customer_account_id": "4111d05f36894e3cb9b46a43556d9000",
      "id": "ef4dcb1a-fee4-41c7-9e11-9cd99e65c1f4",
      "name": "example-gateway",
      "operational_status": "configuring",
      "port": {
        "id": "fffdcb1a-fee4-41c7-9e11-9cd99e65c777"
      },
      "provider_api_managed": true,
      "speed_mbps": 1000,
      "type": "connect",
      "vlan": 10
    }
  • {
      "errors": [
        {
          "code": "bad_request",
          "message": "Required parameter missing.",
          "more_info": "https://cloud.ibm.com/apidocs/direct_link#error-handling",
          "target": {
            "name": "name",
            "type": "field"
          }
        }
      ],
      "trace": "request_id"
    }
  • {
      "errors": [
        {
          "code": "bad_request",
          "message": "Required parameter missing.",
          "more_info": "https://cloud.ibm.com/apidocs/direct_link#error-handling",
          "target": {
            "name": "name",
            "type": "field"
          }
        }
      ],
      "trace": "request_id"
    }
  • {
      "errors": [
        {
          "code": "not_authorized",
          "message": "request not authorized.",
          "more_info": "https://cloud.ibm.com/apidocs/direct_link#error-handling"
        }
      ],
      "trace": "request_id"
    }
  • {
      "errors": [
        {
          "code": "not_authorized",
          "message": "request not authorized.",
          "more_info": "https://cloud.ibm.com/apidocs/direct_link#error-handling"
        }
      ],
      "trace": "request_id"
    }
  • {
      "errors": [
        {
          "code": "not_found",
          "message": "Cannot find Provider Port with Id:01122b9b-820f-4c44-8a31-77f1f0806765.",
          "more_info": "https://cloud.ibm.com/apidocs/direct_link#error-handling"
        }
      ],
      "trace": "request_id"
    }
  • {
      "errors": [
        {
          "code": "not_found",
          "message": "Cannot find Provider Port with Id:01122b9b-820f-4c44-8a31-77f1f0806765.",
          "more_info": "https://cloud.ibm.com/apidocs/direct_link#error-handling"
        }
      ],
      "trace": "request_id"
    }

Delete gateway

Delete a Direct Link Connect provider managed gateway.

Delete a Direct Link Connect provider managed gateway.

Delete a Direct Link Connect provider managed gateway.

Delete a Direct Link Connect provider managed gateway.

Delete a Direct Link Connect provider managed gateway.

DELETE /gateways/{id}
ServiceCall<ProviderGateway> deleteProviderGateway(DeleteProviderGatewayOptions deleteProviderGatewayOptions)
deleteProviderGateway(params)
delete_provider_gateway(self,
        id: str,
        **kwargs
    ) -> DetailedResponse
(directLinkProvider *DirectLinkProviderV2) DeleteProviderGateway(deleteProviderGatewayOptions *DeleteProviderGatewayOptions) (result *ProviderGateway, response *core.DetailedResponse, err error)
(directLinkProvider *DirectLinkProviderV2) DeleteProviderGatewayWithContext(ctx context.Context, deleteProviderGatewayOptions *DeleteProviderGatewayOptions) (result *ProviderGateway, response *core.DetailedResponse, err error)

Request

Use the DeleteProviderGatewayOptions.Builder to create a DeleteProviderGatewayOptions object that contains the parameter values for the deleteProviderGateway method.

Instantiate the DeleteProviderGatewayOptions struct and set the fields to provide parameter values for the DeleteProviderGateway method.

Path Parameters

  • Direct Link Connect gateway identifier

Query Parameters

  • Requests the version of the API as a date in the format YYYY-MM-DD. Any date from 2020-04-28 up to the current date may be provided. Specify the current date to request the latest version.

    Possible values: Value must match regular expression ^[0-9]{4}-[0-9]{2}-[0-9]{2}$

The deleteProviderGateway options.

parameters

  • Direct Link Connect gateway identifier.

parameters

  • Direct Link Connect gateway identifier.

WithContext method only

The DeleteProviderGateway options.

  • curl -X DELETE   https://$DL_ENDPOINT/provider/v2/gateways/$GATEWAY_ID?version=2020-04-28   -H "authorization: Bearer $IAM_TOKEN"
  • package main
    
    import (
      "fmt"
      "github.com/IBM/go-sdk-core/v4/core"
      "github.com/IBM/networking-go-sdk/directlinkproviderv2"
      "os"
    )
    
    func main() {
      // For creating {directLinkProvider} refer Authentication
    
      deteleGatewayOptions := directLinkProvider.NewDeleteProviderGatewayOptions(gatewayId)
      result, _, responseErr := directLinkProvider.DeleteProviderGateway(deteleGatewayOptions)
      if responseErr != nil {
        panic(responseErr)
      }
      res, _ := json.MarshalIndent(result, "", "  ")
      fmt.Println(string(res))
    }
  • import json
    from ibm_cloud_networking_services import DirectLinkProviderV2
    
    # Initializing {direct_link_provider} refer Authentication
    
    direct_link_provider.delete_provider_gateway(id=${provider_gateway_id}).get_result()
  • // For instantiating {directLinkProviderV2} refer Authenticaion
    directLinkProviderV2.deleteProviderGateway({ id: ${gatewayId}})
      .then(response => {
        console.log(response);
      })
      .catch(err => {
        console.log('error:', err);
      });
  • DeleteProviderGatewayOptions deleteProviderGatewayOptionsModel = new DeleteProviderGatewayOptions.Builder(gatewayId).build()
    
    // For instantiating {directLinkProvider} refer Authenticaion
    Response<ProviderGateway> response = directLinkProvider.deleteProviderGateway(deleteProviderGatewayOptionsModel).execute();
    int statusCode = response.getStatusCode();
    ProviderGateway gateway = response.getResult();
    System.out.println(gateway.toString());
    

Response

gateway

gateway.

gateway.

gateway.

gateway.

Status Code

  • Gateway delete request success. Gateway delete is pending approval from client.

  • Gateway delete success. The gateway with operational_status=create_pending or operational_status=create_rejected was deleted.

  • request not authorized

  • Gateway not found

Example responses
  • {
      "bgp_asn": 64999,
      "bgp_cer_cidr": "10.254.30.78/30",
      "bgp_ibm_asn": 13884,
      "bgp_ibm_cidr": "10.254.30.77/30",
      "bgp_status": "active",
      "created_at": "2020-11-03T00:23:01.300Z",
      "crn": "crn:[...]",
      "customer_account_id": "4111d05f36894e3cb9b46a43556d9000",
      "id": "ef4dcb1a-fee4-41c7-9e11-9cd99e65c1f4",
      "name": "example-gateway",
      "operational_status": "configuring",
      "port": {
        "id": "fffdcb1a-fee4-41c7-9e11-9cd99e65c777"
      },
      "provider_api_managed": true,
      "speed_mbps": 1000,
      "type": "connect",
      "vlan": 10
    }
  • {
      "bgp_asn": 64999,
      "bgp_cer_cidr": "10.254.30.78/30",
      "bgp_ibm_asn": 13884,
      "bgp_ibm_cidr": "10.254.30.77/30",
      "bgp_status": "active",
      "created_at": "2020-11-03T00:23:01.300Z",
      "crn": "crn:[...]",
      "customer_account_id": "4111d05f36894e3cb9b46a43556d9000",
      "id": "ef4dcb1a-fee4-41c7-9e11-9cd99e65c1f4",
      "name": "example-gateway",
      "operational_status": "configuring",
      "port": {
        "id": "fffdcb1a-fee4-41c7-9e11-9cd99e65c777"
      },
      "provider_api_managed": true,
      "speed_mbps": 1000,
      "type": "connect",
      "vlan": 10
    }
  • {
      "errors": [
        {
          "code": "not_authorized",
          "message": "request not authorized.",
          "more_info": "https://cloud.ibm.com/apidocs/direct_link#error-handling"
        }
      ],
      "trace": "request_id"
    }
  • {
      "errors": [
        {
          "code": "not_authorized",
          "message": "request not authorized.",
          "more_info": "https://cloud.ibm.com/apidocs/direct_link#error-handling"
        }
      ],
      "trace": "request_id"
    }
  • {
      "errors": [
        {
          "code": "not_found",
          "message": "Cannot find Gateway",
          "more_info": "https://cloud.ibm.com/apidocs/direct_link#error-handling"
        }
      ],
      "trace": "request_id"
    }
  • {
      "errors": [
        {
          "code": "not_found",
          "message": "Cannot find Gateway",
          "more_info": "https://cloud.ibm.com/apidocs/direct_link#error-handling"
        }
      ],
      "trace": "request_id"
    }

Get gateway

Get a Direct Link Connect gateway.

Gateways with either provider_api_managed=true or provider_api_managed=false can be retrieved.

Get a Direct Link Connect gateway. Gateways with either provider_api_managed=true or provider_api_managed=false can be retrieved.

Get a Direct Link Connect gateway. Gateways with either provider_api_managed=true or provider_api_managed=false can be retrieved.

Get a Direct Link Connect gateway. Gateways with either provider_api_managed=true or provider_api_managed=false can be retrieved.

Get a Direct Link Connect gateway. Gateways with either provider_api_managed=true or provider_api_managed=false can be retrieved.

GET /gateways/{id}
ServiceCall<ProviderGateway> getProviderGateway(GetProviderGatewayOptions getProviderGatewayOptions)
getProviderGateway(params)
get_provider_gateway(self,
        id: str,
        **kwargs
    ) -> DetailedResponse
(directLinkProvider *DirectLinkProviderV2) GetProviderGateway(getProviderGatewayOptions *GetProviderGatewayOptions) (result *ProviderGateway, response *core.DetailedResponse, err error)
(directLinkProvider *DirectLinkProviderV2) GetProviderGatewayWithContext(ctx context.Context, getProviderGatewayOptions *GetProviderGatewayOptions) (result *ProviderGateway, response *core.DetailedResponse, err error)

Request

Use the GetProviderGatewayOptions.Builder to create a GetProviderGatewayOptions object that contains the parameter values for the getProviderGateway method.

Instantiate the GetProviderGatewayOptions struct and set the fields to provide parameter values for the GetProviderGateway method.

Path Parameters

  • Direct Link Connect gateway identifier

Query Parameters

  • Requests the version of the API as a date in the format YYYY-MM-DD. Any date from 2020-04-28 up to the current date may be provided. Specify the current date to request the latest version.

    Possible values: Value must match regular expression ^[0-9]{4}-[0-9]{2}-[0-9]{2}$

The getProviderGateway options.

parameters

  • Direct Link Connect gateway identifier.

parameters

  • Direct Link Connect gateway identifier.

WithContext method only

The GetProviderGateway options.

  • curl -X GET   https://$DL_ENDPOINT/provider/v2/gateways/$GATEWAY_ID?version=2020-04-28   -H "authorization: Bearer $IAM_TOKEN"
  • package main
    
    import (
      "fmt"
      "github.com/IBM/go-sdk-core/v4/core"
      "github.com/IBM/networking-go-sdk/directlinkproviderv2"
      "os"
    )
    
    func main() {
      // For creating {directLinkProvider} refer Authentication
    
      getProviderGatewayOptions := new(directlinkproviderv2.GetProviderGatewayOptions)
      getProviderGatewayOptions.ID = core.StringPtr(${gatewayID})
      result, _, responseErr := directLinkProvider.GetProviderGateway(getProviderGatewayOptions)
      if responseErr != nil {
        panic(responseErr)
      }
      res, _ := json.MarshalIndent(result, "", "  ")
      fmt.Println(string(res))
    }
  • import json
    from ibm_cloud_networking_services import DirectLinkProviderV2
    
    # Initializing {direct_link_provider} refer Authentication
    
    gateway = direct_link_provider.get_provider_gateway(id=${provider_gateway_id}).get_result()
    print(json.dumps(gateway, indent=2))
  • // For instantiating {directLinkProviderV2} refer Authenticaion
    directLinkProviderV2.getProviderGateway({id: ${gatewayId}})
      .then(response => {
        const gateway = response.result;
        console.log(gateway);
      })
      .catch(err => {
        console.log('error:', err);
      });
  • GetProviderGatewayOptions getProviderGatewayOptionsModel = new GetProviderGatewayOptions.Builder(gatewayId).build();
    
    // For instantiating {directLinkProvider} refer Authenticaion
    Response<ProviderGateway> response = directLinkProvider.getProviderGateway(getProviderGatewayOptionsModel).execute();
    int statusCode = response.getStatusCode();
    ProviderGateway gateway = response.getResult();
    System.out.println(gateway.toString());
    

Response

gateway

gateway.

gateway.

gateway.

gateway.

Status Code

  • Get gateway success

  • invalid request

  • request not authorized

  • Gateway not found

Example responses
  • {
      "bgp_asn": 64999,
      "bgp_cer_cidr": "10.254.30.78/30",
      "bgp_ibm_asn": 13884,
      "bgp_ibm_cidr": "10.254.30.77/30",
      "bgp_status": "active",
      "created_at": "2020-11-03T00:23:01.300Z",
      "crn": "crn:[...]",
      "customer_account_id": "4111d05f36894e3cb9b46a43556d9000",
      "id": "ef4dcb1a-fee4-41c7-9e11-9cd99e65c1f4",
      "name": "example-gateway",
      "operational_status": "configuring",
      "port": {
        "id": "fffdcb1a-fee4-41c7-9e11-9cd99e65c777"
      },
      "provider_api_managed": true,
      "speed_mbps": 1000,
      "type": "connect",
      "vlan": 10
    }
  • {
      "bgp_asn": 64999,
      "bgp_cer_cidr": "10.254.30.78/30",
      "bgp_ibm_asn": 13884,
      "bgp_ibm_cidr": "10.254.30.77/30",
      "bgp_status": "active",
      "created_at": "2020-11-03T00:23:01.300Z",
      "crn": "crn:[...]",
      "customer_account_id": "4111d05f36894e3cb9b46a43556d9000",
      "id": "ef4dcb1a-fee4-41c7-9e11-9cd99e65c1f4",
      "name": "example-gateway",
      "operational_status": "configuring",
      "port": {
        "id": "fffdcb1a-fee4-41c7-9e11-9cd99e65c777"
      },
      "provider_api_managed": true,
      "speed_mbps": 1000,
      "type": "connect",
      "vlan": 10
    }
  • {
      "errors": [
        {
          "code": "bad_request",
          "message": "Required parameter missing.",
          "more_info": "https://cloud.ibm.com/apidocs/direct_link#error-handling",
          "target": {
            "name": "name",
            "type": "field"
          }
        }
      ],
      "trace": "request_id"
    }
  • {
      "errors": [
        {
          "code": "bad_request",
          "message": "Required parameter missing.",
          "more_info": "https://cloud.ibm.com/apidocs/direct_link#error-handling",
          "target": {
            "name": "name",
            "type": "field"
          }
        }
      ],
      "trace": "request_id"
    }
  • {
      "errors": [
        {
          "code": "not_authorized",
          "message": "request not authorized.",
          "more_info": "https://cloud.ibm.com/apidocs/direct_link#error-handling"
        }
      ],
      "trace": "request_id"
    }
  • {
      "errors": [
        {
          "code": "not_authorized",
          "message": "request not authorized.",
          "more_info": "https://cloud.ibm.com/apidocs/direct_link#error-handling"
        }
      ],
      "trace": "request_id"
    }
  • {
      "errors": [
        {
          "code": "not_found",
          "message": "Cannot find Gateway",
          "more_info": "https://cloud.ibm.com/apidocs/direct_link#error-handling"
        }
      ],
      "trace": "request_id"
    }
  • {
      "errors": [
        {
          "code": "not_found",
          "message": "Cannot find Gateway",
          "more_info": "https://cloud.ibm.com/apidocs/direct_link#error-handling"
        }
      ],
      "trace": "request_id"
    }

Update gateway

Update a Direct Link Connect provider managed gateway.

Name changes are applied immediately, other changes result in a gateway change_request and require approval from the client.

Update a Direct Link Connect provider managed gateway.

Name changes are applied immediately, other changes result in a gateway change_request and require approval from the client.

Update a Direct Link Connect provider managed gateway.

Name changes are applied immediately, other changes result in a gateway change_request and require approval from the client.

Update a Direct Link Connect provider managed gateway.

Name changes are applied immediately, other changes result in a gateway change_request and require approval from the client.

Update a Direct Link Connect provider managed gateway.

Name changes are applied immediately, other changes result in a gateway change_request and require approval from the client.

PATCH /gateways/{id}
ServiceCall<ProviderGateway> updateProviderGateway(UpdateProviderGatewayOptions updateProviderGatewayOptions)
updateProviderGateway(params)
update_provider_gateway(self,
        id: str,
        *,
        bgp_asn: int = None,
        bgp_cer_cidr: str = None,
        bgp_ibm_cidr: str = None,
        name: str = None,
        speed_mbps: int = None,
        vlan: int = None,
        **kwargs
    ) -> DetailedResponse
(directLinkProvider *DirectLinkProviderV2) UpdateProviderGateway(updateProviderGatewayOptions *UpdateProviderGatewayOptions) (result *ProviderGateway, response *core.DetailedResponse, err error)
(directLinkProvider *DirectLinkProviderV2) UpdateProviderGatewayWithContext(ctx context.Context, updateProviderGatewayOptions *UpdateProviderGatewayOptions) (result *ProviderGateway, response *core.DetailedResponse, err error)

Request

Use the UpdateProviderGatewayOptions.Builder to create a UpdateProviderGatewayOptions object that contains the parameter values for the updateProviderGateway method.

Instantiate the UpdateProviderGatewayOptions struct and set the fields to provide parameter values for the UpdateProviderGateway method.

Path Parameters

  • Direct Link Connect gateway identifier

Query Parameters

  • Requests the version of the API as a date in the format YYYY-MM-DD. Any date from 2020-04-28 up to the current date may be provided. Specify the current date to request the latest version.

    Possible values: Value must match regular expression ^[0-9]{4}-[0-9]{2}-[0-9]{2}$

The Direct Link gateway patch

The updateProviderGateway options.

parameters

  • Direct Link Connect gateway identifier.

  • The autonomous system number (ASN) of Border Gateway Protocol (BGP) configuration for the IBM side of the DL gateway.

    Examples:
    value
    _source
    _lines
    _html
  • BGP customer edge router CIDR is the new CIDR (Classless Inter-Domain Routing) value to be updated on customer edge router for the DL gateway. Customer edge IP and IBM IP should be in the same network. Updating customer edge router CIDR should be accompanied with IBM CIDR in the request. Update customer edge router IP to a valid bgp_cer_cidr and bgp_ibm_cidr CIDR, the value must reside in one of "10.254.0.0/16", "172.16.0.0/12", "192.168.0.0/16", "169.254.0.0/16" or an owned public CIDR. bgp_cer_cidr and bgp_ibm_cidr must have matching network and subnet mask values.

    Examples:
    value
    _source
    _lines
    _html
  • BGP IBM CIDR is the new CIDR (Classless Inter-Domain Routing) value to be updated on IBM edge router for the DL gateway. IBM IP and customer edge IP should be in the same network. Updating IBM CIDR should be accompanied with customer edge router CIDR in the request. Update IBM CIDR to a valid bgp_cer_cidr and bgp_ibm_cidr CIDR, the value must reside in one of "10.254.0.0/16", "172.16.0.0/12", "192.168.0.0/16", "169.254.0.0/16" or an owned public CIDR. bgp_cer_cidr and bgp_ibm_cidr must have matching network and subnet mask values.

    Examples:
    value
    _source
    _lines
    _html
  • The unique user-defined name for this gateway.

    Examples:
    value
    _source
    _lines
    _html
  • Gateway speed in megabits per second.

    Examples:
    value
    _source
    _lines
    _html
  • VLAN to be modified for this gateway.

    VLAN provided should be in the range 2 to 3967.

    Examples:
    value
    _source
    _lines
    _html

parameters

  • Direct Link Connect gateway identifier.

  • The autonomous system number (ASN) of Border Gateway Protocol (BGP) configuration for the IBM side of the DL gateway.

    Examples:
    value
    _source
    _lines
    _html
  • BGP customer edge router CIDR is the new CIDR (Classless Inter-Domain Routing) value to be updated on customer edge router for the DL gateway. Customer edge IP and IBM IP should be in the same network. Updating customer edge router CIDR should be accompanied with IBM CIDR in the request. Update customer edge router IP to a valid bgp_cer_cidr and bgp_ibm_cidr CIDR, the value must reside in one of "10.254.0.0/16", "172.16.0.0/12", "192.168.0.0/16", "169.254.0.0/16" or an owned public CIDR. bgp_cer_cidr and bgp_ibm_cidr must have matching network and subnet mask values.

    Examples:
    value
    _source
    _lines
    _html
  • BGP IBM CIDR is the new CIDR (Classless Inter-Domain Routing) value to be updated on IBM edge router for the DL gateway. IBM IP and customer edge IP should be in the same network. Updating IBM CIDR should be accompanied with customer edge router CIDR in the request. Update IBM CIDR to a valid bgp_cer_cidr and bgp_ibm_cidr CIDR, the value must reside in one of "10.254.0.0/16", "172.16.0.0/12", "192.168.0.0/16", "169.254.0.0/16" or an owned public CIDR. bgp_cer_cidr and bgp_ibm_cidr must have matching network and subnet mask values.

    Examples:
    value
    _source
    _lines
    _html
  • The unique user-defined name for this gateway.

    Examples:
    value
    _source
    _lines
    _html
  • Gateway speed in megabits per second.

    Examples:
    value
    _source
    _lines
    _html
  • VLAN to be modified for this gateway.

    VLAN provided should be in the range 2 to 3967.

    Examples:
    value
    _source
    _lines
    _html

WithContext method only

The UpdateProviderGateway options.

  • curl -X PATCH   https://$DL_ENDPOINT/provider/v2/gateways/$GATEWAY_ID?version=2020-04-28   -H "authorization: Bearer $IAM_TOKEN"
      -d '{
            "name": "new_gateway_name",
            "speed_mbps": 1000
          }'
  • package main
    
    import (
      "fmt"
      "github.com/IBM/go-sdk-core/v4/core"
      "github.com/IBM/networking-go-sdk/directlinkproviderv2"
      "os"
    )
    
    func main() {
      // For creating {directLinkProvider} refer Authentication
    
      updateProviderGatewayOptions := new(directlinkproviderv2.UpdateProviderGatewayOptions)
      updateProviderGatewayOptions.ID = core.StringPtr(${gatewayID})
      updateProviderGatewayOptions.Name = core.StringPtr(${updatedGatewayName})
      updateProviderGatewayOptions.SpeedMbps = core.Int64Ptr(${updatedSpeed})
      result, _, responseErr := directLinkProvider.UpdateProviderGateway(updateProviderGatewayOptions)
      if responseErr != nil {
        panic(responseErr)
      }
      res, _ := json.MarshalIndent(result, "", "  ")
      fmt.Println(string(res))
    }
  • import json
    from ibm_cloud_networking_services import DirectLinkProviderV2
    
    # Initializing {direct_link_provider} refer Authentication
    
    gateway = direct_link_provider.update_provider_gateway(id=${provider_gateway_id}, name="updated-name", speed_mbps=2000).get_result()
    print(json.dumps(gateway, indent=2))
  • const params = {
     id: ${gatewayId},
     name: 'updated-name'
    };
    // For instantiating {directLinkProviderV2} refer Authenticaion
    directLinkProviderV2.updateProviderGateway(params)
      .then(response => {
        const gateway = response.result;
        console.log(gateway);
      })
      .catch(err => {
        console.log('error:', err);
      });
  • UpdateProviderGatewayOptions updateProviderGatewayOptionsModel = new UpdateProviderGatewayOptions.Builder()
      .id(gatewayId).name(updatedGatewayName).build();
    
    // For instantiating {directLinkProvider} refer Authenticaion
    Response<ProviderGateway> response = directLinkProvider.updateProviderGateway(updateProviderGatewayOptionsModel).execute();
    int statusCode = response.getStatusCode();
    ProviderGateway gateway = response.getResult();
    System.out.println(gateway.toString());
    

Response

gateway

gateway.

gateway.

gateway.

gateway.

Status Code

  • Gateway update request success

  • Invalid request

  • request not authorized

  • Gateway not found

Example responses
  • {
      "bgp_asn": 64999,
      "bgp_cer_cidr": "10.254.30.78/30",
      "bgp_ibm_asn": 13884,
      "bgp_ibm_cidr": "10.254.30.77/30",
      "bgp_status": "active",
      "created_at": "2020-11-03T00:23:01.300Z",
      "crn": "crn:[...]",
      "customer_account_id": "4111d05f36894e3cb9b46a43556d9000",
      "id": "ef4dcb1a-fee4-41c7-9e11-9cd99e65c1f4",
      "name": "example-gateway",
      "operational_status": "configuring",
      "port": {
        "id": "fffdcb1a-fee4-41c7-9e11-9cd99e65c777"
      },
      "provider_api_managed": true,
      "speed_mbps": 1000,
      "type": "connect",
      "vlan": 10
    }
  • {
      "bgp_asn": 64999,
      "bgp_cer_cidr": "10.254.30.78/30",
      "bgp_ibm_asn": 13884,
      "bgp_ibm_cidr": "10.254.30.77/30",
      "bgp_status": "active",
      "created_at": "2020-11-03T00:23:01.300Z",
      "crn": "crn:[...]",
      "customer_account_id": "4111d05f36894e3cb9b46a43556d9000",
      "id": "ef4dcb1a-fee4-41c7-9e11-9cd99e65c1f4",
      "name": "example-gateway",
      "operational_status": "configuring",
      "port": {
        "id": "fffdcb1a-fee4-41c7-9e11-9cd99e65c777"
      },
      "provider_api_managed": true,
      "speed_mbps": 1000,
      "type": "connect",
      "vlan": 10
    }
  • {
      "errors": [
        {
          "code": "validation_invalid_argument",
          "message": "Invalid Request",
          "more_info": "https://cloud.ibm.com/apidocs/direct_link#error-handling"
        }
      ],
      "trace": "request_id"
    }
  • {
      "errors": [
        {
          "code": "validation_invalid_argument",
          "message": "Invalid Request",
          "more_info": "https://cloud.ibm.com/apidocs/direct_link#error-handling"
        }
      ],
      "trace": "request_id"
    }
  • {
      "errors": [
        {
          "code": "not_authorized",
          "message": "request not authorized.",
          "more_info": "https://cloud.ibm.com/apidocs/direct_link#error-handling"
        }
      ],
      "trace": "request_id"
    }
  • {
      "errors": [
        {
          "code": "not_authorized",
          "message": "request not authorized.",
          "more_info": "https://cloud.ibm.com/apidocs/direct_link#error-handling"
        }
      ],
      "trace": "request_id"
    }
  • {
      "errors": [
        {
          "code": "not_found",
          "message": "Cannot find Gateway",
          "more_info": "https://cloud.ibm.com/apidocs/direct_link#error-handling"
        }
      ],
      "trace": "request_id"
    }
  • {
      "errors": [
        {
          "code": "not_found",
          "message": "Cannot find Gateway",
          "more_info": "https://cloud.ibm.com/apidocs/direct_link#error-handling"
        }
      ],
      "trace": "request_id"
    }

List ports

List all provider ports (associated with the caller).

List all provider ports (associated with the caller).

List all provider ports (associated with the caller).

List all provider ports (associated with the caller).

List all provider ports (associated with the caller).

GET /ports
ServiceCall<ProviderPortCollection> listProviderPorts(ListProviderPortsOptions listProviderPortsOptions)
listProviderPorts(params)
list_provider_ports(self,
        *,
        start: str = None,
        limit: int = None,
        **kwargs
    ) -> DetailedResponse
(directLinkProvider *DirectLinkProviderV2) ListProviderPorts(listProviderPortsOptions *ListProviderPortsOptions) (result *ProviderPortCollection, response *core.DetailedResponse, err error)
(directLinkProvider *DirectLinkProviderV2) ListProviderPortsWithContext(ctx context.Context, listProviderPortsOptions *ListProviderPortsOptions) (result *ProviderPortCollection, response *core.DetailedResponse, err error)

Request

Use the ListProviderPortsOptions.Builder to create a ListProviderPortsOptions object that contains the parameter values for the listProviderPorts method.

Instantiate the ListProviderPortsOptions struct and set the fields to provide parameter values for the ListProviderPorts method.

Query Parameters

  • Requests the version of the API as a date in the format YYYY-MM-DD. Any date from 2020-04-28 up to the current date may be provided. Specify the current date to request the latest version.

    Possible values: Value must match regular expression ^[0-9]{4}-[0-9]{2}-[0-9]{2}$

  • A server-supplied token determining which resource to start the page on

  • The number of resources to return on a page

    Possible values: 1 ≤ value ≤ 100

    Default: 50

The listProviderPorts options.

parameters

  • A server-supplied token determining which resource to start the page on.

  • The number of resources to return on a page.

    Possible values: 1 ≤ value ≤ 100

parameters

  • A server-supplied token determining which resource to start the page on.

  • The number of resources to return on a page.

    Possible values: 1 ≤ value ≤ 100

WithContext method only

The ListProviderPorts options.

  • curl -X GET   https://$DL_ENDPOINT/provider/v2/ports?version=2020-04-28   -H "authorization: Bearer $IAM_TOKEN"
  • package main
    
    import (
      "fmt"
      "github.com/IBM/go-sdk-core/v4/core"
      "github.com/IBM/networking-go-sdk/directlinkproviderv2"
      "os"
    )
    
    func main() {
      // For creating {directLinkProvider} refer Authentication
    
      listProviderPortsOptions := directLinkProvider.NewListProviderPortsOptions()
      result, _ , responseErr := directLinkProvider.ListProviderPorts(listProviderPortsOptions)
      if responseErr != nil {
        panic(responseErr)
      }
      res, _ := json.MarshalIndent(result, "", "  ")
      fmt.Println(string(res))
    }
  • import json
    from ibm_cloud_networking_services import DirectLinkProviderV2
    
    # Initializing {direct_link_provider} refer Authentication
    
    ports = direct_link_provider.list_provider_ports().get_result().get("gateways")
    print(json.dumps(ports, indent=2))
  • // For instantiating {directLinkProviderV2} refer Authenticaion
    directLinkProviderV2.listProviderPorts({})
      .then(response => {
        const ports = response.result.ports;
        console.log(ports);
      })
      .catch(err => {
        console.log('error:', err);
      });
  • ListProviderPortsOptions listProviderPortsOptionsModel = new ListProviderPortsOptions.Builder().build();
    
    // For instantiating {directLinkProvider} refer Authenticaion
    Response<ProviderPortCollection> response = directLinkProvider.listProviderPorts(listProviderPortsOptionsModel).execute();
    int statusCode = response.getStatusCode();
    ProviderPortCollection ports = response.getResult();
    System.out.println(ports.toString());
    

Response

List of port label details

List of port label details.

List of port label details.

List of port label details.

List of port label details.

Status Code

  • List ports success

  • invalid request

  • request not authorized

Example responses
  • {
      "ports": [
        {
          "id": "01122b9b-820f-4c44-8a31-77f1f0806765",
          "label": "XCR-FRK-CS-SEC-01",
          "location_display_name": "Dallas 03",
          "location_name": "dal03",
          "provider_name": "provider_1",
          "supported_link_speeds": [
            1000,
            2000,
            5000,
            10000
          ]
        }
      ]
    }
  • {
      "ports": [
        {
          "id": "01122b9b-820f-4c44-8a31-77f1f0806765",
          "label": "XCR-FRK-CS-SEC-01",
          "location_display_name": "Dallas 03",
          "location_name": "dal03",
          "provider_name": "provider_1",
          "supported_link_speeds": [
            1000,
            2000,
            5000,
            10000
          ]
        }
      ]
    }
  • {
      "errors": [
        {
          "code": "bad_request",
          "message": "Required parameter missing.",
          "more_info": "https://cloud.ibm.com/apidocs/direct_link#error-handling",
          "target": {
            "name": "name",
            "type": "field"
          }
        }
      ],
      "trace": "request_id"
    }
  • {
      "errors": [
        {
          "code": "bad_request",
          "message": "Required parameter missing.",
          "more_info": "https://cloud.ibm.com/apidocs/direct_link#error-handling",
          "target": {
            "name": "name",
            "type": "field"
          }
        }
      ],
      "trace": "request_id"
    }
  • {
      "errors": [
        {
          "code": "not_authorized",
          "message": "request not authorized.",
          "more_info": "https://cloud.ibm.com/apidocs/direct_link#error-handling"
        }
      ],
      "trace": "request_id"
    }
  • {
      "errors": [
        {
          "code": "not_authorized",
          "message": "request not authorized.",
          "more_info": "https://cloud.ibm.com/apidocs/direct_link#error-handling"
        }
      ],
      "trace": "request_id"
    }

Get port

Get provider port information.

Get provider port information.

Get provider port information.

Get provider port information.

Get provider port information.

GET /ports/{id}
ServiceCall<ProviderPort> getProviderPort(GetProviderPortOptions getProviderPortOptions)
getProviderPort(params)
get_provider_port(self,
        id: str,
        **kwargs
    ) -> DetailedResponse
(directLinkProvider *DirectLinkProviderV2) GetProviderPort(getProviderPortOptions *GetProviderPortOptions) (result *ProviderPort, response *core.DetailedResponse, err error)
(directLinkProvider *DirectLinkProviderV2) GetProviderPortWithContext(ctx context.Context, getProviderPortOptions *GetProviderPortOptions) (result *ProviderPort, response *core.DetailedResponse, err error)

Request

Use the GetProviderPortOptions.Builder to create a GetProviderPortOptions object that contains the parameter values for the getProviderPort method.

Instantiate the GetProviderPortOptions struct and set the fields to provide parameter values for the GetProviderPort method.

Path Parameters

  • port identifier

Query Parameters

  • Requests the version of the API as a date in the format YYYY-MM-DD. Any date from 2020-04-28 up to the current date may be provided. Specify the current date to request the latest version.

    Possible values: Value must match regular expression ^[0-9]{4}-[0-9]{2}-[0-9]{2}$

The getProviderPort options.

parameters

  • port identifier.

parameters

  • port identifier.

WithContext method only

The GetProviderPort options.

  • curl -X GET   https://$DL_ENDPOINT/provider/v2/ports/$PORT?version=2020-04-28   -H "authorization: Bearer $IAM_TOKEN"
  • package main
    
    import (
      "fmt"
      "github.com/IBM/go-sdk-core/v4/core"
      "github.com/IBM/networking-go-sdk/directlinkproviderv2"
      "os"
    )
    
    func main() {
      // For creating {directLinkProvider} refer Authentication
    
      getProviderPortOptions := directLinkProvider.NewGetProviderPortOptions(${portID})
      result, _ , responseErr := directLinkProvider.GetProviderPort(getProviderPortOptions)
      if responseErr != nil {
        panic(responseErr)
      }
      res, _ := json.MarshalIndent(result, "", "  ")
      fmt.Println(string(res))
    }
  • import json
    from ibm_cloud_networking_services import DirectLinkProviderV2
    
    # Initializing {direct_link_provider} refer Authentication
    
    port = direct_link_provider.get_provider_port(id=${port_id}).get_result()
    print(json.dumps(port, indent=2))
  • // For instantiating {directLinkProviderV2} refer Authenticaion
    directLinkProviderV2.getProviderPort({ id: ${portId} })
      .then(response => {
        const port = response.result;
        console.log(port);
      })
      .catch(err => {
        console.log('error:', err);
      });
  • GetProviderPortOptions getProviderPortOptionsModel = new GetProviderPortOptions.Builder().id(${portId}).build();
    
    // For instantiating {directLinkProvider} refer Authenticaion
    Response<ProviderPort> response = directLinkProvider.getProviderPort(getProviderPortOptionsModel).execute();
    int statusCode = response.getStatusCode();
    ProviderPort port = response.getResult();
    System.out.println(port.toString());
    

Response

Provider port details

Provider port details.

Provider port details.

Provider port details.

Provider port details.

Status Code

  • Get port success

  • request not authorized

  • Port not found

Example responses
  • {
      "id": "01122b9b-820f-4c44-8a31-77f1f0806765",
      "label": "XCR-FRK-CS-SEC-01",
      "location_display_name": "Dallas 03",
      "location_name": "dal03",
      "provider_name": "provider_1",
      "supported_link_speeds": [
        1000,
        2000,
        5000,
        10000
      ]
    }
  • {
      "id": "01122b9b-820f-4c44-8a31-77f1f0806765",
      "label": "XCR-FRK-CS-SEC-01",
      "location_display_name": "Dallas 03",
      "location_name": "dal03",
      "provider_name": "provider_1",
      "supported_link_speeds": [
        1000,
        2000,
        5000,
        10000
      ]
    }
  • {
      "errors": [
        {
          "code": "not_authorized",
          "message": "request not authorized.",
          "more_info": "https://cloud.ibm.com/apidocs/direct_link#error-handling"
        }
      ],
      "trace": "request_id"
    }
  • {
      "errors": [
        {
          "code": "not_authorized",
          "message": "request not authorized.",
          "more_info": "https://cloud.ibm.com/apidocs/direct_link#error-handling"
        }
      ],
      "trace": "request_id"
    }
  • {
      "errors": [
        {
          "code": "not_found",
          "message": "Cannot find Provider Port with Id:01122b9b-820f-4c44-8a31-77f1f0806765.",
          "more_info": "https://cloud.ibm.com/apidocs/direct_link#error-handling"
        }
      ],
      "trace": "request_id"
    }
  • {
      "errors": [
        {
          "code": "not_found",
          "message": "Cannot find Provider Port with Id:01122b9b-820f-4c44-8a31-77f1f0806765.",
          "more_info": "https://cloud.ibm.com/apidocs/direct_link#error-handling"
        }
      ],
      "trace": "request_id"
    }