IBM Cloud API Docs

Introduction

The IBM Cloud Transit Gateway API is a RESTful API that allows you to manage your Transit Gateway resources.

Familiarize yourself with Transit Gateway functionality described in About IBM Cloud Transit Gateway.

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

GitHub:

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

Maven:

<dependency>
    <groupId>com.ibm.cloud</groupId>
    <artifactId>transit-gateway-ap-is</artifactId>
    <version>X.X.X</version>
</dependency>

Gradle:

compile 'com.ibm.cloud:transit-gateway-ap-is:X.X.X'

GitHub:

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

Installation

npm install ibm-cloud-networking

GitHub:

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"

GitHub

Authentication

The IBM Cloud Transit Gateway 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 IAM token. For more information, see Retrieving an access token programmatically.

Authorization

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

API Endpoint

https://transit.cloud.ibm.com/v1

Use Virtual Private Endpoint (VPE) for VPC to access Transit Gateway via https://private.transit.cloud.ibm.com/v1.


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

authenticator := &core.IamAuthenticator{
          ApiKey: apikey,
       }
	version := "2021-12-30"
	options := &transitgatewayapisv1.TransitGatewayApisV1Options{
		Version:       &version,
		Authenticator: authenticator,
	}

transitGatewayService, transitGatewayServiceErr := transitgatewayapisv1.NewTransitGatewayApisV1(options)

transitGatewayService.SetServiceURL("{api_endpoint}")
TransitGatewayApis transitGatewayService = new TransitGatewayApis("2020-03-31", "{service_name}", authenticator);

transitGatewayService.setServiceUrl("{api_endpoint}");
const transitGatewayService = new TransitGatewayApisV1({
   version: '2020-03-31',
   authenticator: new IamAuthenticator({
    apikey: '{apikey}',
   }),
   serviceUrl: '{api_endpoint}',
});

from ibm_cloud_sdk_core.authenticators import IAMAuthenticator
from ibm_cloud_networking_services import TransitGatewayApisV1

authenticator = IAMAuthenticator(
            apikey={apikey}
)

transit_gateway_service = TransitGatewayApisV1(
    version='2020-03-31',
    authenticator=authenticator
)

transit_gateway_service.set_service_url('{api_endpoint}')

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/transit_gateways?version=2020-03-31

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.

Pagination

Some API requests can return many results. To improve performance, results are returned one page at a time, with a limited number of results on each page. The default page size is typically 50 items, with a maximum size of 100.

The default and maximum limits might vary by operation. To specify a different page size, use the limit query parameter.

For a request that uses pagination, the response includes additional properties:

  • The first.href property links to the first page of resources
  • The next.href property links to the next page of resources (included for all pages except for the last page)

Use query parameters to page through your available resources and retrieve a subset of objects. To retrieve the first page of results, make the request without specifying a start query parameter. If the results cannot fit on the first page, the response will include a next property, whose value can then be specified as the start parameter when making the next page request. Each page of results is based on the resources that exist at the time of each paginated request, and therefore may include resources that did not exist when the first request was made. The last page of results will not include a next property.

When you're retrieving a subset of objects:

  • You may use the value of first.href to retrieve the first page of resources in the requested sort order and with the requested filters
  • You may use the value of next.href to retrieve the next page of resources in the requested sort order and with the requested filters
  • You may not change the requested filters across page retrievals
  • You may not add a sort query parameter to the href value (sort order is set by the first paginated list request)
  • You may modify the limit in the href value to limit the number of resources to return, per page, in a paginated list operation
  • You may not change the path segments of the request (that is, anything before the ? in the href value)

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.

Error handling

The Transit Gateway 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 5xx type response indicates an internal system error.

This API uses standard HTTP response codes to indicate whether a method completed successfully. A 200 response indicates success. A 400 type response indicates a failure, and a 500 type response indicates an internal system error.

Table 1. HTTP error codes and descriptions
HTTP Error Code Description Recovery
200 Success The request was successful.
400 Bad Request The input parameters in the request body are either incomplete or in the wrong format. See the specific error message for more details. Be sure to include all required parameters in your request.
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. Check that you have the correct access credentials and permissions.
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.
408 Request Timeout The connection to the server timed out. Wait a few minutes, then try again.
409 Conflict The entity is already in the requested state, or resources are in an incorrect state. See the specific error message for more details.
500 Internal Server Error IBM Cloud Transit Gateway API is currently unavailable. Your request could not be processed. Wait a few minutes and try again.

Auditing

Monitor API activity within your account by using the IBM Cloud Activity Tracker service. Each time that you make an API call, an event is generated and saved to Activity Tracker. The specific event type is listed for each individual method. For more information, see Auditing events for account management.

Methods

Retrieves all Transit Gateways

List all Transit Gateways in account the caller is authorized to view.

List all Transit Gateways in account the caller is authorized to view.

List all Transit Gateways in account the caller is authorized to view.

List all Transit Gateways in account the caller is authorized to view.

List all Transit Gateways in account the caller is authorized to view.

GET /transit_gateways
ServiceCall<TransitGatewayCollection> listTransitGateways(ListTransitGatewaysOptions listTransitGatewaysOptions)
listTransitGateways(params)
list_transit_gateways(
        self,
        *,
        limit: Optional[int] = None,
        start: Optional[str] = None,
        **kwargs,
    ) -> DetailedResponse
(transitGatewayApis *TransitGatewayApisV1) ListTransitGateways(listTransitGatewaysOptions *ListTransitGatewaysOptions) (result *TransitGatewayCollection, response *core.DetailedResponse, err error)
(transitGatewayApis *TransitGatewayApisV1) ListTransitGatewaysWithContext(ctx context.Context, listTransitGatewaysOptions *ListTransitGatewaysOptions) (result *TransitGatewayCollection, response *core.DetailedResponse, err error)

Request

Use the ListTransitGatewaysOptions.Builder to create a ListTransitGatewaysOptions object that contains the parameter values for the listTransitGateways method.

Instantiate the ListTransitGatewaysOptions struct and set the fields to provide parameter values for the ListTransitGateways method.

Query Parameters

  • Requests the version of the API as of a date in the format YYYY-MM-DD. Any date 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 maximum number of resources to return per page

    Possible values: 1 ≤ value ≤ 50

    Default: 50

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

    Possible values: 0 ≤ length ≤ 500, Value must match regular expression ^([0-9a-zA-Z]{1,500})$

The listTransitGateways options.

parameters

  • The maximum number of resources to return per page.

    Possible values: 1 ≤ value ≤ 50

    Default: 50

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

    Possible values: 0 ≤ length ≤ 500, Value must match regular expression /^([0-9a-zA-Z]{1,500})$/

parameters

  • The maximum number of resources to return per page.

    Possible values: 1 ≤ value ≤ 50

    Default: 50

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

    Possible values: 0 ≤ length ≤ 500, Value must match regular expression /^([0-9a-zA-Z]{1,500})$/

WithContext method only

The ListTransitGateways options.

  • curl -X GET --location --header "Authorization: Bearer ${iam_token}"   --header "Accept: application/json"   "${base_url}/transit_gateways?version=${version}"
  • listTransitGatewaysOptions := &transitgatewayapisv1.ListTransitGatewaysOptions{
      Limit: core.Int64Ptr(int64(10)),
    }
    
    pager, err := transitGatewayApisService.NewTransitGatewaysPager(listTransitGatewaysOptions)
    if err != nil {
      panic(err)
    }
    
    var allResults []transitgatewayapisv1.TransitGateway
    for pager.HasNext() {
      nextPage, err := pager.GetNext()
      if err != nil {
        panic(err)
      }
      allResults = append(allResults, nextPage...)
    }
    b, _ := json.MarshalIndent(allResults, "", "  ")
    fmt.Println(string(b))
  • ListTransitGatewaysOptions listTransitGatewaysOptions = new ListTransitGatewaysOptions.Builder()
      .limit(Long.valueOf("10"))
      .build();
    
    TransitGatewaysPager pager = new TransitGatewaysPager(transitGatewayApisService, listTransitGatewaysOptions);
    List<TransitGateway> allResults = new ArrayList<>();
    while (pager.hasNext()) {
      List<TransitGateway> nextPage = pager.getNext();
      allResults.addAll(nextPage);
    }
    
    System.out.println(GsonSingleton.getGson().toJson(allResults));
  • const params = {
      limit: 10,
    };
    
    const allResults = [];
    try {
      const pager = new TransitGatewayApisV1.TransitGatewaysPager(transitGatewayApisService, params);
      while (pager.hasNext()) {
        const nextPage = await pager.getNext();
        expect(nextPage).not.toBeNull();
        allResults.push(...nextPage);
      }
      console.log(JSON.stringify(allResults, null, 2));
    } catch (err) {
      console.warn(err);
    }
  • all_results = []
    pager = TransitGatewaysPager(
      client=transit_gateway_apis_service,
      limit=10,
    )
    while pager.has_next():
      next_page = pager.get_next()
      assert next_page is not None
      all_results.extend(next_page)
    
    print(json.dumps(all_results, indent=2))

Response

A list of Transit Gateways

A list of Transit Gateways.

A list of Transit Gateways.

A list of Transit Gateways.

A list of Transit Gateways.

Status Code

  • The Transit Gateways were retrieved successfully.

Example responses
  • {
      "first": {
        "href": "https://transit.cloud.ibm.com/v1/transit_gateways?limit=50"
      },
      "limit": 50,
      "transit_gateways": [
        {
          "connection_needs_attention": false,
          "created_at": "2020-03-31T12:08:05Z",
          "crn": "crn:[...]",
          "global": true,
          "gre_enhanced_route_propagation": false,
          "id": "ef4dcb1a-fee4-41c7-9e11-9cd99e65c1f4",
          "location": "us-south",
          "name": "example-gateway",
          "resource_group": {
            "href": "https://resource-manager.bluemix.net/v1/resource_groups/56969d6043e9465c883cb9f7363e78e8",
            "id": "56969d6043e9465c883cb9f7363e78e8"
          },
          "status": "available",
          "updated_at": "2020-03-31T12:08:05Z"
        }
      ]
    }
  • {
      "first": {
        "href": "https://transit.cloud.ibm.com/v1/transit_gateways?limit=50"
      },
      "limit": 50,
      "transit_gateways": [
        {
          "connection_needs_attention": false,
          "created_at": "2020-03-31T12:08:05Z",
          "crn": "crn:[...]",
          "global": true,
          "gre_enhanced_route_propagation": false,
          "id": "ef4dcb1a-fee4-41c7-9e11-9cd99e65c1f4",
          "location": "us-south",
          "name": "example-gateway",
          "resource_group": {
            "href": "https://resource-manager.bluemix.net/v1/resource_groups/56969d6043e9465c883cb9f7363e78e8",
            "id": "56969d6043e9465c883cb9f7363e78e8"
          },
          "status": "available",
          "updated_at": "2020-03-31T12:08:05Z"
        }
      ]
    }

