IBM Cloud API Docs

Introduction

The IBM Cloud® Direct Link API is a RESTful API that allows you to manage your Direct Link resources.

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

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
go get  -u github.com/IBM/go-sdk-core

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</artifactId>
    <version>X.X.X</version>
</dependency>

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"

Authentication

The IBM Cloud Direct Link API uses Identity and Access Management (IAM) to authenticate requests. Pass a bearer token in an Authorization header.

You can retrieve an access token by first creating an API key, and then exchanging your API key for an IBM Cloud IAM token. For more information, see Retrieving an access token programmatically.

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.

IAM authentication. Replace {apikey} and {url} with your service credentials.


curl -u "apikey:{apikey}" -X {request_method} "{url}/{method}"

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


IamAuthenticator authenticator = new IamAuthenticator("{apikey}");
DirectLink directLink = new DirectLink("{version}", "{serviceName}",authenticator);

// Use only when need to change the endpoint.
// Default endpoint is directlink.cloud.ibm.com
directLink.setServiceUrl("{url}")

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


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

const directLinkV1 = new DirectLinkV1({
  authenticator: new IamAuthenticator({
    apikey: '{apikey}',
  }),
  version: '{version}',
  // Default is directlink.cloud.ibm.com
  serviceUrl: '{url}',
});

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


from ibm_cloud_networking_services import DirectLinkV1
from ibm_cloud_sdk_core.authenticators import IAMAuthenticator

authenticator = IAMAuthenticator('{apikey}')
direct_link = DirectLinkV1(
    version='{version}',
    authenticator=authenticator
)

# Use only when need to change the endpoint.
# Default endpoint is directlink.cloud.ibm.com
direct_link.set_service_url('{url}')

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


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

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

  version := "{version}"
  options := &directlinkv1.DirectLinkV1Options{
    Version: &version,
    Authenticator: authenticator,
    // Default is directlink.cloud.ibm.com
    URL:    "{serviceURL}",
  }

  directLink, directLinkErr := directlinkv1.NewDirectLinkV1UsingExternalConfig(options)

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

Auditing

You can monitor API activity within your account by using the IBM Cloud Direct Link service. Whenever an API method is called, an event is generated that you can then track and audit from within Activity Tracker. The specific event type is listed for each individual method.

For more information about how to track IBM Cloud Direct Link activity, see Auditing events for IBM Cloud Direct Link.


Authorization

Access management to Direct Link resources is done through Identity and Access Management (IAM). For more information, see Using IAM permissions with Direct Link.

API endpoint

https://directlink.cloud.ibm.com

Use Virtual Private Endpoint (VPE) for VPC to access Direct Link via https://private.directlink.cloud.ibm.com.


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 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.

ErrorResponse

Name Description
code{: .parameter-name .required}
string
An identifier of the problem.
Possible values: [invalid_field,invalid_header,invalid_method,missing_field,server_error]
message{: .parameter-name .required}
string
An explanation of the problem with possible solutions.
more_info{: .parameter-name}
string
A URL for more information about the solution.
target{: .parameter-name}
object
Details about the property (type and name) that is the focus of the problem.

The Java SDK generates an exception for any unsuccessful method invocation. All methods that accept an argument can also throw an IllegalArgumentException.

Exception Description
IllegalArgumentException An invalid argument was passed to the method.

When the Java SDK receives an error response from the Direct Link service, it generates an exception from the com.ibm.cloud.sdk.core.service.exception package. All service exceptions contain the following fields.

Field Description
statusCode The HTTP response code that is returned.
message A message that describes the error.

When the Node SDK receives an error response from the Direct Link service, it creates an Error object with information that describes the error that occurred. This error object is passed as the first parameter to the callback function for the method. The contents of the error object are as shown in the following table.

Error

Field Description
code The HTTP response code that is returned.
message A message that describes the error.

The Python SDK generates an exception for any unsuccessful method invocation. When the Python SDK receives an error response from the Direct Link service, it generates an ApiException with the following fields.

Field Description
code The HTTP response code that is returned.
message A message that describes the error.
info A dictionary of additional information about the error.

The Go SDK generates an error for any unsuccessful service instantiation and method invocation. You can check for the error immediately. The contents of the error object are as shown in the following table.

Error

Field Description
code The HTTP response code that is returned.
message A message that describes the error.

Example error handling


try {
  // Invoke a Direct Link method
} catch (BadRequestException e) {
  // Handle Bad Request (400) exception
} catch (UnauthorizedException e) {
  // Handle Unauthorized (401) exception
} catch (ForbiddenException e) {
  // Handle Forbidden (403) exception
} catch (NotFoundException e) {
  // Handle Not Found (404) exception
} catch (RequestTooLargeException e) {
  // Handle Request Too Large (413) exception
} catch (InternalServerErrorException e) {
  // Handle Internal Server Error (500) exception
} catch (ServiceResponseException e) {
  // Base class for all exceptions caused by error responses from the service
  System.out.println("Service returned status code "
    + e.getStatusCode() + ": " + e.getMessage());
}

Example error handling


directLink.method(params)
  .catch(err => {
    console.log('error:', err);
  });

Example error handling


from ibm_cloud_sdk_core.api_exception import ApiException
try:
    # Invoke a Direct Link method
except ApiException as ex:
    print "Method failed with status code " + str(ex.code) + ": " + ex.message

Example error handling


import "github.com/IBM/networking-go-sdk/directlinkv1"

// Instantiate a service
directLink, directLinkErr := directlinkv1.NewDirectLinkV1(options)

// Check for errors
if directLinkErr != nil {
  panic(directLinkErr)
}

// Call a method
result, response, responseErr := directLink.methodName(&methodOptions)

// Check for errors
if responseErr != nil {
  panic(responseErr)
}

Versioning

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

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

Any date-based version from Direct Link GA, up to the current date, is supported. Start development of new applications with the current date as a fixed value. Do not dynamically use the current date as the version for a production application. Instead, use a fixed date-based version that was tested with your application.

Specify the version to use on API requests with the version parameter when you create the service instance. The service uses the API version for the date you specify, or the most recent version before that date. Don't default to the current date. Instead, specify a date that matches a version that is compatible with your app, and don't change it until your app is ready for a later version.


// Mention the correct date for version param
String version = "2020-07-27";

// Instantiate authenticator as mentioned in Authentication
DirectLink directLink = new DirectLink(version, "{serviceName}", "${authenticator}");


const DirectLinkV1 = require('ibm-networking-services/direct-link');