Creates a Transit Gateway

Create a Transit Gateway based on the supplied input template.

Create a Transit Gateway based on the supplied input template.

Create a Transit Gateway based on the supplied input template.

Create a Transit Gateway based on the supplied input template.

Create a Transit Gateway based on the supplied input template.

POST /transit_gateways
ServiceCall<TransitGateway> createTransitGateway(CreateTransitGatewayOptions createTransitGatewayOptions)
createTransitGateway(params)
create_transit_gateway(
        self,
        location: str,
        name: str,
        *,
        global_: Optional[bool] = None,
        gre_enhanced_route_propagation: Optional[bool] = None,
        resource_group: Optional['ResourceGroupIdentity'] = None,
        **kwargs,
    ) -> DetailedResponse
(transitGatewayApis *TransitGatewayApisV1) CreateTransitGateway(createTransitGatewayOptions *CreateTransitGatewayOptions) (result *TransitGateway, response *core.DetailedResponse, err error)
(transitGatewayApis *TransitGatewayApisV1) CreateTransitGatewayWithContext(ctx context.Context, createTransitGatewayOptions *CreateTransitGatewayOptions) (result *TransitGateway, response *core.DetailedResponse, err error)

Request

Use the CreateTransitGatewayOptions.Builder to create a CreateTransitGatewayOptions object that contains the parameter values for the createTransitGateway method.

Instantiate the CreateTransitGatewayOptions struct and set the fields to provide parameter values for the CreateTransitGateway method.

Query Parameters

  • Requests the version of the API as of a date in the format YYYY-MM-DD. Any date 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 Transit Gateway template

The createTransitGateway options.

parameters

  • Location of Transit Gateway Services.

    Possible values: 0 ≤ length ≤ 36, Value must match regular expression /^([a-z]|[a-z][-_a-z0-9]*[a-z0-9]+)$/

    Examples:
  • A human readable name for the transit 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:
  • Allow global routing for a Transit Gateway. If unspecified, the default value is false.

    Default: false

    Examples:
  • Allow route propagation across all GREs connected to the same transit gateway. This affects connections on the gateway of type redundant_gre, unbound_gre_tunnel and gre_tunnel.

    Default: false

    Examples:
  • The resource group to use. If unspecified, the account's default resource group is used.

parameters

  • Location of Transit Gateway Services.

    Possible values: 0 ≤ length ≤ 36, Value must match regular expression /^([a-z]|[a-z][-_a-z0-9]*[a-z0-9]+)$/

    Examples:
  • A human readable name for the transit 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:
  • Allow global routing for a Transit Gateway. If unspecified, the default value is false.

    Default: false

    Examples:
  • Allow route propagation across all GREs connected to the same transit gateway. This affects connections on the gateway of type redundant_gre, unbound_gre_tunnel and gre_tunnel.

    Default: false

    Examples:
  • The resource group to use. If unspecified, the account's default resource group is used.

WithContext method only

The CreateTransitGateway options.

  • curl -X POST --location --header "Authorization: Bearer ${iam_token}"   --header "Accept: application/json"   --header "Content-Type: application/json"   --data '{ "location": "us-south", "name": "my-transit-gateway-in-TransitGateway" }'   "${base_url}/transit_gateways?version=${version}"
  • createTransitGatewayOptions := transitGatewayApisService.NewCreateTransitGatewayOptions(
      "us-south",
      "my-transit-gateway-in-TransitGateway",
    )
    
    transitGateway, response, err := transitGatewayApisService.CreateTransitGateway(createTransitGatewayOptions)
    if err != nil {
      panic(err)
    }
    b, _ := json.MarshalIndent(transitGateway, "", "  ")
    fmt.Println(string(b))
  • CreateTransitGatewayOptions createTransitGatewayOptions = new CreateTransitGatewayOptions.Builder()
      .location("us-south")
      .name("my-transit-gateway-in-TransitGateway")
      .build();
    
    Response<TransitGateway> response = transitGatewayApisService.createTransitGateway(createTransitGatewayOptions).execute();
    TransitGateway transitGateway = response.getResult();
    
    System.out.println(transitGateway);
  • const params = {
      location: 'us-south',
      name: 'my-transit-gateway-in-TransitGateway',
    };
    
    let res;
    try {
      res = await transitGatewayApisService.createTransitGateway(params);
      console.log(JSON.stringify(res.result, null, 2));
    } catch (err) {
      console.warn(err);
    }
  • response = transit_gateway_apis_service.create_transit_gateway(
      location='us-south',
      name='my-transit-gateway-in-TransitGateway',
    )
    transit_gateway = response.get_result()
    
    print(json.dumps(transit_gateway, indent=2))

Response

Details of a Transit Gateway

Details of a Transit Gateway.

Details of a Transit Gateway.

Details of a Transit Gateway.

Details of a Transit Gateway.

Status Code

  • The Transit Gateway was created successfully.

  • An invalid Transit Gateway template was provided.

  • A Transit Gateway location could not be found for the identifier given in the template, a resource group could not be found for the given resource group identifier, or the default resource group could not be found for the account (if no resource group identifier was supplied).

  • The Transit Gateway could not be created as a transit gateway with the same name already exists.

Example responses
  • {
      "connection_needs_attention": false,
      "created_at": "2020-03-31T12:08:05Z",
      "crn": "crn:[...]",
      "global": true,
      "gre_enhanced_route_propagation": false,
      "id": "ef4dcb1a-fee4-41c7-9e11-9cd99e65c1f4",
      "location": "us-south",
      "name": "example-gateway",
      "resource_group": {
        "href": "https://resource-manager.bluemix.net/v1/resource_groups/56969d6043e9465c883cb9f7363e78e8",
        "id": "56969d6043e9465c883cb9f7363e78e8"
      },
      "status": "pending",
      "updated_at": "2020-03-31T12:08:05Z"
    }
  • {
      "connection_needs_attention": false,
      "created_at": "2020-03-31T12:08:05Z",
      "crn": "crn:[...]",
      "global": true,
      "gre_enhanced_route_propagation": false,
      "id": "ef4dcb1a-fee4-41c7-9e11-9cd99e65c1f4",
      "location": "us-south",
      "name": "example-gateway",
      "resource_group": {
        "href": "https://resource-manager.bluemix.net/v1/resource_groups/56969d6043e9465c883cb9f7363e78e8",
        "id": "56969d6043e9465c883cb9f7363e78e8"
      },
      "status": "pending",
      "updated_at": "2020-03-31T12:08:05Z"
    }
  • {
      "errors": [
        {
          "code": "validation_required_field_missing",
          "message": "Mandatory field is missing.",
          "more_info": "https://cloud.ibm.com/apidocs/transit-gateway#error-handling",
          "target": {
            "name": "name",
            "type": "field"
          }
        }
      ],
      "trace": "86780a34-e651-4b47-9fb0-184a169cc9af"
    }
  • {
      "errors": [
        {
          "code": "validation_required_field_missing",
          "message": "Mandatory field is missing.",
          "more_info": "https://cloud.ibm.com/apidocs/transit-gateway#error-handling",
          "target": {
            "name": "name",
            "type": "field"
          }
        }
      ],
      "trace": "86780a34-e651-4b47-9fb0-184a169cc9af"
    }
  • {
      "errors": [
        {
          "code": "not_found",
          "message": "Location not found.",
          "more_info": "https://cloud.ibm.com/apidocs/transit-gateway#error-handling"
        }
      ],
      "trace": "86780a34-e651-4b47-9fb0-184a169cc9af"
    }
  • {
      "errors": [
        {
          "code": "not_found",
          "message": "Location not found.",
          "more_info": "https://cloud.ibm.com/apidocs/transit-gateway#error-handling"
        }
      ],
      "trace": "86780a34-e651-4b47-9fb0-184a169cc9af"
    }
  • {
      "errors": [
        {
          "code": "invalid_state",
          "message": "A gateway with the same name already exists",
          "more_info": "https://cloud.ibm.com/apidocs/transit-gateway#error-handling"
        }
      ],
      "trace": "86780a34-e651-4b47-9fb0-184a169cc9af"
    }
  • {
      "errors": [
        {
          "code": "invalid_state",
          "message": "A gateway with the same name already exists",
          "more_info": "https://cloud.ibm.com/apidocs/transit-gateway#error-handling"
        }
      ],
      "trace": "86780a34-e651-4b47-9fb0-184a169cc9af"
    }

Deletes specified Transit Gateway

This request deletes a Transit Gateway. This operation cannot be reversed. For this request to succeed, the Transit Gateway must not contain connections.

This request deletes a Transit Gateway. This operation cannot be reversed. For this request to succeed, the Transit Gateway must not contain connections.

This request deletes a Transit Gateway. This operation cannot be reversed. For this request to succeed, the Transit Gateway must not contain connections.

This request deletes a Transit Gateway. This operation cannot be reversed. For this request to succeed, the Transit Gateway must not contain connections.

This request deletes a Transit Gateway. This operation cannot be reversed. For this request to succeed, the Transit Gateway must not contain connections.

DELETE /transit_gateways/{id}
ServiceCall<Void> deleteTransitGateway(DeleteTransitGatewayOptions deleteTransitGatewayOptions)
deleteTransitGateway(params)
delete_transit_gateway(
        self,
        id: str,
        **kwargs,
    ) -> DetailedResponse
(transitGatewayApis *TransitGatewayApisV1) DeleteTransitGateway(deleteTransitGatewayOptions *DeleteTransitGatewayOptions) (response *core.DetailedResponse, err error)
(transitGatewayApis *TransitGatewayApisV1) DeleteTransitGatewayWithContext(ctx context.Context, deleteTransitGatewayOptions *DeleteTransitGatewayOptions) (response *core.DetailedResponse, err error)

Request

Use the DeleteTransitGatewayOptions.Builder to create a DeleteTransitGatewayOptions object that contains the parameter values for the deleteTransitGateway method.

Instantiate the DeleteTransitGatewayOptions struct and set the fields to provide parameter values for the DeleteTransitGateway method.

Path Parameters

  • The Transit Gateway identifier

    Possible values: 0 ≤ 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}$

Query Parameters

  • Requests the version of the API as of a date in the format YYYY-MM-DD. Any date 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 deleteTransitGateway options.

parameters

  • The Transit Gateway identifier.

    Possible values: 0 ≤ 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}$/

parameters

  • The Transit Gateway identifier.

    Possible values: 0 ≤ 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}$/

WithContext method only

The DeleteTransitGateway options.

  • curl -X DELETE --location --header "Authorization: Bearer ${iam_token}"   "${base_url}/transit_gateways/${id}?version=${version}"
  • deleteTransitGatewayOptions := transitGatewayApisService.NewDeleteTransitGatewayOptions(
      "testString",
    )
    
    response, err := transitGatewayApisService.DeleteTransitGateway(deleteTransitGatewayOptions)
    if err != nil {
      panic(err)
    }
    if response.StatusCode != 204 {
      fmt.Printf("\nUnexpected response status code received from DeleteTransitGateway(): %d\n", response.StatusCode)
    }
  • DeleteTransitGatewayOptions deleteTransitGatewayOptions = new DeleteTransitGatewayOptions.Builder()
      .id("testString")
      .build();
    
    Response<Void> response = transitGatewayApisService.deleteTransitGateway(deleteTransitGatewayOptions).execute();
  • const params = {
      id: 'testString',
    };
    
    try {
      await transitGatewayApisService.deleteTransitGateway(params);
    } catch (err) {
      console.warn(err);
    }
  • response = transit_gateway_apis_service.delete_transit_gateway(
      id='testString',
    )

Response

Status Code

  • The Transit Gateway was deleted successfully.

  • A Transit Gateway with the specified identifier could not be found.

  • The Transit Gateway could not be deleted as there are pre-existing connections attached.

Example responses
  • {
      "errors": [
        {
          "code": "not_found",
          "message": "Cannot find Gateway",
          "more_info": "https://cloud.ibm.com/apidocs/transit-gateway#error-handling"
        }
      ],
      "trace": "86780a34-e651-4b47-9fb0-184a169cc9af"
    }
  • {
      "errors": [
        {
          "code": "not_found",
          "message": "Cannot find Gateway",
          "more_info": "https://cloud.ibm.com/apidocs/transit-gateway#error-handling"
        }
      ],
      "trace": "86780a34-e651-4b47-9fb0-184a169cc9af"
    }
  • {
      "errors": [
        {
          "code": "invalid_state",
          "message": "The gateway could not be deleted as there are connections attached to it. Delete all connections attached to this gateway and retry.",
          "more_info": "https://cloud.ibm.com/apidocs/transit-gateway#error-handling"
        }
      ],
      "trace": "86780a34-e651-4b47-9fb0-184a169cc9af"
    }
  • {
      "errors": [
        {
          "code": "invalid_state",
          "message": "The gateway could not be deleted as there are connections attached to it. Delete all connections attached to this gateway and retry.",
          "more_info": "https://cloud.ibm.com/apidocs/transit-gateway#error-handling"
        }
      ],
      "trace": "86780a34-e651-4b47-9fb0-184a169cc9af"
    }

Retrieves specified Transit Gateway

This request retrieves a single Transit Gateway specified by the identifier in the URL.

This request retrieves a single Transit Gateway specified by the identifier in the URL.

This request retrieves a single Transit Gateway specified by the identifier in the URL.

This request retrieves a single Transit Gateway specified by the identifier in the URL.

This request retrieves a single Transit Gateway specified by the identifier in the URL.

GET /transit_gateways/{id}
ServiceCall<TransitGateway> getTransitGateway(GetTransitGatewayOptions getTransitGatewayOptions)
getTransitGateway(params)
get_transit_gateway(
        self,
        id: str,
        **kwargs,
    ) -> DetailedResponse
(transitGatewayApis *TransitGatewayApisV1) GetTransitGateway(getTransitGatewayOptions *GetTransitGatewayOptions) (result *TransitGateway, response *core.DetailedResponse, err error)
(transitGatewayApis *TransitGatewayApisV1) GetTransitGatewayWithContext(ctx context.Context, getTransitGatewayOptions *GetTransitGatewayOptions) (result *TransitGateway, response *core.DetailedResponse, err error)

Request

Use the GetTransitGatewayOptions.Builder to create a GetTransitGatewayOptions object that contains the parameter values for the getTransitGateway method.

Instantiate the GetTransitGatewayOptions struct and set the fields to provide parameter values for the GetTransitGateway method.

Path Parameters

  • The Transit Gateway identifier

    Possible values: 0 ≤ 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}$

Query Parameters

  • Requests the version of the API as of a date in the format YYYY-MM-DD. Any date 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 getTransitGateway options.

parameters

  • The Transit Gateway identifier.

    Possible values: 0 ≤ 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}$/

parameters

  • The Transit Gateway identifier.

    Possible values: 0 ≤ 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}$/

WithContext method only

The GetTransitGateway options.

  • curl -X GET --location --header "Authorization: Bearer ${iam_token}"   --header "Accept: application/json"   "${base_url}/transit_gateways/${id}?version=${version}"
  • getTransitGatewayOptions := transitGatewayApisService.NewGetTransitGatewayOptions(
      "testString",
    )
    
    transitGateway, response, err := transitGatewayApisService.GetTransitGateway(getTransitGatewayOptions)
    if err != nil {
      panic(err)
    }
    b, _ := json.MarshalIndent(transitGateway, "", "  ")
    fmt.Println(string(b))
  • GetTransitGatewayOptions getTransitGatewayOptions = new GetTransitGatewayOptions.Builder()
      .id("testString")
      .build();
    
    Response<TransitGateway> response = transitGatewayApisService.getTransitGateway(getTransitGatewayOptions).execute();
    TransitGateway transitGateway = response.getResult();
    
    System.out.println(transitGateway);
  • const params = {
      id: 'testString',
    };
    
    let res;
    try {
      res = await transitGatewayApisService.getTransitGateway(params);
      console.log(JSON.stringify(res.result, null, 2));
    } catch (err) {
      console.warn(err);
    }
  • response = transit_gateway_apis_service.get_transit_gateway(
      id='testString',
    )
    transit_gateway = response.get_result()
    
    print(json.dumps(transit_gateway, indent=2))

Response

Details of a Transit Gateway

Details of a Transit Gateway.

Details of a Transit Gateway.

Details of a Transit Gateway.

Details of a Transit Gateway.

Status Code

  • The Transit Gateway was retrieved successfully.

  • A Transit Gateway with the specified identifier could not be found.

Example responses
  • {
      "connection_needs_attention": false,
      "created_at": "2020-03-31T12:08:05Z",
      "crn": "crn:[...]",
      "global": true,
      "gre_enhanced_route_propagation": false,
      "id": "ef4dcb1a-fee4-41c7-9e11-9cd99e65c1f4",
      "location": "us-south",
      "name": "example-gateway",
      "resource_group": {
        "href": "https://resource-manager.bluemix.net/v1/resource_groups/56969d6043e9465c883cb9f7363e78e8",
        "id": "56969d6043e9465c883cb9f7363e78e8"
      },
      "status": "available",
      "updated_at": "2020-03-31T12:08:05Z"
    }
  • {
      "connection_needs_attention": false,
      "created_at": "2020-03-31T12:08:05Z",
      "crn": "crn:[...]",
      "global": true,
      "gre_enhanced_route_propagation": false,
      "id": "ef4dcb1a-fee4-41c7-9e11-9cd99e65c1f4",
      "location": "us-south",
      "name": "example-gateway",
      "resource_group": {
        "href": "https://resource-manager.bluemix.net/v1/resource_groups/56969d6043e9465c883cb9f7363e78e8",
        "id": "56969d6043e9465c883cb9f7363e78e8"
      },
      "status": "available",
      "updated_at": "2020-03-31T12:08:05Z"
    }
  • {
      "errors": [
        {
          "code": "not_found",
          "message": "Cannot find Gateway",
          "more_info": "https://cloud.ibm.com/apidocs/transit-gateway#error-handling"
        }
      ],
      "trace": "86780a34-e651-4b47-9fb0-184a169cc9af"
    }
  • {
      "errors": [
        {
          "code": "not_found",
          "message": "Cannot find Gateway",
          "more_info": "https://cloud.ibm.com/apidocs/transit-gateway#error-handling"
        }
      ],
      "trace": "86780a34-e651-4b47-9fb0-184a169cc9af"
    }

Updates specified Transit Gateway

This request updates a Transit Gateway's name and/or global flag.

This request updates a Transit Gateway's name and/or global flag.

This request updates a Transit Gateway's name and/or global flag.

This request updates a Transit Gateway's name and/or global flag.

This request updates a Transit Gateway's name and/or global flag.

PATCH /transit_gateways/{id}
ServiceCall<TransitGateway> updateTransitGateway(UpdateTransitGatewayOptions updateTransitGatewayOptions)
updateTransitGateway(params)
update_transit_gateway(
        self,
        id: str,
        *,
        global_: Optional[bool] = None,
        gre_enhanced_route_propagation: Optional[bool] = None,
        name: Optional[str] = None,
        **kwargs,
    ) -> DetailedResponse
(transitGatewayApis *TransitGatewayApisV1) UpdateTransitGateway(updateTransitGatewayOptions *UpdateTransitGatewayOptions) (result *TransitGateway, response *core.DetailedResponse, err error)
(transitGatewayApis *TransitGatewayApisV1) UpdateTransitGatewayWithContext(ctx context.Context, updateTransitGatewayOptions *UpdateTransitGatewayOptions) (result *TransitGateway, response *core.DetailedResponse, err error)

Request

Use the UpdateTransitGatewayOptions.Builder to create a UpdateTransitGatewayOptions object that contains the parameter values for the updateTransitGateway method.

Instantiate the UpdateTransitGatewayOptions struct and set the fields to provide parameter values for the UpdateTransitGateway method.

Path Parameters

  • The Transit Gateway identifier

    Possible values: 0 ≤ 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}$

Query Parameters

  • Requests the version of the API as of a date in the format YYYY-MM-DD. Any date 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}$

Update a Transit Gateway

The updateTransitGateway options.

parameters

  • The Transit Gateway identifier.

    Possible values: 0 ≤ 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}$/

  • Allow global routing for a Transit Gateway.

    Examples:
  • Allow route propagation across all GREs connected to the same transit gateway. This affects connections on the gateway of type redundant_gre, unbound_gre_tunnel and gre_tunnel. It takes a few minutes for the change to take effect.

    Examples:
  • A human readable name for a resource.

    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:

parameters

  • The Transit Gateway identifier.

    Possible values: 0 ≤ 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}$/

  • Allow global routing for a Transit Gateway.

    Examples:
  • Allow route propagation across all GREs connected to the same transit gateway. This affects connections on the gateway of type redundant_gre, unbound_gre_tunnel and gre_tunnel. It takes a few minutes for the change to take effect.

    Examples:
  • A human readable name for a resource.

    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:

WithContext method only

The UpdateTransitGateway options.

  • curl -X PATCH --location --header "Authorization: Bearer ${iam_token}"   --header "Accept: application/json"   --header "Content-Type: application/json"   --data '{}'   "${base_url}/transit_gateways/${id}?version=${version}"
  • updateTransitGatewayOptions := transitGatewayApisService.NewUpdateTransitGatewayOptions(
      "testString",
    )
    
    transitGateway, response, err := transitGatewayApisService.UpdateTransitGateway(updateTransitGatewayOptions)
    if err != nil {
      panic(err)
    }
    b, _ := json.MarshalIndent(transitGateway, "", "  ")
    fmt.Println(string(b))
  • UpdateTransitGatewayOptions updateTransitGatewayOptions = new UpdateTransitGatewayOptions.Builder()
      .id("testString")
      .build();
    
    Response<TransitGateway> response = transitGatewayApisService.updateTransitGateway(updateTransitGatewayOptions).execute();
    TransitGateway transitGateway = response.getResult();
    
    System.out.println(transitGateway);
  • const params = {
      id: 'testString',
    };
    
    let res;
    try {
      res = await transitGatewayApisService.updateTransitGateway(params);
      console.log(JSON.stringify(res.result, null, 2));
    } catch (err) {
      console.warn(err);
    }
  • response = transit_gateway_apis_service.update_transit_gateway(
      id='testString',
    )
    transit_gateway = response.get_result()
    
    print(json.dumps(transit_gateway, indent=2))

Response

Details of a Transit Gateway

Details of a Transit Gateway.

Details of a Transit Gateway.

Details of a Transit Gateway.

Details of a Transit Gateway.

Status Code

  • The Transit Gateway was updated successfully.

  • The supplied Transit Gateway patch was invalid.

  • A Transit Gateway with the specified identifier could not be found.

  • The Transit Gateway could not be updated as there are pre-existing cross-region connections attached.

Example responses
  • {
      "connection_needs_attention": false,
      "created_at": "2020-03-31T12:08:05Z",
      "crn": "crn:[...]",
      "global": false,
      "gre_enhanced_route_propagation": false,
      "id": "ef4dcb1a-fee4-41c7-9e11-9cd99e65c1f4",
      "location": "us-south",
      "name": "example-gateway-new-name",
      "resource_group": {
        "href": "https://resource-manager.bluemix.net/v1/resource_groups/56969d6043e9465c883cb9f7363e78e8",
        "id": "56969d6043e9465c883cb9f7363e78e8"
      },
      "status": "available",
      "updated_at": "2020-03-31T12:08:05Z"
    }
  • {
      "connection_needs_attention": false,
      "created_at": "2020-03-31T12:08:05Z",
      "crn": "crn:[...]",
      "global": false,
      "gre_enhanced_route_propagation": false,
      "id": "ef4dcb1a-fee4-41c7-9e11-9cd99e65c1f4",
      "location": "us-south",
      "name": "example-gateway-new-name",
      "resource_group": {
        "href": "https://resource-manager.bluemix.net/v1/resource_groups/56969d6043e9465c883cb9f7363e78e8",
        "id": "56969d6043e9465c883cb9f7363e78e8"
      },
      "status": "available",
      "updated_at": "2020-03-31T12:08:05Z"
    }
  • {
      "errors": [
        {
          "code": "bad_request",
          "message": "The information given was invalid, malformed, or missing a required field.",
          "more_info": "https://cloud.ibm.com/apidocs/transit-gateway#error-handling",
          "target": {
            "name": "request_body",
            "type": "field"
          }
        }
      ],
      "trace": "86780a34-e651-4b47-9fb0-184a169cc9af"
    }
  • {
      "errors": [
        {
          "code": "bad_request",
          "message": "The information given was invalid, malformed, or missing a required field.",
          "more_info": "https://cloud.ibm.com/apidocs/transit-gateway#error-handling",
          "target": {
            "name": "request_body",
            "type": "field"
          }
        }
      ],
      "trace": "86780a34-e651-4b47-9fb0-184a169cc9af"
    }
  • {
      "errors": [
        {
          "code": "not_found",
          "message": "Cannot find Gateway",
          "more_info": "https://cloud.ibm.com/apidocs/transit-gateway#error-handling"
        }
      ],
      "trace": "86780a34-e651-4b47-9fb0-184a169cc9af"
    }
  • {
      "errors": [
        {
          "code": "not_found",
          "message": "Cannot find Gateway",
          "more_info": "https://cloud.ibm.com/apidocs/transit-gateway#error-handling"
        }
      ],
      "trace": "86780a34-e651-4b47-9fb0-184a169cc9af"
    }
  • {
      "errors": [
        {
          "code": "invalid_state",
          "message": "all non-local connections need to be deleted before the gateway's routing can be updated to local",
          "more_info": "https://cloud.ibm.com/apidocs/transit-gateway#error-handling"
        }
      ],
      "trace": "86780a34-e651-4b47-9fb0-184a169cc9af"
    }
  • {
      "errors": [
        {
          "code": "invalid_state",
          "message": "all non-local connections need to be deleted before the gateway's routing can be updated to local",
          "more_info": "https://cloud.ibm.com/apidocs/transit-gateway#error-handling"
        }
      ],
      "trace": "86780a34-e651-4b47-9fb0-184a169cc9af"
    }

Retrieves all connections

List all transit gateway connections associated with this account.

List all transit gateway connections associated with this account.

List all transit gateway connections associated with this account.

List all transit gateway connections associated with this account.

List all transit gateway connections associated with this account.

GET /connections
ServiceCall<TransitConnectionCollection> listConnections(ListConnectionsOptions listConnectionsOptions)
listConnections(params)
list_connections(
        self,
        *,
        limit: Optional[int] = None,
        start: Optional[str] = None,
        network_id: Optional[str] = None,
        network_type: Optional[str] = None,
        **kwargs,
    ) -> DetailedResponse
(transitGatewayApis *TransitGatewayApisV1) ListConnections(listConnectionsOptions *ListConnectionsOptions) (result *TransitConnectionCollection, response *core.DetailedResponse, err error)
(transitGatewayApis *TransitGatewayApisV1) ListConnectionsWithContext(ctx context.Context, listConnectionsOptions *ListConnectionsOptions) (result *TransitConnectionCollection, response *core.DetailedResponse, err error)

Request

Use the ListConnectionsOptions.Builder to create a ListConnectionsOptions object that contains the parameter values for the listConnections method.

Instantiate the ListConnectionsOptions struct and set the fields to provide parameter values for the ListConnections method.

Query Parameters

  • Requests the version of the API as of a date in the format YYYY-MM-DD. Any date 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 maximum number of resources to return per page

    Possible values: 1 ≤ value ≤ 100

    Default: 50

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

    Possible values: 0 ≤ length ≤ 500, Value must match regular expression ^([0-9a-zA-Z]){0,500}$

  • Search for connections with the given network_id value

    Possible values: 0 ≤ length ≤ 220, Value must match regular expression .

  • Search for connections with the given network_type value

    Possible values: 0 ≤ length ≤ 20, Value must match regular expression .

The listConnections options.

parameters

  • The maximum number of resources to return per page.

    Possible values: 1 ≤ value ≤ 100

    Default: 50

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

    Possible values: 0 ≤ length ≤ 500, Value must match regular expression /^([0-9a-zA-Z]){0,500}$/

  • Search for connections with the given network_id value.

    Possible values: 0 ≤ length ≤ 220, Value must match regular expression /./

  • Search for connections with the given network_type value.

    Possible values: 0 ≤ length ≤ 20, Value must match regular expression /./

parameters

  • The maximum number of resources to return per page.

    Possible values: 1 ≤ value ≤ 100

    Default: 50

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

    Possible values: 0 ≤ length ≤ 500, Value must match regular expression /^([0-9a-zA-Z]){0,500}$/

  • Search for connections with the given network_id value.

    Possible values: 0 ≤ length ≤ 220, Value must match regular expression /./

  • Search for connections with the given network_type value.

    Possible values: 0 ≤ length ≤ 20, Value must match regular expression /./

WithContext method only

The ListConnections options.

  • curl -X GET --location --header "Authorization: Bearer ${iam_token}"   --header "Accept: application/json"   "${base_url}/connections?version=${version}"
  • listConnectionsOptions := &transitgatewayapisv1.ListConnectionsOptions{
      Limit: core.Int64Ptr(int64(10)),
      NetworkID: core.StringPtr("testString"),
      NetworkType: core.StringPtr("testString"),
    }
    
    pager, err := transitGatewayApisService.NewConnectionsPager(listConnectionsOptions)
    if err != nil {
      panic(err)
    }
    
    var allResults []transitgatewayapisv1.TransitConnection
    for pager.HasNext() {
      nextPage, err := pager.GetNext()
      if err != nil {
        panic(err)
      }
      allResults = append(allResults, nextPage...)
    }
    b, _ := json.MarshalIndent(allResults, "", "  ")
    fmt.Println(string(b))
  • ListConnectionsOptions listConnectionsOptions = new ListConnectionsOptions.Builder()
      .limit(Long.valueOf("10"))
      .networkId("testString")
      .networkType("testString")
      .build();
    
    ConnectionsPager pager = new ConnectionsPager(transitGatewayApisService, listConnectionsOptions);
    List<TransitConnection> allResults = new ArrayList<>();
    while (pager.hasNext()) {
      List<TransitConnection> nextPage = pager.getNext();
      allResults.addAll(nextPage);
    }
    
    System.out.println(GsonSingleton.getGson().toJson(allResults));
  • const params = {
      limit: 10,
      networkId: 'testString',
      networkType: 'testString',
    };
    
    const allResults = [];
    try {
      const pager = new TransitGatewayApisV1.ConnectionsPager(transitGatewayApisService, params);
      while (pager.hasNext()) {
        const nextPage = await pager.getNext();
        expect(nextPage).not.toBeNull();
        allResults.push(...nextPage);
      }
      console.log(JSON.stringify(allResults, null, 2));
    } catch (err) {
      console.warn(err);
    }
  • all_results = []
    pager = ConnectionsPager(
      client=transit_gateway_apis_service,
      limit=10,
      network_id='testString',
      network_type='testString',
    )
    while pager.has_next():
      next_page = pager.get_next()
      assert next_page is not None
      all_results.extend(next_page)
    
    print(json.dumps(all_results, indent=2))