const directLinkV1 = new DirectLinkV1({
  // Instantiate authenticator as mentioned in Authentication
  authenticator: '${authenticator}',
  version: '2020-07-27',  // Mention the correct date for version param
});


from ibm_cloud_networking_services import DirectLinkV1

# Instantiate authenticatior as mentioned in Authentication
direct_link = DirectLinkV1(
    version="2020-07-27", # Mention the correct date for version param
    authenticator=authenticator
)


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

func main() {

  // Mention the correct date for version param
  version := "2020-07-27"

  //Instantiate authenticator as mentioned in Authentication
  options := &directlinkv1.DirectLinkV1Options{
    Version: version,
    Authenticator: authenticator,
  }

  directLink, directLinkErr := directlinkv1.NewDirectLinkV1UsingExternalConfig(options)
}

API changes

API improvements and fixes are documented in the API change log, along with guidance on code updates that are required to use a new date-based version. By design, new features with backward-incompatible changes apply only to version dates on and after the feature's release. Changes that apply to older versions of the API are designed to maintain compatibility with existing applications and code.

Best practices

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

  • Log any 4xx or 5xx HTTP status code along with the included trace property.
  • Follow HTTP redirect rules for any 3xx HTTP status code.
  • Consume only the resources and properties that are needed for your application to function.
  • Avoid depending on any behavior that is not explicitly documented.

Methods

List gateways

List all Direct Link gateways in this account. Gateways in other accounts with connections to networks in this account are also returned.

List all Direct Link gateways in this account. Gateways in other accounts with connections to networks in this account are also returned.

List all Direct Link gateways in this account. Gateways in other accounts with connections to networks in this account are also returned.

List all Direct Link gateways in this account. Gateways in other accounts with connections to networks in this account are also returned.

List all Direct Link gateways in this account. Gateways in other accounts with connections to networks in this account are also returned.

GET /gateways
ServiceCall<GatewayCollection> listGateways(ListGatewaysOptions listGatewaysOptions)
listGateways(params)
list_gateways(
        self,
        **kwargs,
    ) -> DetailedResponse
(directLink *DirectLinkV1) ListGateways(listGatewaysOptions *ListGatewaysOptions) (result *GatewayCollection, response *core.DetailedResponse, err error)
(directLink *DirectLinkV1) ListGatewaysWithContext(ctx context.Context, listGatewaysOptions *ListGatewaysOptions) (result *GatewayCollection, response *core.DetailedResponse, err error)

Request

Use the ListGatewaysOptions.Builder to create a ListGatewaysOptions object that contains the parameter values for the listGateways method.

Instantiate the ListGatewaysOptions struct and set the fields to provide parameter values for the ListGateways method.

Query Parameters

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

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

parameters

    parameters

      WithContext method only

      • curl -X GET   https://$DL_ENDPOINT/v1/gateways?version=2019-12-13   -H "authorization: Bearer $IAM_TOKEN"
      • let res;
        try {
          res = await directLinkService.listGateways({});
          console.log(JSON.stringify(res.result, null, 2));
        } catch (err) {
          console.warn(err);
        }
      • ListGatewaysOptions listGatewaysOptions = new ListGatewaysOptions();
        
        Response<GatewayCollection> response = directLinkService.listGateways(listGatewaysOptions).execute();
        GatewayCollection gatewayCollection = response.getResult();
        
        System.out.println(gatewayCollection);
      • listGatewaysOptions := directLinkService.NewListGatewaysOptions()
        
        gatewayCollection, response, err := directLinkService.ListGateways(listGatewaysOptions)
        if err != nil {
          panic(err)
        }
        b, _ := json.MarshalIndent(gatewayCollection, "", "  ")
        fmt.Println(string(b))
      • response = direct_link_service.list_gateways()
        gateway_collection = response.get_result()
        
        print(json.dumps(gateway_collection, indent=2))

      Response

      List of gateways

      List of gateways.

      List of gateways.

      List of gateways.

      List of gateways.

      Status Code

      • Successfully retrieved the list of gateways.

      Example responses
      • {
          "gateways": [
            {
              "as_prepends": [
                {
                  "created_at": "2020-11-02T20:40:29.622Z",
                  "id": "ef4dcb1a-fee4-41c7-9e11-9cd99e65c999",
                  "length": 4,
                  "policy": "import",
                  "prefix": "172.17.0.0/16",
                  "updated_at": "2020-11-02T20:40:29.622Z"
                }
              ],
              "authentication_key": {
                "crn": "crn:v1:bluemix:public:kms:us-south:a/766d8d374a484f029d0fca5a40a52a1c:5d343839-07d3-4213-a950-0f71ed45423f:key:7fc1a0ba-4633-48cb-997b-5749787c952c"
              },
              "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",
              "connection_mode": "transit",
              "created_at": "2020-11-02T20:40:29.622Z",
              "crn": "crn:v1:bluemix:public:directlink:dal00:a/aaaaaaaa4a484f029d0fca5a11111111::connect:bbbbbbbb-f326-428f-a345-222222222222",
              "cross_account": false,
              "cross_connect_router": "xcr01.dal03",
              "default_export_route_filter": "permit",
              "default_import_route_filter": "deny",
              "global": true,
              "id": "ef4dcb1a-fee4-41c7-9e11-9cd99e65c1f4",
              "link_status": "up",
              "location_display_name": "Dallas 03",
              "location_name": "dal03",
              "metered": false,
              "name": "example-gateway",
              "operational_status": "provisioned",
              "operational_status_reasons": [],
              "resource_group": {
                "id": "54321b1a-fee4-41c7-9e11-9cd99e000aaa"
              },
              "speed_mbps": 1000,
              "type": "dedicated"
            }
          ]
        }
      • {
          "gateways": [
            {
              "as_prepends": [
                {
                  "created_at": "2020-11-02T20:40:29.622Z",
                  "id": "ef4dcb1a-fee4-41c7-9e11-9cd99e65c999",
                  "length": 4,
                  "policy": "import",
                  "prefix": "172.17.0.0/16",
                  "updated_at": "2020-11-02T20:40:29.622Z"
                }
              ],
              "authentication_key": {
                "crn": "crn:v1:bluemix:public:kms:us-south:a/766d8d374a484f029d0fca5a40a52a1c:5d343839-07d3-4213-a950-0f71ed45423f:key:7fc1a0ba-4633-48cb-997b-5749787c952c"
              },
              "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",
              "connection_mode": "transit",
              "created_at": "2020-11-02T20:40:29.622Z",
              "crn": "crn:v1:bluemix:public:directlink:dal00:a/aaaaaaaa4a484f029d0fca5a11111111::connect:bbbbbbbb-f326-428f-a345-222222222222",
              "cross_account": false,
              "cross_connect_router": "xcr01.dal03",
              "default_export_route_filter": "permit",
              "default_import_route_filter": "deny",
              "global": true,
              "id": "ef4dcb1a-fee4-41c7-9e11-9cd99e65c1f4",
              "link_status": "up",
              "location_display_name": "Dallas 03",
              "location_name": "dal03",
              "metered": false,
              "name": "example-gateway",
              "operational_status": "provisioned",
              "operational_status_reasons": [],
              "resource_group": {
                "id": "54321b1a-fee4-41c7-9e11-9cd99e000aaa"
              },
              "speed_mbps": 1000,
              "type": "dedicated"
            }
          ]
        }

      Create gateway

      Creates a Direct Link gateway based on the supplied template.

      Creates a Direct Link gateway based on the supplied template.

      Creates a Direct Link gateway based on the supplied template.

      Creates a Direct Link gateway based on the supplied template.

      Creates a Direct Link gateway based on the supplied template.

      POST /gateways
      ServiceCall<Gateway> createGateway(CreateGatewayOptions createGatewayOptions)
      createGateway(params)
      create_gateway(
              self,
              gateway_template: 'GatewayTemplate',
              **kwargs,
          ) -> DetailedResponse
      (directLink *DirectLinkV1) CreateGateway(createGatewayOptions *CreateGatewayOptions) (result *Gateway, response *core.DetailedResponse, err error)
      (directLink *DirectLinkV1) CreateGatewayWithContext(ctx context.Context, createGatewayOptions *CreateGatewayOptions) (result *Gateway, response *core.DetailedResponse, err error)

      Request

      Use the CreateGatewayOptions.Builder to create a CreateGatewayOptions object that contains the parameter values for the createGateway method.

      Instantiate the CreateGatewayOptions struct and set the fields to provide parameter values for the CreateGateway method.

      Query Parameters

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

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

      The Direct Link Gateway template

      The createGateway options.

      parameters

      • Gateway fields specific to type=dedicated gateway create.

        parameters

        • Gateway fields specific to type=dedicated gateway create.

          WithContext method only

          The CreateGateway options.

          • curl -X POST   https://$DL_ENDPOINT/v1/gateways?version=2019-12-13   -H "authorization: Bearer $IAM_TOKEN"   -d '{
                    "bgp_asn": 1000,
                    "bgp_base_cidr": "10.254.30.76/30",
                    "global": true,
                    "location_name": "dal03",
                    "name": "example-gateway",
                    "speed_mbps": 1000,
                    "connection_mode": "transit",
                    "type": "dedicated",
                    "cross_connect_router": "xcr03.dal03",
                    "metered": true,
                    "carrier_name": "my carrier",
                    "customer_name": "my customer"
                  }'
          • // Request models needed by this operation.
            
            // GatewayTemplateGatewayTypeDedicatedTemplate
            const gatewayTemplateModel = {
              bgp_asn: 64999,
              global: true,
              metered: false,
              name: 'myGateway',
              speed_mbps: 1000,
              type: 'dedicated',
              carrier_name: 'myCarrierName',
              cross_connect_router: 'xcr01.dal03',
              customer_name: 'newCustomerName',
              location_name: 'dal03',
            };
            
            const params = {
              gatewayTemplate: gatewayTemplateModel,
            };
            
            let res;
            try {
              res = await directLinkService.createGateway(params);
              console.log(JSON.stringify(res.result, null, 2));
            } catch (err) {
              console.warn(err);
            }
          • GatewayTemplateGatewayTypeDedicatedTemplate gatewayTemplateModel = new GatewayTemplateGatewayTypeDedicatedTemplate.Builder()
              .bgpAsn(Long.valueOf("64999"))
              .global(true)
              .metered(false)
              .name("myGateway")
              .speedMbps(Long.valueOf("1000"))
              .type("dedicated")
              .carrierName("myCarrierName")
              .crossConnectRouter("xcr01.dal03")
              .customerName("newCustomerName")
              .locationName("dal03")
              .build();
            CreateGatewayOptions createGatewayOptions = new CreateGatewayOptions.Builder()
              .gatewayTemplate(gatewayTemplateModel)
              .build();
            
            Response<Gateway> response = directLinkService.createGateway(createGatewayOptions).execute();
            Gateway gateway = response.getResult();
            
            System.out.println(gateway);
          • gatewayTemplateModel := &directlinkv1.GatewayTemplateGatewayTypeDedicatedTemplate{
              BgpAsn: core.Int64Ptr(int64(64999)),
              Global: core.BoolPtr(true),
              Metered: core.BoolPtr(false),
              Name: core.StringPtr("myGateway"),
              SpeedMbps: core.Int64Ptr(int64(1000)),
              Type: core.StringPtr("dedicated"),
              CarrierName: core.StringPtr("myCarrierName"),
              CrossConnectRouter: core.StringPtr("xcr01.dal03"),
              CustomerName: core.StringPtr("newCustomerName"),
              LocationName: core.StringPtr("dal03"),
            }
            
            createGatewayOptions := directLinkService.NewCreateGatewayOptions(
              gatewayTemplateModel,
            )
            
            gateway, response, err := directLinkService.CreateGateway(createGatewayOptions)
            if err != nil {
              panic(err)
            }
            b, _ := json.MarshalIndent(gateway, "", "  ")
            fmt.Println(string(b))
          • gateway_template_model = {
              'bgp_asn': 64999,
              'global': True,
              'metered': False,
              'name': 'myGateway',
              'speed_mbps': 1000,
              'type': 'dedicated',
              'carrier_name': 'myCarrierName',
              'cross_connect_router': 'xcr01.dal03',
              'customer_name': 'newCustomerName',
              'location_name': 'dal03',
            }
            
            response = direct_link_service.create_gateway(
              gateway_template=gateway_template_model,
            )
            gateway = response.get_result()
            
            print(json.dumps(gateway, indent=2))

          Response

          gateway

          gateway.

          gateway.

          gateway.

          gateway.

          Status Code

          • The Direct Link gateway was created successfully.

          • An invalid Direct Link template was provided.

          Example responses
          • {
              "as_prepends": [
                {
                  "created_at": "2020-11-02T20:40:29.622Z",
                  "id": "ef4dcb1a-fee4-41c7-9e11-9cd99e65c999",
                  "length": 4,
                  "policy": "import",
                  "prefix": "172.17.0.0/16",
                  "updated_at": "2020-11-02T20:40:29.622Z"
                }
              ],
              "authentication_key": {
                "crn": "crn:v1:bluemix:public:kms:us-south:a/4111d05f36894e3cb9b46a43556d9000:abc111b8-37aa-4034-9def-f2607c87aaaa:key:bbb222bc-430a-4de9-9aad-84e5bb022222"
              },
              "bfd_config": {
                "bfd_status": "up",
                "bfd_status_updated_at": "2020-08-20T06:58:41.909781Z",
                "interval": 2000,
                "multiplier": 3
              },
              "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",
              "bgp_status_updated_at": "2020-08-20T06:58:41.909781Z",
              "carrier_name": "CarrierName",
              "connection_mode": "transit",
              "created_at": "2020-11-02T20:40:29.622Z",
              "crn": "crn:v1:bluemix:public:directlink:dal00:a/aaaaaaaa4a484f029d0fca5a11111111::connect:bbbbbbbb-f326-428f-a345-222222222222",
              "cross_account": false,
              "cross_connect_router": "xcr01.dal03",
              "customer_name": "CustomerName",
              "default_export_route_filter": "permit",
              "default_import_route_filter": "deny",
              "global": true,
              "id": "ef4dcb1a-fee4-41c7-9e11-9cd99e65c1f4",
              "link_status": "up",
              "link_status_updated_at": "2020-08-20T06:58:41.909781Z",
              "location_display_name": "Dallas 03",
              "location_name": "dal03",
              "macsec": {
                "active": true,
                "security_policy": "must_secure",
                "status": "secured"
              },
              "metered": false,
              "name": "example-gateway",
              "operational_status": "provisioned",
              "operational_status_reasons": [],
              "resource_group": {
                "id": "54321b1a-fee4-41c7-9e11-9cd99e000aaa"
              },
              "speed_mbps": 1000,
              "type": "dedicated"
            }
          • {
              "as_prepends": [
                {
                  "created_at": "2020-11-02T20:40:29.622Z",
                  "id": "ef4dcb1a-fee4-41c7-9e11-9cd99e65c999",
                  "length": 4,
                  "policy": "import",
                  "prefix": "172.17.0.0/16",
                  "updated_at": "2020-11-02T20:40:29.622Z"
                }
              ],
              "authentication_key": {
                "crn": "crn:v1:bluemix:public:kms:us-south:a/4111d05f36894e3cb9b46a43556d9000:abc111b8-37aa-4034-9def-f2607c87aaaa:key:bbb222bc-430a-4de9-9aad-84e5bb022222"
              },
              "bfd_config": {
                "bfd_status": "up",
                "bfd_status_updated_at": "2020-08-20T06:58:41.909781Z",
                "interval": 2000,
                "multiplier": 3
              },
              "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",
              "bgp_status_updated_at": "2020-08-20T06:58:41.909781Z",
              "carrier_name": "CarrierName",
              "connection_mode": "transit",
              "created_at": "2020-11-02T20:40:29.622Z",
              "crn": "crn:v1:bluemix:public:directlink:dal00:a/aaaaaaaa4a484f029d0fca5a11111111::connect:bbbbbbbb-f326-428f-a345-222222222222",
              "cross_account": false,
              "cross_connect_router": "xcr01.dal03",
              "customer_name": "CustomerName",
              "default_export_route_filter": "permit",
              "default_import_route_filter": "deny",
              "global": true,
              "id": "ef4dcb1a-fee4-41c7-9e11-9cd99e65c1f4",
              "link_status": "up",
              "link_status_updated_at": "2020-08-20T06:58:41.909781Z",
              "location_display_name": "Dallas 03",
              "location_name": "dal03",
              "macsec": {
                "active": true,
                "security_policy": "must_secure",
                "status": "secured"
              },
              "metered": false,
              "name": "example-gateway",
              "operational_status": "provisioned",
              "operational_status_reasons": [],
              "resource_group": {
                "id": "54321b1a-fee4-41c7-9e11-9cd99e000aaa"
              },
              "speed_mbps": 1000,
              "type": "dedicated"
            }
          • {
              "errors": [
                {
                  "code": "validation_required_field_missing",
                  "message": "Mandatory field is missing.",
                  "more_info": "https://cloud.ibm.com/apidocs/direct_link#error-handling",
                  "target": {
                    "name": "name",
                    "type": "field"
                  }
                }
              ],
              "trace": "03391bce-b650-475a-96b8-e47e70d93e54"
            }
          • {
              "errors": [
                {
                  "code": "validation_required_field_missing",
                  "message": "Mandatory field is missing.",
                  "more_info": "https://cloud.ibm.com/apidocs/direct_link#error-handling",
                  "target": {
                    "name": "name",
                    "type": "field"
                  }
                }
              ],
              "trace": "03391bce-b650-475a-96b8-e47e70d93e54"
            }

          Delete gateway

          Delete a Direct Link gateway.

          Delete a Direct Link gateway.

          Delete a Direct Link gateway.

          Delete a Direct Link gateway.

          Delete a Direct Link gateway.

          DELETE /gateways/{id}
          ServiceCall<Void> deleteGateway(DeleteGatewayOptions deleteGatewayOptions)
          deleteGateway(params)
          delete_gateway(
                  self,
                  id: str,
                  **kwargs,
              ) -> DetailedResponse
          (directLink *DirectLinkV1) DeleteGateway(deleteGatewayOptions *DeleteGatewayOptions) (response *core.DetailedResponse, err error)
          (directLink *DirectLinkV1) DeleteGatewayWithContext(ctx context.Context, deleteGatewayOptions *DeleteGatewayOptions) (response *core.DetailedResponse, err error)

          Request

          Use the DeleteGatewayOptions.Builder to create a DeleteGatewayOptions object that contains the parameter values for the deleteGateway method.

          Instantiate the DeleteGatewayOptions struct and set the fields to provide parameter values for the DeleteGateway method.

          Path Parameters

          • Direct Link gateway identifier

            Possible values: length = 36, Value must match regular expression ^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$

            Example: 0a06fb9b-820f-4c44-8a31-77f1f0806d28

          Query Parameters

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

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

          The deleteGateway options.

          parameters

          • Direct Link gateway identifier.

            Possible values: length = 36, Value must match regular expression /^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/

            Examples:

          parameters

          • Direct Link gateway identifier.

            Possible values: length = 36, Value must match regular expression /^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/

            Examples:

          WithContext method only

          The DeleteGateway options.

          • curl -X DELETE   https://$DL_ENDPOINT/v1/gateways/$GATEWAY_ID?version=2019-12-13   -H "authorization: Bearer $IAM_TOKEN"
          • const params = {
              id: '0a06fb9b-820f-4c44-8a31-77f1f0806d28',
            };
            
            try {
              await directLinkService.deleteGateway(params);
            } catch (err) {
              console.warn(err);
            }
          • DeleteGatewayOptions deleteGatewayOptions = new DeleteGatewayOptions.Builder()
              .id("0a06fb9b-820f-4c44-8a31-77f1f0806d28")
              .build();
            
            Response<Void> response = directLinkService.deleteGateway(deleteGatewayOptions).execute();
          • deleteGatewayOptions := directLinkService.NewDeleteGatewayOptions(
              "0a06fb9b-820f-4c44-8a31-77f1f0806d28",
            )
            
            response, err := directLinkService.DeleteGateway(deleteGatewayOptions)
            if err != nil {
              panic(err)
            }
            if response.StatusCode != 204 {
              fmt.Printf("\nUnexpected response status code received from DeleteGateway(): %d\n", response.StatusCode)
            }
          • response = direct_link_service.delete_gateway(
              id='0a06fb9b-820f-4c44-8a31-77f1f0806d28',
            )

          Response

          Status Code

          • The Direct Link gateway was deleted successfully.

          • The gateway could not be deleted as there are virtual connections associated with it. Delete all virtual connections associated with this gateway and retry.

          • A Direct Link gateway with the specified identifier could not be found.

          Example responses
          • {
              "errors": [
                {
                  "code": "bad_request",
                  "message": "The gateway could not be deleted as there are virtual connections associated with it. Delete all virtual connections associated with this gateway and retry.",
                  "more_info": "https://cloud.ibm.com/apidocs/direct_link#error-handling"
                }
              ],
              "trace": "03391bce-b650-475a-96b8-e47e70d93e54"
            }
          • {
              "errors": [
                {
                  "code": "bad_request",
                  "message": "The gateway could not be deleted as there are virtual connections associated with it. Delete all virtual connections associated with this gateway and retry.",
                  "more_info": "https://cloud.ibm.com/apidocs/direct_link#error-handling"
                }
              ],
              "trace": "03391bce-b650-475a-96b8-e47e70d93e54"
            }
          • {
              "errors": [
                {
                  "code": "not_found",
                  "message": "Cannot find Gateway",
                  "more_info": "https://cloud.ibm.com/apidocs/direct_link#error-handling"
                }
              ],
              "trace": "03391bce-b650-475a-96b8-e47e70d93e54"
            }
          • {
              "errors": [
                {
                  "code": "not_found",
                  "message": "Cannot find Gateway",
                  "more_info": "https://cloud.ibm.com/apidocs/direct_link#error-handling"
                }
              ],
              "trace": "03391bce-b650-475a-96b8-e47e70d93e54"
            }

          Get gateway

          Retrieve a Direct Link gateway.

          Retrieve a Direct Link gateway.

          Retrieve a Direct Link gateway.

          Retrieve a Direct Link gateway.

          Retrieve a Direct Link gateway.

          GET /gateways/{id}
          ServiceCall<GetGatewayResponse> getGateway(GetGatewayOptions getGatewayOptions)
          getGateway(params)
          get_gateway(
                  self,
                  id: str,
                  **kwargs,
              ) -> DetailedResponse
          (directLink *DirectLinkV1) GetGateway(getGatewayOptions *GetGatewayOptions) (result GetGatewayResponseIntf, response *core.DetailedResponse, err error)
          (directLink *DirectLinkV1) GetGatewayWithContext(ctx context.Context, getGatewayOptions *GetGatewayOptions) (result GetGatewayResponseIntf, response *core.DetailedResponse, err error)

          Request

          Use the GetGatewayOptions.Builder to create a GetGatewayOptions object that contains the parameter values for the getGateway method.

          Instantiate the GetGatewayOptions struct and set the fields to provide parameter values for the GetGateway method.

          Path Parameters

          • Direct Link gateway identifier

            Possible values: length = 36, Value must match regular expression ^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$

            Example: 0a06fb9b-820f-4c44-8a31-77f1f0806d28

          Query Parameters

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

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

          The getGateway options.

          parameters

          • Direct Link gateway identifier.

            Possible values: length = 36, Value must match regular expression /^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/

            Examples:

          parameters

          • Direct Link gateway identifier.

            Possible values: length = 36, Value must match regular expression /^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/

            Examples:

          WithContext method only

          The GetGateway options.

          • curl -X GET   https://$DL_ENDPOINT/v1/gateways/$GATEWAY_ID?version=2019-12-13   -H "authorization: Bearer $IAM_TOKEN"
          • const params = {
              id: '0a06fb9b-820f-4c44-8a31-77f1f0806d28',
            };
            
            let res;
            try {
              res = await directLinkService.getGateway(params);
              console.log(JSON.stringify(res.result, null, 2));
            } catch (err) {
              console.warn(err);
            }
          • GetGatewayOptions getGatewayOptions = new GetGatewayOptions.Builder()
              .id("0a06fb9b-820f-4c44-8a31-77f1f0806d28")
              .build();
            
            Response<GetGatewayResponse> response = directLinkService.getGateway(getGatewayOptions).execute();
            GetGatewayResponse getGatewayResponse = response.getResult();
            
            System.out.println(getGatewayResponse);
          • getGatewayOptions := directLinkService.NewGetGatewayOptions(
              "0a06fb9b-820f-4c44-8a31-77f1f0806d28",
            )
            
            getGatewayResponse, response, err := directLinkService.GetGateway(getGatewayOptions)
            if err != nil {
              panic(err)
            }
            b, _ := json.MarshalIndent(getGatewayResponse, "", "  ")
            fmt.Println(string(b))
          • response = direct_link_service.get_gateway(
              id='0a06fb9b-820f-4c44-8a31-77f1f0806d28',
            )
            get_gateway_response = response.get_result()
            
            print(json.dumps(get_gateway_response, indent=2))

          Response

          gateway

          gateway.

          gateway.

          gateway.

          gateway.

          Status Code

          • The Direct Link gateway was retrieved successfully.

          • A Direct Link gateway with the specified identifier could not be found.

          Example responses
          • {
              "as_prepends": [
                {
                  "created_at": "2020-11-02T20:40:29.622Z",
                  "id": "ef4dcb1a-fee4-41c7-9e11-9cd99e65c999",
                  "length": 4,
                  "policy": "import",
                  "prefix": "172.17.0.0/16",
                  "updated_at": "2020-11-02T20:40:29.622Z"
                }
              ],
              "authentication_key": {
                "crn": "crn:v1:bluemix:public:kms:us-south:a/4111d05f36894e3cb9b46a43556d9000:abc111b8-37aa-4034-9def-f2607c87aaaa:key:bbb222bc-430a-4de9-9aad-84e5bb022222"
              },
              "bfd_config": {
                "bfd_status": "up",
                "bfd_status_updated_at": "2020-08-20T06:58:41.909781Z",
                "interval": 2000,
                "multiplier": 3
              },
              "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",
              "bgp_status_updated_at": "2020-08-20T06:58:41.909781Z",
              "carrier_name": "CarrierName",
              "connection_mode": "transit",
              "created_at": "2020-11-02T20:40:29.622Z",
              "crn": "crn:v1:bluemix:public:directlink:dal00:a/aaaaaaaa4a484f029d0fca5a11111111::connect:bbbbbbbb-f326-428f-a345-222222222222",
              "cross_account": false,
              "cross_connect_router": "xcr01.dal03",
              "customer_name": "CustomerName",
              "default_export_route_filter": "permit",
              "default_import_route_filter": "deny",
              "global": true,
              "id": "ef4dcb1a-fee4-41c7-9e11-9cd99e65c1f4",
              "link_status": "up",
              "link_status_updated_at": "2020-08-20T06:58:41.909781Z",
              "location_display_name": "Dallas 03",
              "location_name": "dal03",
              "macsec": {
                "active": true,
                "security_policy": "must_secure",
                "status": "secured"
              },
              "metered": false,
              "name": "example-gateway",
              "operational_status": "provisioned",
              "operational_status_reasons": [],
              "resource_group": {
                "id": "54321b1a-fee4-41c7-9e11-9cd99e000aaa"
              },
              "speed_mbps": 1000,
              "type": "dedicated"
            }
          • {
              "as_prepends": [
                {
                  "created_at": "2020-11-02T20:40:29.622Z",
                  "id": "ef4dcb1a-fee4-41c7-9e11-9cd99e65c999",
                  "length": 4,
                  "policy": "import",
                  "prefix": "172.17.0.0/16",
                  "updated_at": "2020-11-02T20:40:29.622Z"
                }
              ],
              "authentication_key": {
                "crn": "crn:v1:bluemix:public:kms:us-south:a/4111d05f36894e3cb9b46a43556d9000:abc111b8-37aa-4034-9def-f2607c87aaaa:key:bbb222bc-430a-4de9-9aad-84e5bb022222"
              },
              "bfd_config": {
                "bfd_status": "up",
                "bfd_status_updated_at": "2020-08-20T06:58:41.909781Z",
                "interval": 2000,
                "multiplier": 3
              },
              "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",
              "bgp_status_updated_at": "2020-08-20T06:58:41.909781Z",
              "carrier_name": "CarrierName",
              "connection_mode": "transit",
              "created_at": "2020-11-02T20:40:29.622Z",
              "crn": "crn:v1:bluemix:public:directlink:dal00:a/aaaaaaaa4a484f029d0fca5a11111111::connect:bbbbbbbb-f326-428f-a345-222222222222",
              "cross_account": false,
              "cross_connect_router": "xcr01.dal03",
              "customer_name": "CustomerName",
              "default_export_route_filter": "permit",
              "default_import_route_filter": "deny",
              "global": true,
              "id": "ef4dcb1a-fee4-41c7-9e11-9cd99e65c1f4",
              "link_status": "up",
              "link_status_updated_at": "2020-08-20T06:58:41.909781Z",
              "location_display_name": "Dallas 03",
              "location_name": "dal03",
              "macsec": {
                "active": true,
                "security_policy": "must_secure",
                "status": "secured"
              },
              "metered": false,
              "name": "example-gateway",
              "operational_status": "provisioned",
              "operational_status_reasons": [],
              "resource_group": {
                "id": "54321b1a-fee4-41c7-9e11-9cd99e000aaa"
              },
              "speed_mbps": 1000,
              "type": "dedicated"
            }
          • {
              "errors": [
                {
                  "code": "not_found",
                  "message": "Cannot find Gateway",
                  "more_info": "https://cloud.ibm.com/apidocs/direct_link#error-handling"
                }
              ],
              "trace": "03391bce-b650-475a-96b8-e47e70d93e54"
            }
          • {
              "errors": [
                {
                  "code": "not_found",
                  "message": "Cannot find Gateway",
                  "more_info": "https://cloud.ibm.com/apidocs/direct_link#error-handling"
                }
              ],
              "trace": "03391bce-b650-475a-96b8-e47e70d93e54"
            }

          Update gateway

          Update a Direct Link gateway.

          Update a Direct Link gateway.

          Update a Direct Link gateway.

          Update a Direct Link gateway.

          Update a Direct Link gateway.

          PATCH /gateways/{id}
          ServiceCall<Gateway> updateGateway(UpdateGatewayOptions updateGatewayOptions)
          updateGateway(params)
          update_gateway(
                  self,
                  id: str,
                  gateway_patch_template: 'GatewayPatchTemplate',
                  **kwargs,
              ) -> DetailedResponse
          (directLink *DirectLinkV1) UpdateGateway(updateGatewayOptions *UpdateGatewayOptions) (result *Gateway, response *core.DetailedResponse, err error)
          (directLink *DirectLinkV1) UpdateGatewayWithContext(ctx context.Context, updateGatewayOptions *UpdateGatewayOptions) (result *Gateway, response *core.DetailedResponse, err error)

          Request

          Use the UpdateGatewayOptions.Builder to create a UpdateGatewayOptions object that contains the parameter values for the updateGateway method.

          Instantiate the UpdateGatewayOptions struct and set the fields to provide parameter values for the UpdateGateway method.

          Path Parameters

          • Direct Link gateway identifier

            Possible values: length = 36, Value must match regular expression ^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$

            Example: 0a06fb9b-820f-4c44-8a31-77f1f0806d28

          Query Parameters

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

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

          The Direct Link gateway patch

          The updateGateway options.

          parameters

          • Direct Link gateway identifier.

            Possible values: length = 36, Value must match regular expression /^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/

            Examples:
            • BFD configuration information.

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

              Examples:
            • BGP customer edge router CIDR is the new CIDR (Classless Inter-Domain Routing) value to be updated on customer edge router for the DL 2.0 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:
            • BGP IBM CIDR is the new CIDR (Classless Inter-Domain Routing) value to be updated on IBM edge router for the DL 2.0 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:
            • Type of services this Gateway is attached to. Mode transit means this Gateway will be attached to Transit Gateway Service and direct means this Gateway will be attached to vpc or classic connection. The list of enumerated values for this property may expand in the future. Code and processes using this field must tolerate unexpected values.

              Allowable values: [direct,transit]

              Examples:
            • The default directional route filter action that applies to routes that do not match any directional route filters.

              Allowable values: [permit,deny]

              Examples:
            • The default directional route filter action that applies to routes that do not match any directional route filters.

              Allowable values: [permit,deny]

              Examples:
            • Gateways with global routing (true) can connect to networks outside of their associated region.

              Examples:
            • Use this field during LOA rejection to provide the reason for the rejection.

              Only allowed for type=dedicated gateways.

              Examples:
            • Metered billing option. When true gateway usage is billed per gigabyte. When false there is no per gigabyte usage charge, instead a flat rate is charged for the gateway.

              Examples:
            • The unique user-defined name for this gateway.

              Possible values: 1 ≤ length ≤ 63, Value must match regular expression /^([a-zA-Z]|[a-zA-Z][-_a-zA-Z0-9]*[a-zA-Z0-9])$/

              Examples:
            • Gateway operational status.

              For gateways pending LOA approval, patch operational_status to the appropriate value to approve or reject its LOA. When rejecting an LOA, provide reject reasoning in loa_reject_reason.

              Only allowed for type=dedicated gateways.

              Allowable values: [loa_accepted,loa_rejected]

              Examples:
            • Gateway patch panel complete notification from implementation team.

              Examples:
            • Gateway speed in megabits per second.

              Examples:
            • The VLAN to configure for this gateway.

              Specify null to remove an existing VLAN configuration.

              The gateway must have a type of dedicated.

              Possible values: 2 ≤ value ≤ 3967

              Examples:

            parameters

            • Direct Link gateway identifier.

              Possible values: length = 36, Value must match regular expression /^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/

              Examples:
            • patch gateway template.

            WithContext method only

            The UpdateGateway options.

            • curl -X PATCH   https://$DL_ENDPOINT/v1/gateways/$GATEWAY_ID?version=2019-12-13   -H "authorization: Bearer $IAM_TOKEN"
                -d '{
                      "name": "new_gateway_name"
                    }'
            • const params = {
                id: '0a06fb9b-820f-4c44-8a31-77f1f0806d28',
              };
              
              let res;
              try {
                res = await directLinkService.updateGateway(params);
                console.log(JSON.stringify(res.result, null, 2));
              } catch (err) {
                console.warn(err);
              }
            • GatewayPatchTemplate gatewayPatchTemplateModel = new GatewayPatchTemplate.Builder()
                .build();
              Map<String, Object> gatewayPatchTemplateModelAsPatch = gatewayPatchTemplateModel.asPatch();
              UpdateGatewayOptions updateGatewayOptions = new UpdateGatewayOptions.Builder()
                .id("0a06fb9b-820f-4c44-8a31-77f1f0806d28")
                .gatewayPatchTemplatePatch(gatewayPatchTemplateModelAsPatch)
                .build();
              
              Response<Gateway> response = directLinkService.updateGateway(updateGatewayOptions).execute();
              Gateway gateway = response.getResult();
              
              System.out.println(gateway);
            • gatewayPatchTemplateModel := &directlinkv1.GatewayPatchTemplate{
              }
              gatewayPatchTemplateModelAsPatch, asPatchErr := gatewayPatchTemplateModel.AsPatch()
              Expect(asPatchErr).To(BeNil())
              
              updateGatewayOptions := directLinkService.NewUpdateGatewayOptions(
                "0a06fb9b-820f-4c44-8a31-77f1f0806d28",
                gatewayPatchTemplateModelAsPatch,
              )
              
              gateway, response, err := directLinkService.UpdateGateway(updateGatewayOptions)
              if err != nil {
                panic(err)
              }
              b, _ := json.MarshalIndent(gateway, "", "  ")
              fmt.Println(string(b))
            • gateway_patch_template_model = {
              }
              
              response = direct_link_service.update_gateway(
                id='0a06fb9b-820f-4c44-8a31-77f1f0806d28',
                gateway_patch_template=gateway_patch_template_model,
              )
              gateway = response.get_result()
              
              print(json.dumps(gateway, indent=2))

            Response

            gateway

            gateway.

            gateway.

            gateway.

            gateway.

            Status Code

            • The Direct Link gateway was updated successfully.

            • The request was invalid.

            • A Direct Link gateway with the specified identifier could not be found.

            Example responses
            • {
                "as_prepends": [
                  {
                    "created_at": "2020-11-02T20:40:29.622Z",
                    "id": "ef4dcb1a-fee4-41c7-9e11-9cd99e65c999",
                    "length": 4,
                    "policy": "import",
                    "prefix": "172.17.0.0/16",
                    "updated_at": "2020-11-02T20:40:29.622Z"
                  }
                ],
                "authentication_key": {
                  "crn": "crn:v1:bluemix:public:kms:us-south:a/4111d05f36894e3cb9b46a43556d9000:abc111b8-37aa-4034-9def-f2607c87aaaa:key:bbb222bc-430a-4de9-9aad-84e5bb022222"
                },
                "bfd_config": {
                  "bfd_status": "up",
                  "bfd_status_updated_at": "2020-08-20T06:58:41.909781Z",
                  "interval": 2000,
                  "multiplier": 3
                },
                "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",
                "bgp_status_updated_at": "2020-08-20T06:58:41.909781Z",
                "carrier_name": "CarrierName",
                "connection_mode": "transit",
                "created_at": "2020-11-02T20:40:29.622Z",
                "crn": "crn:v1:bluemix:public:directlink:dal00:a/aaaaaaaa4a484f029d0fca5a11111111::connect:bbbbbbbb-f326-428f-a345-222222222222",
                "cross_account": false,
                "cross_connect_router": "xcr01.dal03",
                "customer_name": "CustomerName",
                "default_export_route_filter": "permit",
                "default_import_route_filter": "deny",
                "global": true,
                "id": "ef4dcb1a-fee4-41c7-9e11-9cd99e65c1f4",
                "link_status": "up",
                "link_status_updated_at": "2020-08-20T06:58:41.909781Z",
                "location_display_name": "Dallas 03",
                "location_name": "dal03",
                "macsec": {
                  "active": true,
                  "security_policy": "must_secure",
                  "status": "secured"
                },
                "metered": false,
                "name": "example-gateway",
                "operational_status": "provisioned",
                "operational_status_reasons": [],
                "resource_group": {
                  "id": "54321b1a-fee4-41c7-9e11-9cd99e000aaa"
                },
                "speed_mbps": 1000,
                "type": "dedicated"
              }
            • {
                "as_prepends": [
                  {
                    "created_at": "2020-11-02T20:40:29.622Z",
                    "id": "ef4dcb1a-fee4-41c7-9e11-9cd99e65c999",
                    "length": 4,
                    "policy": "import",
                    "prefix": "172.17.0.0/16",
                    "updated_at": "2020-11-02T20:40:29.622Z"
                  }
                ],
                "authentication_key": {
                  "crn": "crn:v1:bluemix:public:kms:us-south:a/4111d05f36894e3cb9b46a43556d9000:abc111b8-37aa-4034-9def-f2607c87aaaa:key:bbb222bc-430a-4de9-9aad-84e5bb022222"
                },
                "bfd_config": {
                  "bfd_status": "up",
                  "bfd_status_updated_at": "2020-08-20T06:58:41.909781Z",
                  "interval": 2000,
                  "multiplier": 3
                },
                "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",
                "bgp_status_updated_at": "2020-08-20T06:58:41.909781Z",
                "carrier_name": "CarrierName",
                "connection_mode": "transit",
                "created_at": "2020-11-02T20:40:29.622Z",
                "crn": "crn:v1:bluemix:public:directlink:dal00:a/aaaaaaaa4a484f029d0fca5a11111111::connect:bbbbbbbb-f326-428f-a345-222222222222",
                "cross_account": false,
                "cross_connect_router": "xcr01.dal03",
                "customer_name": "CustomerName",
                "default_export_route_filter": "permit",
                "default_import_route_filter": "deny",
                "global": true,
                "id": "ef4dcb1a-fee4-41c7-9e11-9cd99e65c1f4",
                "link_status": "up",
                "link_status_updated_at": "2020-08-20T06:58:41.909781Z",
                "location_display_name": "Dallas 03",
                "location_name": "dal03",
                "macsec": {
                  "active": true,
                  "security_policy": "must_secure",
                  "status": "secured"
                },
                "metered": false,
                "name": "example-gateway",
                "operational_status": "provisioned",
                "operational_status_reasons": [],
                "resource_group": {
                  "id": "54321b1a-fee4-41c7-9e11-9cd99e000aaa"
                },
                "speed_mbps": 1000,
                "type": "dedicated"
              }
            • {
                "errors": [
                  {
                    "code": "validation_invalid_argument",
                    "message": "Invalid Request",
                    "more_info": "https://cloud.ibm.com/apidocs/direct_link#error-handling"
                  }
                ],
                "trace": "03391bce-b650-475a-96b8-e47e70d93e54"
              }
            • {
                "errors": [
                  {
                    "code": "validation_invalid_argument",
                    "message": "Invalid Request",
                    "more_info": "https://cloud.ibm.com/apidocs/direct_link#error-handling"
                  }
                ],
                "trace": "03391bce-b650-475a-96b8-e47e70d93e54"
              }
            • {
                "errors": [
                  {
                    "code": "not_found",
                    "message": "Cannot find Gateway",
                    "more_info": "https://cloud.ibm.com/apidocs/direct_link#error-handling"
                  }
                ],
                "trace": "03391bce-b650-475a-96b8-e47e70d93e54"
              }
            • {
                "errors": [
                  {
                    "code": "not_found",
                    "message": "Cannot find Gateway",
                    "more_info": "https://cloud.ibm.com/apidocs/direct_link#error-handling"
                  }
                ],
                "trace": "03391bce-b650-475a-96b8-e47e70d93e54"
              }

            Approve or reject change requests

            Approve or reject a gateway's current oustanding change request.

            This API is only used for provider created Direct Link Connect gateways to approve or reject specific changes initiated from a provider portal.

            Approve or reject a gateway's current oustanding change request.

            This API is only used for provider created Direct Link Connect gateways to approve or reject specific changes initiated from a provider portal.

            Approve or reject a gateway's current oustanding change request.

            This API is only used for provider created Direct Link Connect gateways to approve or reject specific changes initiated from a provider portal.

            Approve or reject a gateway's current oustanding change request.

            This API is only used for provider created Direct Link Connect gateways to approve or reject specific changes initiated from a provider portal.

            Approve or reject a gateway's current oustanding change request.

            This API is only used for provider created Direct Link Connect gateways to approve or reject specific changes initiated from a provider portal.

            POST /gateways/{id}/actions
            ServiceCall<Gateway> createGatewayAction(CreateGatewayActionOptions createGatewayActionOptions)
            createGatewayAction(params)
            create_gateway_action(
                    self,
                    id: str,
                    *,
                    action: Optional[str] = None,
                    as_prepends: Optional[List['AsPrependTemplate']] = None,
                    authentication_key: Optional['AuthenticationKeyIdentity'] = None,
                    bfd_config: Optional['GatewayBfdConfigActionTemplate'] = None,
                    connection_mode: Optional[str] = None,
                    default_export_route_filter: Optional[str] = None,
                    default_import_route_filter: Optional[str] = None,
                    export_route_filters: Optional[List['GatewayTemplateRouteFilter']] = None,
                    global_: Optional[bool] = None,
                    import_route_filters: Optional[List['GatewayTemplateRouteFilter']] = None,
                    metered: Optional[bool] = None,
                    resource_group: Optional['ResourceGroupIdentity'] = None,
                    updates: Optional[List['GatewayActionTemplateUpdatesItem']] = None,
                    **kwargs,
                ) -> DetailedResponse
            (directLink *DirectLinkV1) CreateGatewayAction(createGatewayActionOptions *CreateGatewayActionOptions) (result *Gateway, response *core.DetailedResponse, err error)
            (directLink *DirectLinkV1) CreateGatewayActionWithContext(ctx context.Context, createGatewayActionOptions *CreateGatewayActionOptions) (result *Gateway, response *core.DetailedResponse, err error)

            Request

            Use the CreateGatewayActionOptions.Builder to create a CreateGatewayActionOptions object that contains the parameter values for the createGatewayAction method.

            Instantiate the CreateGatewayActionOptions struct and set the fields to provide parameter values for the CreateGatewayAction method.

            Path Parameters

            • Direct Link Connect gateway identifier

              Possible values: length = 36, Value must match regular expression ^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$

              Example: 0a06fb9b-820f-4c44-8a31-77f1f0806d28

            Query Parameters

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

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

            Approve or reject a pending change request. Only used for provider created gateways to approve or reject changes initiated from a providers portal.