Response

Transit gateway connections

Transit gateway connections.

Transit gateway connections.

Transit gateway connections.

Transit gateway connections.

Status Code

  • The connections were retrieved successfully.

Example responses
  • {
      "connections": [
        {
          "created_at": "2020-03-31T12:08:05Z",
          "id": "1a15dca5-7e33-45e1-b7c5-bc690e569531",
          "name": "example-connection",
          "network_id": "crn:[...]",
          "network_type": "vpc",
          "prefix_filters_default": "permit",
          "request_status": "approved",
          "status": "attached",
          "transit_gateway": [
            {
              "crn": "crn:[...]",
              "id": "456f58c1-afe7-123a-0a0a-7f3d720f1a44",
              "name": "my-transit-gw100"
            }
          ],
          "updated_at": "2020-03-31T12:08:05Z"
        }
      ],
      "first": {
        "href": "https://transit.cloud.ibm.com/v1/connections?limit=50"
      },
      "limit": 50,
      "total_count": 100
    }
  • {
      "connections": [
        {
          "created_at": "2020-03-31T12:08:05Z",
          "id": "1a15dca5-7e33-45e1-b7c5-bc690e569531",
          "name": "example-connection",
          "network_id": "crn:[...]",
          "network_type": "vpc",
          "prefix_filters_default": "permit",
          "request_status": "approved",
          "status": "attached",
          "transit_gateway": [
            {
              "crn": "crn:[...]",
              "id": "456f58c1-afe7-123a-0a0a-7f3d720f1a44",
              "name": "my-transit-gw100"
            }
          ],
          "updated_at": "2020-03-31T12:08:05Z"
        }
      ],
      "first": {
        "href": "https://transit.cloud.ibm.com/v1/connections?limit=50"
      },
      "limit": 50,
      "total_count": 100
    }

Retrieves all connections in a Transit Gateway

This request retrieves all connections in a Transit Gateway.

This request retrieves all connections in a Transit Gateway.

This request retrieves all connections in a Transit Gateway.

This request retrieves all connections in a Transit Gateway.

This request retrieves all connections in a Transit Gateway.

GET /transit_gateways/{transit_gateway_id}/connections
ServiceCall<TransitGatewayConnectionCollection> listTransitGatewayConnections(ListTransitGatewayConnectionsOptions listTransitGatewayConnectionsOptions)
listTransitGatewayConnections(params)
list_transit_gateway_connections(
        self,
        transit_gateway_id: str,
        *,
        start: Optional[str] = None,
        limit: Optional[int] = None,
        name: Optional[str] = None,
        **kwargs,
    ) -> DetailedResponse
(transitGatewayApis *TransitGatewayApisV1) ListTransitGatewayConnections(listTransitGatewayConnectionsOptions *ListTransitGatewayConnectionsOptions) (result *TransitGatewayConnectionCollection, response *core.DetailedResponse, err error)
(transitGatewayApis *TransitGatewayApisV1) ListTransitGatewayConnectionsWithContext(ctx context.Context, listTransitGatewayConnectionsOptions *ListTransitGatewayConnectionsOptions) (result *TransitGatewayConnectionCollection, response *core.DetailedResponse, err error)

Request

Use the ListTransitGatewayConnectionsOptions.Builder to create a ListTransitGatewayConnectionsOptions object that contains the parameter values for the listTransitGatewayConnections method.

Instantiate the ListTransitGatewayConnectionsOptions struct and set the fields to provide parameter values for the ListTransitGatewayConnections method.

Path Parameters

  • The Transit Gateway identifier

    Possible values: 0 ≤ 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}$

Query Parameters

  • Requests the version of the API as of a date in the format YYYY-MM-DD. Any date 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}$

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

    Possible values: 0 ≤ length ≤ 500, Value must match regular expression ^([0-9a-zA-Z]){0,500}$

  • The maximum number of resources to return per page

    Possible values: 1 ≤ value ≤ 50

    Default: 50

  • Search for connections with the given name

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

The listTransitGatewayConnections options.

parameters

  • The Transit Gateway identifier.

    Possible values: 0 ≤ 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}$/

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

    Possible values: 0 ≤ length ≤ 500, Value must match regular expression /^([0-9a-zA-Z]){0,500}$/

  • The maximum number of resources to return per page.

    Possible values: 1 ≤ value ≤ 50

    Default: 50

  • Search for connections with the given name.

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

parameters

  • The Transit Gateway identifier.

    Possible values: 0 ≤ 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}$/

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

    Possible values: 0 ≤ length ≤ 500, Value must match regular expression /^([0-9a-zA-Z]){0,500}$/

  • The maximum number of resources to return per page.

    Possible values: 1 ≤ value ≤ 50

    Default: 50

  • Search for connections with the given name.

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

WithContext method only

The ListTransitGatewayConnections options.

  • curl -X GET --location --header "Authorization: Bearer ${iam_token}"   --header "Accept: application/json"   "${base_url}/transit_gateways/${transit_gateway_id}/connections?version=${version}"
  • listTransitGatewayConnectionsOptions := &transitgatewayapisv1.ListTransitGatewayConnectionsOptions{
      TransitGatewayID: core.StringPtr("testString"),
      Limit: core.Int64Ptr(int64(10)),
      Name: core.StringPtr("testString"),
    }
    
    pager, err := transitGatewayApisService.NewTransitGatewayConnectionsPager(listTransitGatewayConnectionsOptions)
    if err != nil {
      panic(err)
    }
    
    var allResults []transitgatewayapisv1.TransitGatewayConnectionCust
    for pager.HasNext() {
      nextPage, err := pager.GetNext()
      if err != nil {
        panic(err)
      }
      allResults = append(allResults, nextPage...)
    }
    b, _ := json.MarshalIndent(allResults, "", "  ")
    fmt.Println(string(b))
  • ListTransitGatewayConnectionsOptions listTransitGatewayConnectionsOptions = new ListTransitGatewayConnectionsOptions.Builder()
      .transitGatewayId("testString")
      .limit(Long.valueOf("10"))
      .name("testString")
      .build();
    
    TransitGatewayConnectionsPager pager = new TransitGatewayConnectionsPager(transitGatewayApisService, listTransitGatewayConnectionsOptions);
    List<TransitGatewayConnectionCust> allResults = new ArrayList<>();
    while (pager.hasNext()) {
      List<TransitGatewayConnectionCust> nextPage = pager.getNext();
      allResults.addAll(nextPage);
    }
    
    System.out.println(GsonSingleton.getGson().toJson(allResults));
  • const params = {
      transitGatewayId: 'testString',
      limit: 10,
      name: 'testString',
    };
    
    const allResults = [];
    try {
      const pager = new TransitGatewayApisV1.TransitGatewayConnectionsPager(transitGatewayApisService, params);
      while (pager.hasNext()) {
        const nextPage = await pager.getNext();
        expect(nextPage).not.toBeNull();
        allResults.push(...nextPage);
      }
      console.log(JSON.stringify(allResults, null, 2));
    } catch (err) {
      console.warn(err);
    }
  • all_results = []
    pager = TransitGatewayConnectionsPager(
      client=transit_gateway_apis_service,
      transit_gateway_id='testString',
      limit=10,
      name='testString',
    )
    while pager.has_next():
      next_page = pager.get_next()
      assert next_page is not None
      all_results.extend(next_page)
    
    print(json.dumps(all_results, indent=2))

Response

A set of Transit Gateway network connections

A set of Transit Gateway network connections.

A set of Transit Gateway network connections.

A set of Transit Gateway network connections.

A set of Transit Gateway network connections.

Status Code

  • The connections were retrieved successfully.

  • The specified Transit Gateway could not be found.

Example responses
  • {
      "connections": [
        {
          "created_at": "2020-03-31T12:08:05Z",
          "id": "1a15dca5-7e33-45e1-b7c5-bc690e569531",
          "name": "example-connection",
          "network_id": "crn:[...]",
          "network_type": "vpc",
          "prefix_filters_default": "permit",
          "request_status": "approved",
          "status": "attached",
          "updated_at": "2020-03-31T12:08:05Z"
        }
      ],
      "first": {
        "href": "https://transit.cloud.ibm.com/v1/tansit_gateways/86780a34-e651-4b47-9fb0-184a169cc9af/connections?limit=50"
      },
      "limit": 50,
      "total_count": 100
    }
  • {
      "connections": [
        {
          "created_at": "2020-03-31T12:08:05Z",
          "id": "1a15dca5-7e33-45e1-b7c5-bc690e569531",
          "name": "example-connection",
          "network_id": "crn:[...]",
          "network_type": "vpc",
          "prefix_filters_default": "permit",
          "request_status": "approved",
          "status": "attached",
          "updated_at": "2020-03-31T12:08:05Z"
        }
      ],
      "first": {
        "href": "https://transit.cloud.ibm.com/v1/tansit_gateways/86780a34-e651-4b47-9fb0-184a169cc9af/connections?limit=50"
      },
      "limit": 50,
      "total_count": 100
    }
  • {
      "errors": [
        {
          "code": "not_found",
          "message": "Cannot find Gateway",
          "more_info": "https://cloud.ibm.com/apidocs/transit-gateway#error-handling"
        }
      ],
      "trace": "86780a34-e651-4b47-9fb0-184a169cc9af"
    }
  • {
      "errors": [
        {
          "code": "not_found",
          "message": "Cannot find Gateway",
          "more_info": "https://cloud.ibm.com/apidocs/transit-gateway#error-handling"
        }
      ],
      "trace": "86780a34-e651-4b47-9fb0-184a169cc9af"
    }

Adds a connection to a Transit Gateway

Add a connection to Transit Gateway.

Add a connection to Transit Gateway.

Add a connection to Transit Gateway.

Add a connection to Transit Gateway.

Add a connection to Transit Gateway.

POST /transit_gateways/{transit_gateway_id}/connections
ServiceCall<TransitGatewayConnectionCust> createTransitGatewayConnection(CreateTransitGatewayConnectionOptions createTransitGatewayConnectionOptions)
createTransitGatewayConnection(params)
create_transit_gateway_connection(
        self,
        transit_gateway_id: str,
        network_type: str,
        *,
        base_connection_id: Optional[str] = None,
        base_network_type: Optional[str] = None,
        cidr: Optional[str] = None,
        local_gateway_ip: Optional[str] = None,
        local_tunnel_ip: Optional[str] = None,
        name: Optional[str] = None,
        network_account_id: Optional[str] = None,
        network_id: Optional[str] = None,
        prefix_filters: Optional[List['TransitGatewayConnectionPrefixFilter']] = None,
        prefix_filters_default: Optional[str] = None,
        remote_bgp_asn: Optional[int] = None,
        remote_gateway_ip: Optional[str] = None,
        remote_tunnel_ip: Optional[str] = None,
        tunnels: Optional[List['TransitGatewayTunnelTemplate']] = None,
        zone: Optional['ZoneIdentity'] = None,
        **kwargs,
    ) -> DetailedResponse
(transitGatewayApis *TransitGatewayApisV1) CreateTransitGatewayConnection(createTransitGatewayConnectionOptions *CreateTransitGatewayConnectionOptions) (result *TransitGatewayConnectionCust, response *core.DetailedResponse, err error)
(transitGatewayApis *TransitGatewayApisV1) CreateTransitGatewayConnectionWithContext(ctx context.Context, createTransitGatewayConnectionOptions *CreateTransitGatewayConnectionOptions) (result *TransitGatewayConnectionCust, response *core.DetailedResponse, err error)

Request

Use the CreateTransitGatewayConnectionOptions.Builder to create a CreateTransitGatewayConnectionOptions object that contains the parameter values for the createTransitGatewayConnection method.

Instantiate the CreateTransitGatewayConnectionOptions struct and set the fields to provide parameter values for the CreateTransitGatewayConnection method.

Path Parameters

  • The Transit Gateway identifier

    Possible values: 0 ≤ 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}$

Query Parameters

  • Requests the version of the API as of a date in the format YYYY-MM-DD. Any date 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 connection template

The createTransitGatewayConnection options.

parameters

  • The Transit Gateway identifier.

    Possible values: 0 ≤ 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}$/

  • Defines what type of network is connected via this connection.

    Allowable values: [classic,directlink,gre_tunnel,unbound_gre_tunnel,vpc,power_virtual_server,redundant_gre,vpn_gateway]

    Examples:
  • network_type gre_tunnel connections must be created over an existing network_type classic connection. This field must specify the ID of an active transit gateway network_type classic connection in the same transit gateway.

    This field is required for network type gre_tunnel connections.

    This field is required to be unspecified for network type classic, directlink, vpc, power_virtual_server, unbound_gre_tunnel, vpn_gateway and redundant_gre connections.

    Possible values: 0 ≤ 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:
  • The type of network the Unbound GRE tunnel is targeting. This field is required for network type unbound_gre_tunnel and must be set to classic. For a redundant_gre network type, the value is required and can be either VPC or Classic. This field is required to be unspecified for network type classic, directlink, vpc, power_virtual_server, vpn_gateway and gre_tunnel connections.

    Allowable values: [classic,vpc]

    Examples:
  • network_type 'vpn_gateway' connections use 'cidr' to specify the CIDR to use for the VPN GRE tunnels.

    This field is required for network type vpn_gateway connections.

    This field is required to be unspecified for network type classic, directlink, vpc, power_virtual_server, gre_tunnel, unbound_gre_tunnel, and redundant_gre connections.

    Possible values: 0 ≤ length ≤ 19, Value must match regular expression /^(([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])(\/(3[0-2]|[1-2][0-9]|[0-9]))$/

    Examples:
  • Local gateway IP address. This field is required for network type gre_tunnel and unbound_gre_tunnel connections. This field is required to be unspecified for network type classic, directlink, vpc, power_virtual_server, vpn_gateway and redundant_gre connections.

    Possible values: 0 ≤ length ≤ 40, Value must match regular expression /^(([0-9]){1,3}\\.){3}([0-9]{1,3})$/

    Examples:
  • Local tunnel IP address. The local_tunnel_ip and remote_tunnel_ip addresses must be in the same /30 network. Neither can be the network nor broadcast addresses.

    This field is required for network type gre_tunnel and unbound_gre_tunnel connections.

    This field is required to be unspecified for network type classic, directlink, vpc, power_virtual_server, vpn_gateway and redundant_gre connections.

    Possible values: 0 ≤ length ≤ 40, Value must match regular expression /^(([0-9]){1,3}\\.){3}([0-9]{1,3})$/

    Examples:
  • The user-defined name for this transit gateway connection. Network type vpc connections are defaulted to the name of the VPC. Network type classic connections are named classic.

    This field is required for network type power_virtual_server, directlink, gre_tunnel, unbound_gre_tunnel, vpn_gateway and redundant_gre connections.

    This field is optional for network type classic, vpc connections.

    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:
  • The ID of the account which owns the network that is being connected. Generally only used if the network is in a different account than the gateway. This field is required for type unbound_gre_tunnel when the associated_network_type is classic or network_type is redundant_gre and the GRE tunnel is in a different account than the gateway.

    Possible values: 0 ≤ length ≤ 100, Value must match regular expression /./

  • The ID of the network being connected via this connection. For network types vpc,power_virtual_server, directlink and vpn_gateway this is the CRN of the VPC / PowerVS / VDC / Direct Link / VPN gateway respectively. This field is required for network type vpc, power_virtual_server, vpn_gateway, and directlink connections. It is also required for redundant_gre connections when the base_network_type is set to VPC. This field is required to be unspecified for network type classic, gre_tunnel and unbound_gre_tunnel connections.

    Possible values: 0 ≤ length ≤ 220, Value must match regular expression /./

    Examples:
  • Array of prefix route filters for a transit gateway connection. Prefix filters can be specified for netowrk type vpc, classic, power_virtual_server and directlink connections. They are not allowed for type gre_tunnel connections. This is order dependent with those first in the array being applied first, and those at the end of the array being applied last, or just before applying the default. This field is optional for network type classic, vpc, directlink, and power_virtual_server connections. This field is required to be unspecified for network type gre_tunnel, unbound_gre_tunnel, vpn_gateway and redundant_gre connections.

    Possible values: 0 ≤ number of items ≤ 10

  • Default setting of permit or deny which applies to any routes that don't match a specified filter. This field is optional for network type classic, vpc, directlink, and power_virtual_server connections. This field is required to be unspecified for network type gre_tunnel, unbound_gre_tunnel, vpn_gateway and redundant_gre connections.

    Allowable values: [permit,deny]

    Examples:
  • Remote network BGP ASN. The following ASN values are reserved and unavailable 0, 13884, 36351, 64512, 64513, 65100, 65200-65234, 65402-65433, 65500, 65516, 65519, 65521, 65531 and 4201065000-4201065999. If remote_bgp_asn is omitted on gre_tunnel or unbound_gre_tunnel connection create requests IBM will assign an ASN.

    This field is optional for network type gre_tunnel and unbound_gre_tunnel connections.

    This field is required to be unspecified for network type classic, directlink, vpc, power_virtual_server, vpn_gateway and gre_tunnel connections.

    Examples:
  • Remote gateway IP address. This field is required for network type gre_tunnel and unbound_gre_tunnel connections. This field is required to be unspecified for network type classic, directlink, vpc, power_virtual_server, vpn_gateway and redundant_gre connections.

    Possible values: 0 ≤ length ≤ 40, Value must match regular expression /^(([0-9]){1,3}\\.){3}([0-9]{1,3})$/

    Examples:
  • Remote tunnel IP address. The local_tunnel_ip and remote_tunnel_ip addresses must be in the same /30 network. Neither can be the network nor broadcast addresses.

    This field is required for network type gre_tunnel and unbound_gre_tunnel connections.

    This field is required to be unspecified for network type classic, directlink, vpc, power_virtual_server, vpn_gateway and redundant_gre connections.

    Possible values: 0 ≤ length ≤ 40, Value must match regular expression /^(([0-9]){1,3}\\.){3}([0-9]{1,3})$/

    Examples:
  • Array of GRE tunnels for a transit gateway redundant_gre connections. This field is required for redundant_gre connections.

    Possible values: 2 ≤ number of items ≤ 10

  • Availability zone.

    parameters

    • The Transit Gateway identifier.

      Possible values: 0 ≤ 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}$/

    • Defines what type of network is connected via this connection.

      Allowable values: [classic,directlink,gre_tunnel,unbound_gre_tunnel,vpc,power_virtual_server,redundant_gre,vpn_gateway]

      Examples:
    • network_type gre_tunnel connections must be created over an existing network_type classic connection. This field must specify the ID of an active transit gateway network_type classic connection in the same transit gateway.

      This field is required for network type gre_tunnel connections.

      This field is required to be unspecified for network type classic, directlink, vpc, power_virtual_server, unbound_gre_tunnel, vpn_gateway and redundant_gre connections.

      Possible values: 0 ≤ 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:
    • The type of network the Unbound GRE tunnel is targeting. This field is required for network type unbound_gre_tunnel and must be set to classic. For a redundant_gre network type, the value is required and can be either VPC or Classic. This field is required to be unspecified for network type classic, directlink, vpc, power_virtual_server, vpn_gateway and gre_tunnel connections.

      Allowable values: [classic,vpc]

      Examples:
    • network_type 'vpn_gateway' connections use 'cidr' to specify the CIDR to use for the VPN GRE tunnels.

      This field is required for network type vpn_gateway connections.

      This field is required to be unspecified for network type classic, directlink, vpc, power_virtual_server, gre_tunnel, unbound_gre_tunnel, and redundant_gre connections.

      Possible values: 0 ≤ length ≤ 19, Value must match regular expression /^(([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])(\/(3[0-2]|[1-2][0-9]|[0-9]))$/

      Examples:
    • Local gateway IP address. This field is required for network type gre_tunnel and unbound_gre_tunnel connections. This field is required to be unspecified for network type classic, directlink, vpc, power_virtual_server, vpn_gateway and redundant_gre connections.

      Possible values: 0 ≤ length ≤ 40, Value must match regular expression /^(([0-9]){1,3}\\.){3}([0-9]{1,3})$/

      Examples:
    • Local tunnel IP address. The local_tunnel_ip and remote_tunnel_ip addresses must be in the same /30 network. Neither can be the network nor broadcast addresses.

      This field is required for network type gre_tunnel and unbound_gre_tunnel connections.

      This field is required to be unspecified for network type classic, directlink, vpc, power_virtual_server, vpn_gateway and redundant_gre connections.

      Possible values: 0 ≤ length ≤ 40, Value must match regular expression /^(([0-9]){1,3}\\.){3}([0-9]{1,3})$/

      Examples:
    • The user-defined name for this transit gateway connection. Network type vpc connections are defaulted to the name of the VPC. Network type classic connections are named classic.

      This field is required for network type power_virtual_server, directlink, gre_tunnel, unbound_gre_tunnel, vpn_gateway and redundant_gre connections.

      This field is optional for network type classic, vpc connections.

      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:
    • The ID of the account which owns the network that is being connected. Generally only used if the network is in a different account than the gateway. This field is required for type unbound_gre_tunnel when the associated_network_type is classic or network_type is redundant_gre and the GRE tunnel is in a different account than the gateway.

      Possible values: 0 ≤ length ≤ 100, Value must match regular expression /./

    • The ID of the network being connected via this connection. For network types vpc,power_virtual_server, directlink and vpn_gateway this is the CRN of the VPC / PowerVS / VDC / Direct Link / VPN gateway respectively. This field is required for network type vpc, power_virtual_server, vpn_gateway, and directlink connections. It is also required for redundant_gre connections when the base_network_type is set to VPC. This field is required to be unspecified for network type classic, gre_tunnel and unbound_gre_tunnel connections.

      Possible values: 0 ≤ length ≤ 220, Value must match regular expression /./

      Examples:
    • Array of prefix route filters for a transit gateway connection. Prefix filters can be specified for netowrk type vpc, classic, power_virtual_server and directlink connections. They are not allowed for type gre_tunnel connections. This is order dependent with those first in the array being applied first, and those at the end of the array being applied last, or just before applying the default. This field is optional for network type classic, vpc, directlink, and power_virtual_server connections. This field is required to be unspecified for network type gre_tunnel, unbound_gre_tunnel, vpn_gateway and redundant_gre connections.

      Possible values: 0 ≤ number of items ≤ 10

    • Default setting of permit or deny which applies to any routes that don't match a specified filter. This field is optional for network type classic, vpc, directlink, and power_virtual_server connections. This field is required to be unspecified for network type gre_tunnel, unbound_gre_tunnel, vpn_gateway and redundant_gre connections.

      Allowable values: [permit,deny]

      Examples:
    • Remote network BGP ASN. The following ASN values are reserved and unavailable 0, 13884, 36351, 64512, 64513, 65100, 65200-65234, 65402-65433, 65500, 65516, 65519, 65521, 65531 and 4201065000-4201065999. If remote_bgp_asn is omitted on gre_tunnel or unbound_gre_tunnel connection create requests IBM will assign an ASN.

      This field is optional for network type gre_tunnel and unbound_gre_tunnel connections.

      This field is required to be unspecified for network type classic, directlink, vpc, power_virtual_server, vpn_gateway and gre_tunnel connections.

      Examples:
    • Remote gateway IP address. This field is required for network type gre_tunnel and unbound_gre_tunnel connections. This field is required to be unspecified for network type classic, directlink, vpc, power_virtual_server, vpn_gateway and redundant_gre connections.

      Possible values: 0 ≤ length ≤ 40, Value must match regular expression /^(([0-9]){1,3}\\.){3}([0-9]{1,3})$/

      Examples:
    • Remote tunnel IP address. The local_tunnel_ip and remote_tunnel_ip addresses must be in the same /30 network. Neither can be the network nor broadcast addresses.

      This field is required for network type gre_tunnel and unbound_gre_tunnel connections.

      This field is required to be unspecified for network type classic, directlink, vpc, power_virtual_server, vpn_gateway and redundant_gre connections.

      Possible values: 0 ≤ length ≤ 40, Value must match regular expression /^(([0-9]){1,3}\\.){3}([0-9]{1,3})$/

      Examples:
    • Array of GRE tunnels for a transit gateway redundant_gre connections. This field is required for redundant_gre connections.

      Possible values: 2 ≤ number of items ≤ 10

    • Availability zone.

      WithContext method only

      The CreateTransitGatewayConnection options.

      • curl -X POST --location --header "Authorization: Bearer ${iam_token}"   --header "Accept: application/json"   --header "Content-Type: application/json"   --data '{ "network_type": "vpc" }'   "${base_url}/transit_gateways/${transit_gateway_id}/connections?version=${version}"
      • createTransitGatewayConnectionOptions := transitGatewayApisService.NewCreateTransitGatewayConnectionOptions(
          "testString",
          "vpc",
        )
        
        transitGatewayConnectionCust, response, err := transitGatewayApisService.CreateTransitGatewayConnection(createTransitGatewayConnectionOptions)
        if err != nil {
          panic(err)
        }
        b, _ := json.MarshalIndent(transitGatewayConnectionCust, "", "  ")
        fmt.Println(string(b))
      • CreateTransitGatewayConnectionOptions createTransitGatewayConnectionOptions = new CreateTransitGatewayConnectionOptions.Builder()
          .transitGatewayId("testString")
          .networkType("vpc")
          .build();
        
        Response<TransitGatewayConnectionCust> response = transitGatewayApisService.createTransitGatewayConnection(createTransitGatewayConnectionOptions).execute();
        TransitGatewayConnectionCust transitGatewayConnectionCust = response.getResult();
        
        System.out.println(transitGatewayConnectionCust);
      • const params = {
          transitGatewayId: 'testString',
          networkType: 'vpc',
        };
        
        let res;
        try {
          res = await transitGatewayApisService.createTransitGatewayConnection(params);
          console.log(JSON.stringify(res.result, null, 2));
        } catch (err) {
          console.warn(err);
        }
      • response = transit_gateway_apis_service.create_transit_gateway_connection(
          transit_gateway_id='testString',
          network_type='vpc',
        )
        transit_gateway_connection_cust = response.get_result()
        
        print(json.dumps(transit_gateway_connection_cust, indent=2))

      Response

      Connection included in transit gateway

      Connection included in transit gateway.

      Connection included in transit gateway.

      Connection included in transit gateway.

      Connection included in transit gateway.

      Status Code

      • The Transit Gateway connection was created successfully.

      • An invalid connection template was provided.

      • The specified Transit Gateway could not be found, the specified resource group could not be found, or the default resource group could not be found (if the resource group was not specified in the template).

      • The network being connected must either be in a location that is considered "local" to the specified Transit Gateway, or the specified Transit Gateway needs to be global. The network being connected cannot already be connected to another Transit Gateway.

      Example responses
      • {
          "created_at": "2020-03-31T12:08:05Z",
          "id": "1a15dca5-7e33-45e1-b7c5-bc690e569531",
          "name": "example-connection",
          "network_id": "crn:[...]",
          "network_type": "vpc",
          "prefix_filters_default": "permit",
          "request_status": "approved",
          "status": "pending",
          "updated_at": "2020-03-31T12:08:05Z"
        }
      • {
          "created_at": "2020-03-31T12:08:05Z",
          "id": "1a15dca5-7e33-45e1-b7c5-bc690e569531",
          "name": "example-connection",
          "network_id": "crn:[...]",
          "network_type": "vpc",
          "prefix_filters_default": "permit",
          "request_status": "approved",
          "status": "pending",
          "updated_at": "2020-03-31T12:08:05Z"
        }
      • {
          "errors": [
            {
              "code": "validation_required_field_missing",
              "message": "Mandatory field is missing.",
              "more_info": "https://cloud.ibm.com/apidocs/transit-gateway#error-handling",
              "target": {
                "name": "type",
                "type": "field"
              }
            }
          ],
          "trace": "86780a34-e651-4b47-9fb0-184a169cc9af"
        }
      • {
          "errors": [
            {
              "code": "validation_required_field_missing",
              "message": "Mandatory field is missing.",
              "more_info": "https://cloud.ibm.com/apidocs/transit-gateway#error-handling",
              "target": {
                "name": "type",
                "type": "field"
              }
            }
          ],
          "trace": "86780a34-e651-4b47-9fb0-184a169cc9af"
        }
      • {
          "errors": [
            {
              "code": "not_found",
              "message": "Cannot find Gateway",
              "more_info": "https://cloud.ibm.com/apidocs/transit-gateway#error-handling"
            }
          ],
          "trace": "86780a34-e651-4b47-9fb0-184a169cc9af"
        }
      • {
          "errors": [
            {
              "code": "not_found",
              "message": "Cannot find Gateway",
              "more_info": "https://cloud.ibm.com/apidocs/transit-gateway#error-handling"
            }
          ],
          "trace": "86780a34-e651-4b47-9fb0-184a169cc9af"
        }
      • {
          "errors": [
            {
              "code": "invalid_state",
              "message": "NetworkID already exists, Invalid request",
              "more_info": "https://cloud.ibm.com/apidocs/transit-gateway#error-handling"
            }
          ],
          "trace": "86780a34-e651-4b47-9fb0-184a169cc9af"
        }
      • {
          "errors": [
            {
              "code": "invalid_state",
              "message": "NetworkID already exists, Invalid request",
              "more_info": "https://cloud.ibm.com/apidocs/transit-gateway#error-handling"
            }
          ],
          "trace": "86780a34-e651-4b47-9fb0-184a169cc9af"
        }

      Removes a connection from Transit Gateway

      After the specified connection is detached, entities still within the Transit Gateway will no longer be able to communicate directly to it through the IBM Cloud private backbone.

      After the specified connection is detached, entities still within the Transit Gateway will no longer be able to communicate directly to it through the IBM Cloud private backbone.

      After the specified connection is detached, entities still within the Transit Gateway will no longer be able to communicate directly to it through the IBM Cloud private backbone.

      After the specified connection is detached, entities still within the Transit Gateway will no longer be able to communicate directly to it through the IBM Cloud private backbone.

      After the specified connection is detached, entities still within the Transit Gateway will no longer be able to communicate directly to it through the IBM Cloud private backbone.

      DELETE /transit_gateways/{transit_gateway_id}/connections/{id}
      ServiceCall<Void> deleteTransitGatewayConnection(DeleteTransitGatewayConnectionOptions deleteTransitGatewayConnectionOptions)
      deleteTransitGatewayConnection(params)
      delete_transit_gateway_connection(
              self,
              transit_gateway_id: str,
              id: str,
              **kwargs,
          ) -> DetailedResponse
      (transitGatewayApis *TransitGatewayApisV1) DeleteTransitGatewayConnection(deleteTransitGatewayConnectionOptions *DeleteTransitGatewayConnectionOptions) (response *core.DetailedResponse, err error)
      (transitGatewayApis *TransitGatewayApisV1) DeleteTransitGatewayConnectionWithContext(ctx context.Context, deleteTransitGatewayConnectionOptions *DeleteTransitGatewayConnectionOptions) (response *core.DetailedResponse, err error)

      Request

      Use the DeleteTransitGatewayConnectionOptions.Builder to create a DeleteTransitGatewayConnectionOptions object that contains the parameter values for the deleteTransitGatewayConnection method.

      Instantiate the DeleteTransitGatewayConnectionOptions struct and set the fields to provide parameter values for the DeleteTransitGatewayConnection method.

      Path Parameters

      • The Transit Gateway identifier

        Possible values: 0 ≤ 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}$

      • The connection identifier

        Possible values: 0 ≤ 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}$

      Query Parameters

      • Requests the version of the API as of a date in the format YYYY-MM-DD. Any date 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 deleteTransitGatewayConnection options.

      parameters

      • The Transit Gateway identifier.

        Possible values: 0 ≤ 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}$/

      • The connection identifier.

        Possible values: 0 ≤ 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}$/

      parameters

      • The Transit Gateway identifier.

        Possible values: 0 ≤ 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}$/

      • The connection identifier.

        Possible values: 0 ≤ 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}$/

      WithContext method only

      The DeleteTransitGatewayConnection options.

      • curl -X DELETE --location --header "Authorization: Bearer ${iam_token}"   "${base_url}/transit_gateways/${transit_gateway_id}/connections/${id}?version=${version}"
      • deleteTransitGatewayConnectionOptions := transitGatewayApisService.NewDeleteTransitGatewayConnectionOptions(
          "testString",
          "testString",
        )
        
        response, err := transitGatewayApisService.DeleteTransitGatewayConnection(deleteTransitGatewayConnectionOptions)
        if err != nil {
          panic(err)
        }
        if response.StatusCode != 204 {
          fmt.Printf("\nUnexpected response status code received from DeleteTransitGatewayConnection(): %d\n", response.StatusCode)
        }
      • DeleteTransitGatewayConnectionOptions deleteTransitGatewayConnectionOptions = new DeleteTransitGatewayConnectionOptions.Builder()
          .transitGatewayId("testString")
          .id("testString")
          .build();
        
        Response<Void> response = transitGatewayApisService.deleteTransitGatewayConnection(deleteTransitGatewayConnectionOptions).execute();
      • const params = {
          transitGatewayId: 'testString',
          id: 'testString',
        };
        
        try {
          await transitGatewayApisService.deleteTransitGatewayConnection(params);
        } catch (err) {
          console.warn(err);
        }
      • response = transit_gateway_apis_service.delete_transit_gateway_connection(
          transit_gateway_id='testString',
          id='testString',
        )

      Response

      Status Code

      • The connection was removed successfully.

      • A Transit Gateway or Transit Gateway connection with the specified identifier could not be found.

      Example responses
      • {
          "errors": [
            {
              "code": "not_found",
              "message": "Cannot find Connection",
              "more_info": "https://cloud.ibm.com/apidocs/transit-gateway#error-handling"
            }
          ],
          "trace": "86780a34-e651-4b47-9fb0-184a169cc9af"
        }
      • {
          "errors": [
            {
              "code": "not_found",
              "message": "Cannot find Connection",
              "more_info": "https://cloud.ibm.com/apidocs/transit-gateway#error-handling"
            }
          ],
          "trace": "86780a34-e651-4b47-9fb0-184a169cc9af"
        }

      Retrieves specified Transit Gateway connection

      This request retrieves a connection from the Transit Gateway.

      This request retrieves a connection from the Transit Gateway.

      This request retrieves a connection from the Transit Gateway.

      This request retrieves a connection from the Transit Gateway.

      This request retrieves a connection from the Transit Gateway.

      GET /transit_gateways/{transit_gateway_id}/connections/{id}
      ServiceCall<TransitGatewayConnectionCust> getTransitGatewayConnection(GetTransitGatewayConnectionOptions getTransitGatewayConnectionOptions)
      getTransitGatewayConnection(params)
      get_transit_gateway_connection(
              self,
              transit_gateway_id: str,
              id: str,
              **kwargs,
          ) -> DetailedResponse
      (transitGatewayApis *TransitGatewayApisV1) GetTransitGatewayConnection(getTransitGatewayConnectionOptions *GetTransitGatewayConnectionOptions) (result *TransitGatewayConnectionCust, response *core.DetailedResponse, err error)
      (transitGatewayApis *TransitGatewayApisV1) GetTransitGatewayConnectionWithContext(ctx context.Context, getTransitGatewayConnectionOptions *GetTransitGatewayConnectionOptions) (result *TransitGatewayConnectionCust, response *core.DetailedResponse, err error)

      Request

      Use the GetTransitGatewayConnectionOptions.Builder to create a GetTransitGatewayConnectionOptions object that contains the parameter values for the getTransitGatewayConnection method.

      Instantiate the GetTransitGatewayConnectionOptions struct and set the fields to provide parameter values for the GetTransitGatewayConnection method.

      Path Parameters

      • The Transit Gateway identifier

        Possible values: 0 ≤ 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}$

      • The connection identifier

        Possible values: 0 ≤ 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}$

      Query Parameters

      • Requests the version of the API as of a date in the format YYYY-MM-DD. Any date 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 getTransitGatewayConnection options.

      parameters

      • The Transit Gateway identifier.

        Possible values: 0 ≤ 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}$/

      • The connection identifier.

        Possible values: 0 ≤ 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}$/

      parameters

      • The Transit Gateway identifier.

        Possible values: 0 ≤ 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}$/

      • The connection identifier.

        Possible values: 0 ≤ 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}$/

      WithContext method only

      The GetTransitGatewayConnection options.

      • curl -X GET --location --header "Authorization: Bearer ${iam_token}"   --header "Accept: application/json"   "${base_url}/transit_gateways/${transit_gateway_id}/connections/${id}?version=${version}"
      • getTransitGatewayConnectionOptions := transitGatewayApisService.NewGetTransitGatewayConnectionOptions(
          "testString",
          "testString",
        )
        
        transitGatewayConnectionCust, response, err := transitGatewayApisService.GetTransitGatewayConnection(getTransitGatewayConnectionOptions)
        if err != nil {
          panic(err)
        }
        b, _ := json.MarshalIndent(transitGatewayConnectionCust, "", "  ")
        fmt.Println(string(b))
      • GetTransitGatewayConnectionOptions getTransitGatewayConnectionOptions = new GetTransitGatewayConnectionOptions.Builder()
          .transitGatewayId("testString")
          .id("testString")
          .build();
        
        Response<TransitGatewayConnectionCust> response = transitGatewayApisService.getTransitGatewayConnection(getTransitGatewayConnectionOptions).execute();
        TransitGatewayConnectionCust transitGatewayConnectionCust = response.getResult();
        
        System.out.println(transitGatewayConnectionCust);
      • const params = {
          transitGatewayId: 'testString',
          id: 'testString',
        };
        
        let res;
        try {
          res = await transitGatewayApisService.getTransitGatewayConnection(params);
          console.log(JSON.stringify(res.result, null, 2));
        } catch (err) {
          console.warn(err);
        }
      • response = transit_gateway_apis_service.get_transit_gateway_connection(
          transit_gateway_id='testString',
          id='testString',
        )
        transit_gateway_connection_cust = response.get_result()
        
        print(json.dumps(transit_gateway_connection_cust, indent=2))

      Response

      Connection included in transit gateway

      Connection included in transit gateway.

      Connection included in transit gateway.

      Connection included in transit gateway.

      Connection included in transit gateway.

      Status Code

      • The connection was retrieved successfully.

      • A connection or gateway with the specified identifier(s) could not be found.

      Example responses
      • {
          "created_at": "2020-03-31T12:08:05Z",
          "id": "1a15dca5-7e33-45e1-b7c5-bc690e569531",
          "name": "example-connection",
          "network_id": "crn:[...]",
          "network_type": "vpc",
          "prefix_filters_default": "permit",
          "request_status": "approved",
          "status": "attached",
          "updated_at": "2020-03-31T12:08:05Z"
        }
      • {
          "created_at": "2020-03-31T12:08:05Z",
          "id": "1a15dca5-7e33-45e1-b7c5-bc690e569531",
          "name": "example-connection",
          "network_id": "crn:[...]",
          "network_type": "vpc",
          "prefix_filters_default": "permit",
          "request_status": "approved",
          "status": "attached",
          "updated_at": "2020-03-31T12:08:05Z"
        }
      • {
          "errors": [
            {
              "code": "not_found",
              "message": "Cannot find Connection",
              "more_info": "https://cloud.ibm.com/apidocs/transit-gateway#error-handling"
            }
          ],
          "trace": "86780a34-e651-4b47-9fb0-184a169cc9af"
        }
      • {
          "errors": [
            {
              "code": "not_found",
              "message": "Cannot find Connection",
              "more_info": "https://cloud.ibm.com/apidocs/transit-gateway#error-handling"
            }
          ],
          "trace": "86780a34-e651-4b47-9fb0-184a169cc9af"
        }

      Updates specified Transit Gateway connection

      Update the name of a connection to a Transit Gateway.

      Update the name of a connection to a Transit Gateway.

      Update the name of a connection to a Transit Gateway.

      Update the name of a connection to a Transit Gateway.

      Update the name of a connection to a Transit Gateway.

      PATCH /transit_gateways/{transit_gateway_id}/connections/{id}
      ServiceCall<TransitGatewayConnectionCust> updateTransitGatewayConnection(UpdateTransitGatewayConnectionOptions updateTransitGatewayConnectionOptions)
      updateTransitGatewayConnection(params)
      update_transit_gateway_connection(
              self,
              transit_gateway_id: str,
              id: str,
              *,
              name: Optional[str] = None,
              prefix_filters_default: Optional[str] = None,
              **kwargs,
          ) -> DetailedResponse
      (transitGatewayApis *TransitGatewayApisV1) UpdateTransitGatewayConnection(updateTransitGatewayConnectionOptions *UpdateTransitGatewayConnectionOptions) (result *TransitGatewayConnectionCust, response *core.DetailedResponse, err error)
      (transitGatewayApis *TransitGatewayApisV1) UpdateTransitGatewayConnectionWithContext(ctx context.Context, updateTransitGatewayConnectionOptions *UpdateTransitGatewayConnectionOptions) (result *TransitGatewayConnectionCust, response *core.DetailedResponse, err error)

      Request

      Use the UpdateTransitGatewayConnectionOptions.Builder to create a UpdateTransitGatewayConnectionOptions object that contains the parameter values for the updateTransitGatewayConnection method.

      Instantiate the UpdateTransitGatewayConnectionOptions struct and set the fields to provide parameter values for the UpdateTransitGatewayConnection method.

      Path Parameters

      • The Transit Gateway identifier

        Possible values: 0 ≤ 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}$

      • The connection identifier

        Possible values: 0 ≤ 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}$

      Query Parameters

      • Requests the version of the API as of a date in the format YYYY-MM-DD. Any date 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 connection template

      The updateTransitGatewayConnection options.