From 15dd81163a2b5e7c3b244c24b108f288b63696db Mon Sep 17 00:00:00 2001 From: Joseph Kalandarishvili Date: Thu, 13 Aug 2026 09:01:17 -0500 Subject: [PATCH 1/4] feat: Added Redundant Global TGW related changes dependency: none Signed-off-by: Joseph Kalandarishvili --- .../transit_gateway_apis_v1.py | 1930 ++++++++++------- test/unit/test_transit_gateway_apis_v1.py | 591 ++++- 2 files changed, 1736 insertions(+), 785 deletions(-) diff --git a/ibm_cloud_networking_services/transit_gateway_apis_v1.py b/ibm_cloud_networking_services/transit_gateway_apis_v1.py index e63a86f..c5ba9f5 100644 --- a/ibm_cloud_networking_services/transit_gateway_apis_v1.py +++ b/ibm_cloud_networking_services/transit_gateway_apis_v1.py @@ -1,6 +1,6 @@ # coding: utf-8 -# (C) Copyright IBM Corp. 2025. +# (C) Copyright IBM Corp. 2026. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -14,7 +14,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -# IBM OpenAPI SDK Code Generator Version: 3.107.1-41b0fbd0-20250825-080732 +# IBM OpenAPI SDK Code Generator Version: 3.73.0-eeee85a9-20230607-165104 """ No description provided (generated by Openapi Generator @@ -25,7 +25,7 @@ from datetime import datetime from enum import Enum -from typing import Dict, List, Optional +from typing import Dict, List import json from ibm_cloud_sdk_core import BaseService, DetailedResponse @@ -100,19 +100,29 @@ def __init__( def list_transit_gateways( self, *, - limit: Optional[int] = None, - start: Optional[str] = None, + limit: int = None, + start: str = None, + redundancy_group: str = None, **kwargs, ) -> DetailedResponse: """ Retrieves all Transit Gateways. - List all Transit Gateways in account the caller is authorized to view. + List all Transit Gateways in the account the caller is authorized to view. Use the + `limit` (integer, 1–100, default 50) and `start` (string token) parameters to page + through results. Optionally filter by `redundancy_group` name. Each + `TransitGateway` in the response includes: `id`, `name`, `crn`, `location`, + `status` (pending, available, deleting, deleted, failed), `global` (boolean), + `created_at`, `updated_at`, `resource_group`, and optionally `redundancy_group`, + `redundancy_group_id`, `gre_enhanced_route_propagation`, and + `connection_needs_attention`. :param int limit: (optional) The maximum number of resources to return per page. :param str start: (optional) A server supplied token determining which resource to start the page on. + :param str redundancy_group: (optional) Filter the list of transit gateways + by redundancy group name. :param dict headers: A `dict` containing the request headers :return: A `DetailedResponse` containing the result, headers and HTTP status code. :rtype: DetailedResponse with `dict` result representing a `TransitGatewayCollection` object @@ -130,6 +140,7 @@ def list_transit_gateways( 'version': self.version, 'limit': limit, 'start': start, + 'redundancy_group': redundancy_group, } if 'headers' in kwargs: @@ -153,15 +164,22 @@ def create_transit_gateway( location: str, name: str, *, - global_: Optional[bool] = None, - gre_enhanced_route_propagation: Optional[bool] = None, - resource_group: Optional['ResourceGroupIdentity'] = None, + global_: bool = None, + gre_enhanced_route_propagation: bool = None, + redundancy_group: str = None, + resource_group: 'ResourceGroupIdentity' = None, **kwargs, ) -> DetailedResponse: """ Creates a Transit Gateway. - Create a Transit Gateway based on the supplied input template. + Create a Transit Gateway based on the supplied input template. Required fields: + `name` (string, 1–60 chars), `location` (IBM Cloud region, e.g. us-south). + Optional fields: `global` (boolean, enables cross-region routing), + `resource_group` (object with `id`), `redundancy_group` (string, name of the + redundancy group to join), + `gre_enhanced_route_propagation` (boolean). Returns a `TransitGateway` object. + Initial `status` will be `pending` while provisioning. :param str location: Location of Transit Gateway Services. :param str name: A human readable name for the transit gateway. @@ -171,6 +189,13 @@ def create_transit_gateway( 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`. + :param str redundancy_group: (optional) Include the global transit gateway + in this redundancy group. When set, this transit gateway will be redundant + to other transit gateways in this redundancy group. If this redundancy + group doesn't exist in the account, it will be created. This property can + only be set for global transit gateways and the transit gateway cannot be + in a location already used by a global transit gateway in this redundancy + group. :param ResourceGroupIdentity resource_group: (optional) The resource group to use. If unspecified, the account's [default resource group](https://console.bluemix.net/apidocs/resource-manager#introduction) @@ -203,6 +228,7 @@ def create_transit_gateway( 'name': name, 'global': global_, 'gre_enhanced_route_propagation': gre_enhanced_route_propagation, + 'redundancy_group': redundancy_group, 'resource_group': resource_group, } data = {k: v for (k, v) in data.items() if v is not None} @@ -234,8 +260,9 @@ def delete_transit_gateway( """ 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. + Delete a Transit Gateway specified by its `id` path parameter. This operation + cannot be reversed. The gateway must have no attached connections before it can be + deleted; remove all connections first. :param str id: The Transit Gateway identifier. :param dict headers: A `dict` containing the request headers @@ -283,8 +310,11 @@ def get_transit_gateway( """ Retrieves specified Transit Gateway. - This request retrieves a single Transit Gateway specified by the identifier in the - URL. + Retrieve a single Transit Gateway specified by its `id` path parameter. Returns a + `TransitGateway` object containing: `id`, `name`, `crn`, `location`, + `status`, `global`, `created_at`, `updated_at`, `resource_group`, and optionally + `redundancy_group`, `redundancy_group_id`, `gre_enhanced_route_propagation`, and + `connection_needs_attention`. :param str id: The Transit Gateway identifier. :param dict headers: A `dict` containing the request headers @@ -329,24 +359,35 @@ def update_transit_gateway( self, id: str, *, - global_: Optional[bool] = None, - gre_enhanced_route_propagation: Optional[bool] = None, - name: Optional[str] = None, + global_: bool = None, + gre_enhanced_route_propagation: bool = None, + name: str = None, + redundancy_group: str = None, **kwargs, ) -> DetailedResponse: """ Updates specified Transit Gateway. - This request updates a Transit Gateway's name and/or global flag. + Update a Transit Gateway specified by its `id` path parameter. Updatable fields: + `name` (string), `global` (boolean), `redundancy_group` (string, assigns the + gateway to a redundancy group), `gre_enhanced_route_propagation` (boolean). + Returns the updated `TransitGateway` object. :param str id: The Transit Gateway identifier. :param bool global_: (optional) Allow global routing for a Transit Gateway. + This property cannot be changed if the transit gateway has redundancy_group + set. :param bool gre_enhanced_route_propagation: (optional) 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. :param str name: (optional) A human readable name for a resource. + :param str redundancy_group: (optional) Create a new redundancy group with + this name and add the gateway to it. This property is only valid when the + gateway is global (or `global` is set to `true` in the same request), the + gateway is not already a member of a redundancy group, and no redundancy + group with this name already exists in the account. :param dict headers: A `dict` containing the request headers :return: A `DetailedResponse` containing the result, headers and HTTP status code. :rtype: DetailedResponse with `dict` result representing a `TransitGateway` object @@ -370,6 +411,7 @@ def update_transit_gateway( 'global': global_, 'gre_enhanced_route_propagation': gre_enhanced_route_propagation, 'name': name, + 'redundancy_group': redundancy_group, } data = {k: v for (k, v) in data.items() if v is not None} data = json.dumps(data) @@ -402,16 +444,22 @@ def update_transit_gateway( def list_connections( self, *, - limit: Optional[int] = None, - start: Optional[str] = None, - network_id: Optional[str] = None, - network_type: Optional[str] = None, + limit: int = None, + start: str = None, + network_id: str = None, + network_type: str = None, **kwargs, ) -> DetailedResponse: """ Retrieves all connections. - List all transit gateway connections associated with this account. + List all transit gateway connections associated with this account. Results can be + filtered by `network_id` or `network_type`. Use the `limit` and `start` parameters + to page through large result sets. The response includes a `TransitConnection` + object for each connection, containing fields such as `id`, `name`, + `network_type`, + `status`, `created_at`, `updated_at`, and optionally `prefix_filters`, + `request_status`, and `transit_gateway` reference. :param int limit: (optional) The maximum number of resources to return per page. @@ -466,9 +514,9 @@ def list_transit_gateway_connections( self, transit_gateway_id: str, *, - start: Optional[str] = None, - limit: Optional[int] = None, - name: Optional[str] = None, + start: str = None, + limit: int = None, + name: str = None, **kwargs, ) -> DetailedResponse: """ @@ -528,21 +576,21 @@ def create_transit_gateway_connection( 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, + base_connection_id: str = None, + base_network_type: str = None, + cidr: str = None, + local_gateway_ip: str = None, + local_tunnel_ip: str = None, + name: str = None, + network_account_id: str = None, + network_id: str = None, + prefix_filters: List['TransitGatewayConnectionPrefixFilter'] = None, + prefix_filters_default: str = None, + remote_bgp_asn: int = None, + remote_gateway_ip: str = None, + remote_tunnel_ip: str = None, + tunnels: List['TransitGatewayTunnelTemplate'] = None, + zone: 'ZoneIdentity' = None, **kwargs, ) -> DetailedResponse: """ @@ -567,33 +615,36 @@ def create_transit_gateway_connection( `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. - :param str cidr: (optional) 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. + `directlink`, `vpc`, `power_virtual_server`, `vpn_gateway`, + `dynamic_route_server` and `gre_tunnel` connections. + :param str cidr: (optional) network_type `vpn_gateway` and + `dynamic_route_server`connections use `cidr` to specify the CIDR to use for + the VPN gateway / Dynamic route server GRE tunnels. + This field is optional for network type `vpn_gateway` and + `dynamic_route_server` connections. If unspecified, the default value is + 198.19.174.0/23. 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. :param str local_gateway_ip: (optional) 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. + `classic`, `directlink`, `vpc`, `power_virtual_server`, `vpn_gateway`, + `dynamic_route_server` and `redundant_gre` connections. :param str local_tunnel_ip: (optional) 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. + `directlink`, `vpc`, `power_virtual_server`, `vpn_gateway`, + `dynamic_route_server` and `redundant_gre` connections. :param str name: (optional) 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. + `directlink`, `gre_tunnel`, `unbound_gre_tunnel`, `vpn_gateway`, + `dynamic_route_server` and `redundant_gre` connections. This field is optional for network type `classic`, `vpc` connections. :param str network_account_id: (optional) The ID of the account which owns the network that is being connected. Generally only used if the network is @@ -602,14 +653,15 @@ def create_transit_gateway_connection( network_type is `redundant_gre` and the GRE tunnel is in a different account than the gateway. :param str network_id: (optional) 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. + this connection. For network types `vpc`, `vpn_gateway`, + `dynamic_route_server`, `power_virtual_server` and `directlink` this is the + CRN of the VPC / VPN / Dynamic Route Server / PowerVS / Direct Link gateway + respectively. This field is required for network type `vpc`, + `power_virtual_server`, `vpn_gateway`, `dynamic_route_server` 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. :param List[TransitGatewayConnectionPrefixFilter] prefix_filters: (optional) Array of prefix route filters for a transit gateway connection. Prefix filters can be specified for netowrk type `vpc`, `classic`, @@ -619,14 +671,14 @@ def create_transit_gateway_connection( 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. + `gre_tunnel`, `unbound_gre_tunnel`, `vpn_gateway`, `dynamic_route_server` + and `redundant_gre` connections. :param str prefix_filters_default: (optional) 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. + `vpn_gateway`, `dynamic_route_server` and `redundant_gre` connections. :param int remote_bgp_asn: (optional) 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 @@ -635,21 +687,21 @@ def create_transit_gateway_connection( 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. + `directlink`, `vpc`, `power_virtual_server`, `vpn_gateway`, + `dynamic_route_server` and `gre_tunnel` connections. :param str remote_gateway_ip: (optional) 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. + `classic`, `directlink`, `vpc`, `power_virtual_server`, `vpn_gateway`, + `dynamic_route_server` and `redundant_gre` connections. :param str remote_tunnel_ip: (optional) 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. + `directlink`, `vpc`, `power_virtual_server`, `vpn_gateway`, + `dynamic_route_server` and `redundant_gre` connections. :param List[TransitGatewayTunnelTemplate] tunnels: (optional) Array of GRE tunnels for a transit gateway `redundant_gre` connections. This field is required for `redundant_gre` connections. @@ -660,8 +712,8 @@ def create_transit_gateway_connection( `unbound_gre_tunnel` connections. This field is optional for network type `vpn_gateway` connections. This field is required to be unspecified for network type `classic`, - `directlink`, `vpc`, `power_virtual_server` and `redundant_gre` - connections. + `directlink`, `vpc`, `power_virtual_server`, `redundant_gre` and + `dynamic_route_server` connections. :param dict headers: A `dict` containing the request headers :return: A `DetailedResponse` containing the result, headers and HTTP status code. :rtype: DetailedResponse with `dict` result representing a `TransitGatewayConnectionCust` object @@ -843,8 +895,8 @@ def update_transit_gateway_connection( transit_gateway_id: str, id: str, *, - name: Optional[str] = None, - prefix_filters_default: Optional[str] = None, + name: str = None, + prefix_filters_default: str = None, **kwargs, ) -> DetailedResponse: """ @@ -1038,7 +1090,7 @@ def create_transit_gateway_gre_tunnel( remote_tunnel_ip: str, zone: 'ZoneIdentity', *, - remote_bgp_asn: Optional[int] = None, + remote_bgp_asn: int = None, **kwargs, ) -> DetailedResponse: """ @@ -1472,9 +1524,9 @@ def create_transit_gateway_connection_prefix_filter( action: str, prefix: str, *, - before: Optional[str] = None, - ge: Optional[int] = None, - le: Optional[int] = None, + before: str = None, + ge: int = None, + le: int = None, **kwargs, ) -> DetailedResponse: """ @@ -1694,11 +1746,11 @@ def update_transit_gateway_connection_prefix_filter( id: str, filter_id: str, *, - action: Optional[str] = None, - before: Optional[str] = None, - ge: Optional[int] = None, - le: Optional[int] = None, - prefix: Optional[str] = None, + action: str = None, + before: str = None, + ge: int = None, + le: int = None, + prefix: str = None, **kwargs, ) -> DetailedResponse: """ @@ -2001,6 +2053,165 @@ def get_transit_gateway_route_report( response = self.send(request, **kwargs) return response + ######################### + # Redundancy Groups + ######################### + + def list_redundancy_groups( + self, + *, + name: str = None, + **kwargs, + ) -> DetailedResponse: + """ + Lists all redundancy groups in the account. + + List all redundancy groups for the account. + + :param str name: (optional) Filter the list of redundancy groups by name. + :param dict headers: A `dict` containing the request headers + :return: A `DetailedResponse` containing the result, headers and HTTP status code. + :rtype: DetailedResponse with `dict` result representing a `RedundancyGroupCollection` object + """ + + headers = {} + sdk_headers = get_sdk_headers( + service_name=self.DEFAULT_SERVICE_NAME, + service_version='V1', + operation_id='list_redundancy_groups', + ) + headers.update(sdk_headers) + + params = { + 'version': self.version, + 'name': name, + } + + if 'headers' in kwargs: + headers.update(kwargs.get('headers')) + del kwargs['headers'] + headers['Accept'] = 'application/json' + + url = '/redundancy_groups' + request = self.prepare_request( + method='GET', + url=url, + headers=headers, + params=params, + ) + + response = self.send(request, **kwargs) + return response + + def get_redundancy_group( + self, + id: str, + **kwargs, + ) -> DetailedResponse: + """ + Retrieves specified redundancy group. + + Retrieves a single redundancy group specified by the identifier in the URL. + + :param str id: The redundancy group identifier. + :param dict headers: A `dict` containing the request headers + :return: A `DetailedResponse` containing the result, headers and HTTP status code. + :rtype: DetailedResponse with `dict` result representing a `RedundancyGroup` object + """ + + if not id: + raise ValueError('id must be provided') + headers = {} + sdk_headers = get_sdk_headers( + service_name=self.DEFAULT_SERVICE_NAME, + service_version='V1', + operation_id='get_redundancy_group', + ) + headers.update(sdk_headers) + + params = { + 'version': self.version, + } + + if 'headers' in kwargs: + headers.update(kwargs.get('headers')) + del kwargs['headers'] + headers['Accept'] = 'application/json' + + path_param_keys = ['id'] + path_param_values = self.encode_path_vars(id) + path_param_dict = dict(zip(path_param_keys, path_param_values)) + url = '/redundancy_groups/{id}'.format(**path_param_dict) + request = self.prepare_request( + method='GET', + url=url, + headers=headers, + params=params, + ) + + response = self.send(request, **kwargs) + return response + + def update_redundancy_group( + self, + id: str, + redundancy_group_patch: 'RedundancyGroupPatch', + **kwargs, + ) -> DetailedResponse: + """ + Updates a redundancy group. + + Update a redundancy group. + + :param str id: The redundancy group identifier. + :param RedundancyGroupPatch redundancy_group_patch: The redundancy group + update template. + :param dict headers: A `dict` containing the request headers + :return: A `DetailedResponse` containing the result, headers and HTTP status code. + :rtype: DetailedResponse with `dict` result representing a `RedundancyGroup` object + """ + + if not id: + raise ValueError('id must be provided') + if redundancy_group_patch is None: + raise ValueError('redundancy_group_patch must be provided') + if isinstance(redundancy_group_patch, RedundancyGroupPatch): + redundancy_group_patch = convert_model(redundancy_group_patch) + headers = {} + sdk_headers = get_sdk_headers( + service_name=self.DEFAULT_SERVICE_NAME, + service_version='V1', + operation_id='update_redundancy_group', + ) + headers.update(sdk_headers) + + params = { + 'version': self.version, + } + + data = json.dumps(redundancy_group_patch) + headers['content-type'] = 'application/merge-patch+json' + + if 'headers' in kwargs: + headers.update(kwargs.get('headers')) + del kwargs['headers'] + headers['Accept'] = 'application/json' + + path_param_keys = ['id'] + path_param_values = self.encode_path_vars(id) + path_param_dict = dict(zip(path_param_keys, path_param_values)) + url = '/redundancy_groups/{id}'.format(**path_param_dict) + request = self.prepare_request( + method='PATCH', + url=url, + headers=headers, + params=params, + data=data, + ) + + response = self.send(request, **kwargs) + return response + ############################################################################## # Models @@ -2011,7 +2222,7 @@ class PaginationFirstConnection: """ A reference to the first page of resources. - :param str href: url. + :attr str href: url. """ def __init__( @@ -2029,8 +2240,8 @@ def __init__( def from_dict(cls, _dict: Dict) -> 'PaginationFirstConnection': """Initialize a PaginationFirstConnection object from a json dictionary.""" args = {} - if (href := _dict.get('href')) is not None: - args['href'] = href + if 'href' in _dict: + args['href'] = _dict.get('href') else: raise ValueError('Required property \'href\' not present in PaginationFirstConnection JSON') return cls(**args) @@ -2070,7 +2281,7 @@ class PaginationFirstTG: """ A reference to the first page of resources. - :param str href: url. + :attr str href: url. """ def __init__( @@ -2088,8 +2299,8 @@ def __init__( def from_dict(cls, _dict: Dict) -> 'PaginationFirstTG': """Initialize a PaginationFirstTG object from a json dictionary.""" args = {} - if (href := _dict.get('href')) is not None: - args['href'] = href + if 'href' in _dict: + args['href'] = _dict.get('href') else: raise ValueError('Required property \'href\' not present in PaginationFirstTG JSON') return cls(**args) @@ -2130,7 +2341,7 @@ class PaginationFirstTGWConnection: A reference to the first page of resources. This will be returned when number of connections in response are greater than max page limit. - :param str href: url. + :attr str href: url. """ def __init__( @@ -2148,8 +2359,8 @@ def __init__( def from_dict(cls, _dict: Dict) -> 'PaginationFirstTGWConnection': """Initialize a PaginationFirstTGWConnection object from a json dictionary.""" args = {} - if (href := _dict.get('href')) is not None: - args['href'] = href + if 'href' in _dict: + args['href'] = _dict.get('href') else: raise ValueError('Required property \'href\' not present in PaginationFirstTGWConnection JSON') return cls(**args) @@ -2190,8 +2401,8 @@ class PaginationNextConnection: A reference to the next page of resources; this reference is included for all pages except the last page. - :param str href: url. - :param str start: server generated start token for next page of resources. + :attr str href: url. + :attr str start: server generated start token for next page of resources. """ def __init__( @@ -2212,12 +2423,12 @@ def __init__( def from_dict(cls, _dict: Dict) -> 'PaginationNextConnection': """Initialize a PaginationNextConnection object from a json dictionary.""" args = {} - if (href := _dict.get('href')) is not None: - args['href'] = href + if 'href' in _dict: + args['href'] = _dict.get('href') else: raise ValueError('Required property \'href\' not present in PaginationNextConnection JSON') - if (start := _dict.get('start')) is not None: - args['start'] = start + if 'start' in _dict: + args['start'] = _dict.get('start') else: raise ValueError('Required property \'start\' not present in PaginationNextConnection JSON') return cls(**args) @@ -2260,8 +2471,8 @@ class PaginationNextTG: A reference to the next page of resources; this reference is included for all pages except the last page. - :param str href: url. - :param str start: server generated start token for next page of resources. + :attr str href: url. + :attr str start: server generated start token for next page of resources. """ def __init__( @@ -2282,12 +2493,12 @@ def __init__( def from_dict(cls, _dict: Dict) -> 'PaginationNextTG': """Initialize a PaginationNextTG object from a json dictionary.""" args = {} - if (href := _dict.get('href')) is not None: - args['href'] = href + if 'href' in _dict: + args['href'] = _dict.get('href') else: raise ValueError('Required property \'href\' not present in PaginationNextTG JSON') - if (start := _dict.get('start')) is not None: - args['start'] = start + if 'start' in _dict: + args['start'] = _dict.get('start') else: raise ValueError('Required property \'start\' not present in PaginationNextTG JSON') return cls(**args) @@ -2330,8 +2541,8 @@ class PaginationNextTGWConnection: A reference to the next page of resources; this reference is included for all pages except the last page. - :param str href: url. - :param str start: server generated start token for next page of resources. + :attr str href: url. + :attr str start: server generated start token for next page of resources. """ def __init__( @@ -2352,12 +2563,12 @@ def __init__( def from_dict(cls, _dict: Dict) -> 'PaginationNextTGWConnection': """Initialize a PaginationNextTGWConnection object from a json dictionary.""" args = {} - if (href := _dict.get('href')) is not None: - args['href'] = href + if 'href' in _dict: + args['href'] = _dict.get('href') else: raise ValueError('Required property \'href\' not present in PaginationNextTGWConnection JSON') - if (start := _dict.get('start')) is not None: - args['start'] = start + if 'start' in _dict: + args['start'] = _dict.get('start') else: raise ValueError('Required property \'start\' not present in PaginationNextTGWConnection JSON') return cls(**args) @@ -2399,7 +2610,7 @@ class PrefixFilterCollection: """ prefix filters. - :param List[PrefixFilterCust] prefix_filters: Array of prefix filters. + :attr List[PrefixFilterCust] prefix_filters: Array of prefix filters. """ def __init__( @@ -2417,8 +2628,8 @@ def __init__( def from_dict(cls, _dict: Dict) -> 'PrefixFilterCollection': """Initialize a PrefixFilterCollection object from a json dictionary.""" args = {} - if (prefix_filters := _dict.get('prefix_filters')) is not None: - args['prefix_filters'] = [PrefixFilterCust.from_dict(v) for v in prefix_filters] + if 'prefix_filters' in _dict: + args['prefix_filters'] = [PrefixFilterCust.from_dict(v) for v in _dict.get('prefix_filters')] else: raise ValueError('Required property \'prefix_filters\' not present in PrefixFilterCollection JSON') return cls(**args) @@ -2464,18 +2675,18 @@ class PrefixFilterCust: """ prefix filter. - :param str action: Whether or not this prefix filter should allow or deny + :attr str action: Whether or not this prefix filter should allow or deny prefixes matching this filter's prefix definition. - :param str before: (optional) A reference to the prefix filter that will be the + :attr str before: (optional) A reference to the prefix filter that will be the next filter applied to the Transit Gateway connection. If this field is blank, this prefix filter will be the last rule applied before the connection's default rule. When a prefix filter is created with the same before field as an existing prefix filter, the existing filter will be applied before the new filter, and the existing filter's before field will be updated accordingly. - :param datetime created_at: The date and time that this prefix filter was + :attr datetime created_at: The date and time that this prefix filter was created. - :param int ge: (optional) Defines the minimum matched prefix precision. If this + :attr int ge: (optional) Defines the minimum matched prefix precision. If this field is non-zero then the filter will match all routes within the `prefix` that have a prefix length greater or equal to this value. This value can be zero, or a non-negative number greater than or equal to the @@ -2483,8 +2694,8 @@ class PrefixFilterCust: is set to zero, the filter will not use the `ge` route matching behavior. If the `le` value is non-zero the the `ge` value must between the prefix length and the `le` value, inclusive. - :param str id: Prefix Filter identifier. - :param int le: (optional) Defines the maximum matched prefix precision. If this + :attr str id: Prefix Filter identifier. + :attr int le: (optional) Defines the maximum matched prefix precision. If this field is non-zero then the filter will match all routes within the `prefix` that have a prefix length less than or equal to this value. This value can be zero, or a non-negative number greater than or equal to the @@ -2492,12 +2703,12 @@ class PrefixFilterCust: is set to zero, the filter will not use the `le` route matching behavior. If the `ge` value is non-zero the the `le` value must between the `ge` value and 32, inclusive. - :param str prefix: The IPv4 Prefix to be matched by this filter. If both the - `le` and `ge` are zero, then this filter will only apply to routes that exactly - match this prefix, while a non-zero value for either `le` or `ge`, this filter - can apply to multiple routes with different prefix lengths, but will still only + :attr str prefix: The IPv4 Prefix to be matched by this filter. If both the `le` + and `ge` are zero, then this filter will only apply to routes that exactly match + this prefix, while a non-zero value for either `le` or `ge`, this filter can + apply to multiple routes with different prefix lengths, but will still only apply to prefixes contained in the address space defined by `prefix`. - :param datetime updated_at: (optional) The date and time that this prefix filter + :attr datetime updated_at: (optional) The date and time that this prefix filter was last updated. """ @@ -2508,10 +2719,10 @@ def __init__( id: str, prefix: str, *, - before: Optional[str] = None, - ge: Optional[int] = None, - le: Optional[int] = None, - updated_at: Optional[datetime] = None, + before: str = None, + ge: int = None, + le: int = None, + updated_at: datetime = None, ) -> None: """ Initialize a PrefixFilterCust object. @@ -2567,30 +2778,30 @@ def __init__( def from_dict(cls, _dict: Dict) -> 'PrefixFilterCust': """Initialize a PrefixFilterCust object from a json dictionary.""" args = {} - if (action := _dict.get('action')) is not None: - args['action'] = action + if 'action' in _dict: + args['action'] = _dict.get('action') else: raise ValueError('Required property \'action\' not present in PrefixFilterCust JSON') - if (before := _dict.get('before')) is not None: - args['before'] = before - if (created_at := _dict.get('created_at')) is not None: - args['created_at'] = string_to_datetime(created_at) + if 'before' in _dict: + args['before'] = _dict.get('before') + if 'created_at' in _dict: + args['created_at'] = string_to_datetime(_dict.get('created_at')) else: raise ValueError('Required property \'created_at\' not present in PrefixFilterCust JSON') - if (ge := _dict.get('ge')) is not None: - args['ge'] = ge - if (id := _dict.get('id')) is not None: - args['id'] = id + if 'ge' in _dict: + args['ge'] = _dict.get('ge') + if 'id' in _dict: + args['id'] = _dict.get('id') else: raise ValueError('Required property \'id\' not present in PrefixFilterCust JSON') - if (le := _dict.get('le')) is not None: - args['le'] = le - if (prefix := _dict.get('prefix')) is not None: - args['prefix'] = prefix + if 'le' in _dict: + args['le'] = _dict.get('le') + if 'prefix' in _dict: + args['prefix'] = _dict.get('prefix') else: raise ValueError('Required property \'prefix\' not present in PrefixFilterCust JSON') - if (updated_at := _dict.get('updated_at')) is not None: - args['updated_at'] = string_to_datetime(updated_at) + if 'updated_at' in _dict: + args['updated_at'] = string_to_datetime(_dict.get('updated_at')) return cls(**args) @classmethod @@ -2648,12 +2859,228 @@ class ActionEnum(str, Enum): +class RedundancyGroup: + """ + A redundancy group. + + :attr datetime created_at: The date and time that this redundancy group was + created. + :attr str id: The unique identifier for this redundancy group. + :attr str name: The redundancy group name. + :attr datetime updated_at: (optional) The date and time that this redundancy + group was last updated. + """ + + def __init__( + self, + created_at: datetime, + id: str, + name: str, + *, + updated_at: datetime = None, + ) -> None: + """ + Initialize a RedundancyGroup object. + + :param datetime created_at: The date and time that this redundancy group + was created. + :param str id: The unique identifier for this redundancy group. + :param str name: The redundancy group name. + :param datetime updated_at: (optional) The date and time that this + redundancy group was last updated. + """ + self.created_at = created_at + self.id = id + self.name = name + self.updated_at = updated_at + + @classmethod + def from_dict(cls, _dict: Dict) -> 'RedundancyGroup': + """Initialize a RedundancyGroup object from a json dictionary.""" + args = {} + if 'created_at' in _dict: + args['created_at'] = string_to_datetime(_dict.get('created_at')) + else: + raise ValueError('Required property \'created_at\' not present in RedundancyGroup JSON') + if 'id' in _dict: + args['id'] = _dict.get('id') + else: + raise ValueError('Required property \'id\' not present in RedundancyGroup JSON') + if 'name' in _dict: + args['name'] = _dict.get('name') + else: + raise ValueError('Required property \'name\' not present in RedundancyGroup JSON') + if 'updated_at' in _dict: + args['updated_at'] = string_to_datetime(_dict.get('updated_at')) + return cls(**args) + + @classmethod + def _from_dict(cls, _dict): + """Initialize a RedundancyGroup object from a json dictionary.""" + return cls.from_dict(_dict) + + def to_dict(self) -> Dict: + """Return a json dictionary representing this model.""" + _dict = {} + if hasattr(self, 'created_at') and self.created_at is not None: + _dict['created_at'] = datetime_to_string(self.created_at) + if hasattr(self, 'id') and self.id is not None: + _dict['id'] = self.id + if hasattr(self, 'name') and self.name is not None: + _dict['name'] = self.name + if hasattr(self, 'updated_at') and self.updated_at is not None: + _dict['updated_at'] = datetime_to_string(self.updated_at) + return _dict + + def _to_dict(self): + """Return a json dictionary representing this model.""" + return self.to_dict() + + def __str__(self) -> str: + """Return a `str` version of this RedundancyGroup object.""" + return json.dumps(self.to_dict(), indent=2) + + def __eq__(self, other: 'RedundancyGroup') -> bool: + """Return `true` when self and other are equal, false otherwise.""" + if not isinstance(other, self.__class__): + return False + return self.__dict__ == other.__dict__ + + def __ne__(self, other: 'RedundancyGroup') -> bool: + """Return `true` when self and other are not equal, false otherwise.""" + return not self == other + + +class RedundancyGroupCollection: + """ + A list of redundancy groups. + + :attr List[RedundancyGroup] redundancy_groups: Collection of redundancy groups. + """ + + def __init__( + self, + redundancy_groups: List['RedundancyGroup'], + ) -> None: + """ + Initialize a RedundancyGroupCollection object. + + :param List[RedundancyGroup] redundancy_groups: Collection of redundancy + groups. + """ + self.redundancy_groups = redundancy_groups + + @classmethod + def from_dict(cls, _dict: Dict) -> 'RedundancyGroupCollection': + """Initialize a RedundancyGroupCollection object from a json dictionary.""" + args = {} + if 'redundancy_groups' in _dict: + args['redundancy_groups'] = [RedundancyGroup.from_dict(v) for v in _dict.get('redundancy_groups')] + else: + raise ValueError('Required property \'redundancy_groups\' not present in RedundancyGroupCollection JSON') + return cls(**args) + + @classmethod + def _from_dict(cls, _dict): + """Initialize a RedundancyGroupCollection object from a json dictionary.""" + return cls.from_dict(_dict) + + def to_dict(self) -> Dict: + """Return a json dictionary representing this model.""" + _dict = {} + if hasattr(self, 'redundancy_groups') and self.redundancy_groups is not None: + redundancy_groups_list = [] + for v in self.redundancy_groups: + if isinstance(v, dict): + redundancy_groups_list.append(v) + else: + redundancy_groups_list.append(v.to_dict()) + _dict['redundancy_groups'] = redundancy_groups_list + return _dict + + def _to_dict(self): + """Return a json dictionary representing this model.""" + return self.to_dict() + + def __str__(self) -> str: + """Return a `str` version of this RedundancyGroupCollection object.""" + return json.dumps(self.to_dict(), indent=2) + + def __eq__(self, other: 'RedundancyGroupCollection') -> bool: + """Return `true` when self and other are equal, false otherwise.""" + if not isinstance(other, self.__class__): + return False + return self.__dict__ == other.__dict__ + + def __ne__(self, other: 'RedundancyGroupCollection') -> bool: + """Return `true` when self and other are not equal, false otherwise.""" + return not self == other + + +class RedundancyGroupPatch: + """ + An update template for a redundancy group. + + :attr str name: (optional) The new name for the redundancy group. + """ + + def __init__( + self, + *, + name: str = None, + ) -> None: + """ + Initialize a RedundancyGroupPatch object. + + :param str name: (optional) The new name for the redundancy group. + """ + self.name = name + + @classmethod + def from_dict(cls, _dict: Dict) -> 'RedundancyGroupPatch': + """Initialize a RedundancyGroupPatch object from a json dictionary.""" + args = {} + if 'name' in _dict: + args['name'] = _dict.get('name') + return cls(**args) + + @classmethod + def _from_dict(cls, _dict): + """Initialize a RedundancyGroupPatch object from a json dictionary.""" + return cls.from_dict(_dict) + + def to_dict(self) -> Dict: + """Return a json dictionary representing this model.""" + _dict = {} + if hasattr(self, 'name') and self.name is not None: + _dict['name'] = self.name + return _dict + + def _to_dict(self): + """Return a json dictionary representing this model.""" + return self.to_dict() + + def __str__(self) -> str: + """Return a `str` version of this RedundancyGroupPatch object.""" + return json.dumps(self.to_dict(), indent=2) + + def __eq__(self, other: 'RedundancyGroupPatch') -> bool: + """Return `true` when self and other are equal, false otherwise.""" + if not isinstance(other, self.__class__): + return False + return self.__dict__ == other.__dict__ + + def __ne__(self, other: 'RedundancyGroupPatch') -> bool: + """Return `true` when self and other are not equal, false otherwise.""" + return not self == other + + class ResourceGroupIdentity: """ The resource group to use. If unspecified, the account's [default resource group](https://console.bluemix.net/apidocs/resource-manager#introduction) is used. - :param str id: The unique identifier for this resource group. + :attr str id: The unique identifier for this resource group. """ def __init__( @@ -2671,8 +3098,8 @@ def __init__( def from_dict(cls, _dict: Dict) -> 'ResourceGroupIdentity': """Initialize a ResourceGroupIdentity object from a json dictionary.""" args = {} - if (id := _dict.get('id')) is not None: - args['id'] = id + if 'id' in _dict: + args['id'] = _dict.get('id') else: raise ValueError('Required property \'id\' not present in ResourceGroupIdentity JSON') return cls(**args) @@ -2713,8 +3140,8 @@ class ResourceGroupReference: The resource group to use. If unspecified, the account's [default resource group](https://console.bluemix.net/apidocs/resource-manager#introduction) is used. - :param str href: The URL for this resource group. - :param str id: The unique identifier for this resource group. + :attr str href: The URL for this resource group. + :attr str id: The unique identifier for this resource group. """ def __init__( @@ -2735,12 +3162,12 @@ def __init__( def from_dict(cls, _dict: Dict) -> 'ResourceGroupReference': """Initialize a ResourceGroupReference object from a json dictionary.""" args = {} - if (href := _dict.get('href')) is not None: - args['href'] = href + if 'href' in _dict: + args['href'] = _dict.get('href') else: raise ValueError('Required property \'href\' not present in ResourceGroupReference JSON') - if (id := _dict.get('id')) is not None: - args['id'] = id + if 'id' in _dict: + args['id'] = _dict.get('id') else: raise ValueError('Required property \'id\' not present in ResourceGroupReference JSON') return cls(**args) @@ -2782,16 +3209,16 @@ class RouteReport: """ route report. - :param List[RouteReportConnection] connections: Array of connections with their + :attr List[RouteReportConnection] connections: Array of connections with their routes. - :param datetime created_at: Date and time route report was requested. - :param str id: Report identifier. - :param List[RouteReportOverlappingRouteGroup] overlapping_routes: Array of + :attr datetime created_at: Date and time route report was requested. + :attr str id: Report identifier. + :attr List[RouteReportOverlappingRouteGroup] overlapping_routes: Array of overlapping routes. - :param str status: Route report status. The list of enumerated values for this + :attr str status: Route report status. The list of enumerated values for this property may expand in the future. Code and processes using this field must tolerate unexpected values. - :param datetime updated_at: (optional) Date and time route report was last + :attr datetime updated_at: (optional) Date and time route report was last modified. """ @@ -2803,7 +3230,7 @@ def __init__( overlapping_routes: List['RouteReportOverlappingRouteGroup'], status: str, *, - updated_at: Optional[datetime] = None, + updated_at: datetime = None, ) -> None: """ Initialize a RouteReport object. @@ -2831,28 +3258,28 @@ def __init__( def from_dict(cls, _dict: Dict) -> 'RouteReport': """Initialize a RouteReport object from a json dictionary.""" args = {} - if (connections := _dict.get('connections')) is not None: - args['connections'] = [RouteReportConnection.from_dict(v) for v in connections] + if 'connections' in _dict: + args['connections'] = [RouteReportConnection.from_dict(v) for v in _dict.get('connections')] else: raise ValueError('Required property \'connections\' not present in RouteReport JSON') - if (created_at := _dict.get('created_at')) is not None: - args['created_at'] = string_to_datetime(created_at) + if 'created_at' in _dict: + args['created_at'] = string_to_datetime(_dict.get('created_at')) else: raise ValueError('Required property \'created_at\' not present in RouteReport JSON') - if (id := _dict.get('id')) is not None: - args['id'] = id + if 'id' in _dict: + args['id'] = _dict.get('id') else: raise ValueError('Required property \'id\' not present in RouteReport JSON') - if (overlapping_routes := _dict.get('overlapping_routes')) is not None: - args['overlapping_routes'] = [RouteReportOverlappingRouteGroup.from_dict(v) for v in overlapping_routes] + if 'overlapping_routes' in _dict: + args['overlapping_routes'] = [RouteReportOverlappingRouteGroup.from_dict(v) for v in _dict.get('overlapping_routes')] else: raise ValueError('Required property \'overlapping_routes\' not present in RouteReport JSON') - if (status := _dict.get('status')) is not None: - args['status'] = status + if 'status' in _dict: + args['status'] = _dict.get('status') else: raise ValueError('Required property \'status\' not present in RouteReport JSON') - if (updated_at := _dict.get('updated_at')) is not None: - args['updated_at'] = string_to_datetime(updated_at) + if 'updated_at' in _dict: + args['updated_at'] = string_to_datetime(_dict.get('updated_at')) return cls(**args) @classmethod @@ -2923,7 +3350,7 @@ class RouteReportCollection: """ route reports. - :param List[RouteReport] route_reports: Array of route reports. + :attr List[RouteReport] route_reports: Array of route reports. """ def __init__( @@ -2941,8 +3368,8 @@ def __init__( def from_dict(cls, _dict: Dict) -> 'RouteReportCollection': """Initialize a RouteReportCollection object from a json dictionary.""" args = {} - if (route_reports := _dict.get('route_reports')) is not None: - args['route_reports'] = [RouteReport.from_dict(v) for v in route_reports] + if 'route_reports' in _dict: + args['route_reports'] = [RouteReport.from_dict(v) for v in _dict.get('route_reports')] else: raise ValueError('Required property \'route_reports\' not present in RouteReportCollection JSON') return cls(**args) @@ -2988,33 +3415,30 @@ class RouteReportConnection: """ route report connection. - :param List[RouteReportConnectionBgp] bgps: (optional) Array of connection's - bgps. - :param str id: (optional) connection ID. - :param str name: (optional) connection name. - :param List[RouteReportConnectionRoute] routes: (optional) Array of connection's - routes. - :param str type: (optional) connection type. + :attr List[RouteReportConnectionBgp] bgps: Array of connection's bgps. + :attr str id: (optional) connection ID. + :attr str name: (optional) connection name. + :attr List[RouteReportConnectionRoute] routes: Array of connection's routes. + :attr str type: (optional) connection type. """ def __init__( self, + bgps: List['RouteReportConnectionBgp'], + routes: List['RouteReportConnectionRoute'], *, - bgps: Optional[List['RouteReportConnectionBgp']] = None, - id: Optional[str] = None, - name: Optional[str] = None, - routes: Optional[List['RouteReportConnectionRoute']] = None, - type: Optional[str] = None, + id: str = None, + name: str = None, + type: str = None, ) -> None: """ Initialize a RouteReportConnection object. - :param List[RouteReportConnectionBgp] bgps: (optional) Array of - connection's bgps. + :param List[RouteReportConnectionBgp] bgps: Array of connection's bgps. + :param List[RouteReportConnectionRoute] routes: Array of connection's + routes. :param str id: (optional) connection ID. :param str name: (optional) connection name. - :param List[RouteReportConnectionRoute] routes: (optional) Array of - connection's routes. :param str type: (optional) connection type. """ self.bgps = bgps @@ -3027,16 +3451,20 @@ def __init__( def from_dict(cls, _dict: Dict) -> 'RouteReportConnection': """Initialize a RouteReportConnection object from a json dictionary.""" args = {} - if (bgps := _dict.get('bgps')) is not None: - args['bgps'] = [RouteReportConnectionBgp.from_dict(v) for v in bgps] - if (id := _dict.get('id')) is not None: - args['id'] = id - if (name := _dict.get('name')) is not None: - args['name'] = name - if (routes := _dict.get('routes')) is not None: - args['routes'] = [RouteReportConnectionRoute.from_dict(v) for v in routes] - if (type := _dict.get('type')) is not None: - args['type'] = type + if 'bgps' in _dict: + args['bgps'] = [RouteReportConnectionBgp.from_dict(v) for v in _dict.get('bgps')] + else: + raise ValueError('Required property \'bgps\' not present in RouteReportConnection JSON') + if 'id' in _dict: + args['id'] = _dict.get('id') + if 'name' in _dict: + args['name'] = _dict.get('name') + if 'routes' in _dict: + args['routes'] = [RouteReportConnectionRoute.from_dict(v) for v in _dict.get('routes')] + else: + raise ValueError('Required property \'routes\' not present in RouteReportConnection JSON') + if 'type' in _dict: + args['type'] = _dict.get('type') return cls(**args) @classmethod @@ -3094,19 +3522,19 @@ class RouteReportConnectionBgp: """ connection bgp details. - :param str as_path: (optional) AS path. - :param bool is_used: Indicates whether current route is used or not. - :param str local_preference: (optional) local preference. - :param str prefix: (optional) prefix. + :attr str as_path: (optional) AS path. + :attr bool is_used: Indicates whether current route is used or not. + :attr str local_preference: (optional) local preference. + :attr str prefix: (optional) prefix. """ def __init__( self, is_used: bool, *, - as_path: Optional[str] = None, - local_preference: Optional[str] = None, - prefix: Optional[str] = None, + as_path: str = None, + local_preference: str = None, + prefix: str = None, ) -> None: """ Initialize a RouteReportConnectionBgp object. @@ -3125,16 +3553,16 @@ def __init__( def from_dict(cls, _dict: Dict) -> 'RouteReportConnectionBgp': """Initialize a RouteReportConnectionBgp object from a json dictionary.""" args = {} - if (as_path := _dict.get('as_path')) is not None: - args['as_path'] = as_path - if (is_used := _dict.get('is_used')) is not None: - args['is_used'] = is_used + if 'as_path' in _dict: + args['as_path'] = _dict.get('as_path') + if 'is_used' in _dict: + args['is_used'] = _dict.get('is_used') else: raise ValueError('Required property \'is_used\' not present in RouteReportConnectionBgp JSON') - if (local_preference := _dict.get('local_preference')) is not None: - args['local_preference'] = local_preference - if (prefix := _dict.get('prefix')) is not None: - args['prefix'] = prefix + if 'local_preference' in _dict: + args['local_preference'] = _dict.get('local_preference') + if 'prefix' in _dict: + args['prefix'] = _dict.get('prefix') return cls(**args) @classmethod @@ -3178,13 +3606,13 @@ class RouteReportConnectionRoute: """ connection used route. - :param str prefix: (optional) prefix. + :attr str prefix: (optional) prefix. """ def __init__( self, *, - prefix: Optional[str] = None, + prefix: str = None, ) -> None: """ Initialize a RouteReportConnectionRoute object. @@ -3197,8 +3625,8 @@ def __init__( def from_dict(cls, _dict: Dict) -> 'RouteReportConnectionRoute': """Initialize a RouteReportConnectionRoute object from a json dictionary.""" args = {} - if (prefix := _dict.get('prefix')) is not None: - args['prefix'] = prefix + if 'prefix' in _dict: + args['prefix'] = _dict.get('prefix') return cls(**args) @classmethod @@ -3236,15 +3664,15 @@ class RouteReportOverlappingRoute: """ overlapping route details. - :param str connection_id: (optional) connection ID. - :param str prefix: (optional) overlapping prefix. + :attr str connection_id: (optional) connection ID. + :attr str prefix: (optional) overlapping prefix. """ def __init__( self, *, - connection_id: Optional[str] = None, - prefix: Optional[str] = None, + connection_id: str = None, + prefix: str = None, ) -> None: """ Initialize a RouteReportOverlappingRoute object. @@ -3259,10 +3687,10 @@ def __init__( def from_dict(cls, _dict: Dict) -> 'RouteReportOverlappingRoute': """Initialize a RouteReportOverlappingRoute object from a json dictionary.""" args = {} - if (connection_id := _dict.get('connection_id')) is not None: - args['connection_id'] = connection_id - if (prefix := _dict.get('prefix')) is not None: - args['prefix'] = prefix + if 'connection_id' in _dict: + args['connection_id'] = _dict.get('connection_id') + if 'prefix' in _dict: + args['prefix'] = _dict.get('prefix') return cls(**args) @classmethod @@ -3302,20 +3730,19 @@ class RouteReportOverlappingRouteGroup: """ Collection of overlapping route. - :param List[RouteReportOverlappingRoute] routes: (optional) Array of overlapping + :attr List[RouteReportOverlappingRoute] routes: Array of overlapping connection/prefix pairs. """ def __init__( self, - *, - routes: Optional[List['RouteReportOverlappingRoute']] = None, + routes: List['RouteReportOverlappingRoute'], ) -> None: """ Initialize a RouteReportOverlappingRouteGroup object. - :param List[RouteReportOverlappingRoute] routes: (optional) Array of - overlapping connection/prefix pairs. + :param List[RouteReportOverlappingRoute] routes: Array of overlapping + connection/prefix pairs. """ self.routes = routes @@ -3323,8 +3750,10 @@ def __init__( def from_dict(cls, _dict: Dict) -> 'RouteReportOverlappingRouteGroup': """Initialize a RouteReportOverlappingRouteGroup object from a json dictionary.""" args = {} - if (routes := _dict.get('routes')) is not None: - args['routes'] = [RouteReportOverlappingRoute.from_dict(v) for v in routes] + if 'routes' in _dict: + args['routes'] = [RouteReportOverlappingRoute.from_dict(v) for v in _dict.get('routes')] + else: + raise ValueError('Required property \'routes\' not present in RouteReportOverlappingRouteGroup JSON') return cls(**args) @classmethod @@ -3368,7 +3797,7 @@ class TSCollection: """ A list of Transit Gateway locations. - :param List[TSLocationBasic] locations: Collection of Transit Gateway locations. + :attr List[TSLocationBasic] locations: Collection of Transit Gateway locations. """ def __init__( @@ -3387,8 +3816,8 @@ def __init__( def from_dict(cls, _dict: Dict) -> 'TSCollection': """Initialize a TSCollection object from a json dictionary.""" args = {} - if (locations := _dict.get('locations')) is not None: - args['locations'] = [TSLocationBasic.from_dict(v) for v in locations] + if 'locations' in _dict: + args['locations'] = [TSLocationBasic.from_dict(v) for v in _dict.get('locations')] else: raise ValueError('Required property \'locations\' not present in TSCollection JSON') return cls(**args) @@ -3434,11 +3863,10 @@ class TSLocalLocation: """ Details of a local connection location. - :param str display_name: A descriptive display name for the location. - :param str name: The name of the location. - :param List[str] supported_connection_types: (optional) Array of supported - connection types. - :param str type: The type of the location, determining is this a multi-zone + :attr str display_name: A descriptive display name for the location. + :attr str name: The name of the location. + :attr List[str] supported_connection_types: Array of supported connection types. + :attr str type: The type of the location, determining is this a multi-zone region, a single data center, or a point of presence. The list of enumerated values for this property may expand in the future. Code and processes using this field must tolerate unexpected values. @@ -3448,21 +3876,20 @@ def __init__( self, display_name: str, name: str, + supported_connection_types: List[str], type: str, - *, - supported_connection_types: Optional[List[str]] = None, ) -> None: """ Initialize a TSLocalLocation object. :param str display_name: A descriptive display name for the location. :param str name: The name of the location. + :param List[str] supported_connection_types: Array of supported connection + types. :param str type: The type of the location, determining is this a multi-zone region, a single data center, or a point of presence. The list of enumerated values for this property may expand in the future. Code and processes using this field must tolerate unexpected values. - :param List[str] supported_connection_types: (optional) Array of supported - connection types. """ self.display_name = display_name self.name = name @@ -3473,18 +3900,20 @@ def __init__( def from_dict(cls, _dict: Dict) -> 'TSLocalLocation': """Initialize a TSLocalLocation object from a json dictionary.""" args = {} - if (display_name := _dict.get('display_name')) is not None: - args['display_name'] = display_name + if 'display_name' in _dict: + args['display_name'] = _dict.get('display_name') else: raise ValueError('Required property \'display_name\' not present in TSLocalLocation JSON') - if (name := _dict.get('name')) is not None: - args['name'] = name + if 'name' in _dict: + args['name'] = _dict.get('name') else: raise ValueError('Required property \'name\' not present in TSLocalLocation JSON') - if (supported_connection_types := _dict.get('supported_connection_types')) is not None: - args['supported_connection_types'] = supported_connection_types - if (type := _dict.get('type')) is not None: - args['type'] = type + if 'supported_connection_types' in _dict: + args['supported_connection_types'] = _dict.get('supported_connection_types') + else: + raise ValueError('Required property \'supported_connection_types\' not present in TSLocalLocation JSON') + if 'type' in _dict: + args['type'] = _dict.get('type') else: raise ValueError('Required property \'type\' not present in TSLocalLocation JSON') return cls(**args) @@ -3542,14 +3971,14 @@ class TSLocation: """ Details of a Transit Gateway location. - :param str billing_location: The geographical location of this location, used - for billing purposes. - :param str name: Name of the Location. - :param str type: The type of the location, determining is this a multi-zone + :attr str billing_location: The geographical location of this location, used for + billing purposes. + :attr str name: Name of the Location. + :attr str type: The type of the location, determining is this a multi-zone region, a single data center, or a point of presence. - :param List[TSLocalLocation] local_connection_locations: The set of network + :attr List[TSLocalLocation] local_connection_locations: The set of network locations that are considered local for this Transit Gateway location. - :param List[ZoneReference] zones: List of valid zones for GRE tunnels. + :attr List[ZoneReference] zones: List of valid zones for GRE tunnels. """ def __init__( @@ -3582,24 +4011,24 @@ def __init__( def from_dict(cls, _dict: Dict) -> 'TSLocation': """Initialize a TSLocation object from a json dictionary.""" args = {} - if (billing_location := _dict.get('billing_location')) is not None: - args['billing_location'] = billing_location + if 'billing_location' in _dict: + args['billing_location'] = _dict.get('billing_location') else: raise ValueError('Required property \'billing_location\' not present in TSLocation JSON') - if (name := _dict.get('name')) is not None: - args['name'] = name + if 'name' in _dict: + args['name'] = _dict.get('name') else: raise ValueError('Required property \'name\' not present in TSLocation JSON') - if (type := _dict.get('type')) is not None: - args['type'] = type + if 'type' in _dict: + args['type'] = _dict.get('type') else: raise ValueError('Required property \'type\' not present in TSLocation JSON') - if (local_connection_locations := _dict.get('local_connection_locations')) is not None: - args['local_connection_locations'] = [TSLocalLocation.from_dict(v) for v in local_connection_locations] + if 'local_connection_locations' in _dict: + args['local_connection_locations'] = [TSLocalLocation.from_dict(v) for v in _dict.get('local_connection_locations')] else: raise ValueError('Required property \'local_connection_locations\' not present in TSLocation JSON') - if (zones := _dict.get('zones')) is not None: - args['zones'] = [ZoneReference.from_dict(v) for v in zones] + if 'zones' in _dict: + args['zones'] = [ZoneReference.from_dict(v) for v in _dict.get('zones')] else: raise ValueError('Required property \'zones\' not present in TSLocation JSON') return cls(**args) @@ -3659,10 +4088,10 @@ class TSLocationBasic: """ Details of a Transit Gateway location. - :param str billing_location: The geographical location of this location, used - for billing purposes. - :param str name: Name of the Location. - :param str type: The type of the location, determining is this a multi-zone + :attr str billing_location: The geographical location of this location, used for + billing purposes. + :attr str name: Name of the Location. + :attr str type: The type of the location, determining is this a multi-zone region, a single data center, or a point of presence. """ @@ -3689,16 +4118,16 @@ def __init__( def from_dict(cls, _dict: Dict) -> 'TSLocationBasic': """Initialize a TSLocationBasic object from a json dictionary.""" args = {} - if (billing_location := _dict.get('billing_location')) is not None: - args['billing_location'] = billing_location + if 'billing_location' in _dict: + args['billing_location'] = _dict.get('billing_location') else: raise ValueError('Required property \'billing_location\' not present in TSLocationBasic JSON') - if (name := _dict.get('name')) is not None: - args['name'] = name + if 'name' in _dict: + args['name'] = _dict.get('name') else: raise ValueError('Required property \'name\' not present in TSLocationBasic JSON') - if (type := _dict.get('type')) is not None: - args['type'] = type + if 'type' in _dict: + args['type'] = _dict.get('type') else: raise ValueError('Required property \'type\' not present in TSLocationBasic JSON') return cls(**args) @@ -3742,64 +4171,68 @@ class TransitConnection: """ Connection included in transit gateway. - :param str base_network_type: (optional) The type of network the GRE tunnel is + :attr str base_network_type: (optional) The type of network the GRE tunnel is targeting. - :param str name: The user-defined name for this transit gateway connection. - :param str network_id: (optional) The ID of the network being connected via this + :attr str name: The user-defined name for this transit gateway connection. + :attr str network_id: (optional) The ID of the network being connected via this connection. This field is required for some types, such as `vpc`, - `power_virtual_server`, `directlink`, `vpn_gateway` and `redundant_gre`. For - network types `vpc`, `redundant_gre`, `power_virtual_server` and `directlink` - this is the CRN of the VPC / PowerVS / VDC / Direct Link gateway respectively. - :param str network_type: Defines what type of network is connected via this + `power_virtual_server`, `directlink`, `vpn_gateway`, `dynamic_route_server` and + `redundant_gre`. For network types `vpc`, `vpn_gateway`, `dynamic_route_server`, + `power_virtual_server` and `directlink` this is the CRN of the VPC / VPN / + Dynamic Route Server / PowerVS / Direct Link gateway respectively. + :attr str network_type: Defines what type of network is connected via this connection. The list of enumerated values for this property may expand in the future. Code and processes using this field must tolerate unexpected values. - :param str id: The unique identifier for this Transit Gateway connection. - :param str base_connection_id: (optional) Deprecated: network_type `gre_tunnel` + :attr str id: The unique identifier for this Transit Gateway connection. + :attr str base_connection_id: (optional) Deprecated: network_type `gre_tunnel` connections use `base_connection_id` to specify the ID of a network_type `classic` connection the tunnel is configured over. The specified connection must reside in the same transit gateway and be in an active state. The `classic` connection cannot be deleted until any `gre_tunnel` connections using it are deleted. This field only applies to and is required for network type `gre_tunnel` connections. - :param datetime created_at: The date and time that this connection was created. - :param int local_bgp_asn: (optional) Local network BGP ASN. This field only + :attr str cidr: (optional) network_type `vpn_gateway` and `dynamic_route_server` + connections use `cidr` to specify the CIDR to use for the `VPN gateway / Dynamic + route server` GRE tunnels. + :attr datetime created_at: The date and time that this connection was created. + :attr int local_bgp_asn: (optional) Local network BGP ASN. This field only applies to network type `gre_tunnel` and `unbound_gre_tunnel` connections. - :param str local_gateway_ip: (optional) Local gateway IP address. This field + :attr str local_gateway_ip: (optional) Local gateway IP address. This field only applies to network type `gre_tunnel` and `unbound_gre_tunnel` connections. - :param str local_tunnel_ip: (optional) Local tunnel IP address. This field only + :attr str local_tunnel_ip: (optional) Local tunnel IP address. This field only applies to network type `gre_tunnel` and `unbound_gre_tunnel` connections. - :param int mtu: (optional) GRE tunnel MTU. This field only applies to network + :attr int mtu: (optional) GRE tunnel MTU. This field only applies to network type `gre_tunnel` and `unbound_gre_tunnel` connections. - :param str network_account_id: (optional) The ID of the account which owns the + :attr str network_account_id: (optional) The ID of the account which owns the connected network. Generally only used if the network is in a different IBM Cloud account than the gateway. - :param List[TransitGatewayConnectionPrefixFilterReference] prefix_filters: + :attr List[TransitGatewayConnectionPrefixFilterReference] prefix_filters: (optional) Array of prefix route filters for a transit gateway connection. This is order dependent with those first in the array being applied first, and those at the end of the array is applied last, or just before the default. This field does not apply to the `redundant_gre` network types. - :param str prefix_filters_default: (optional) Default setting of permit or deny + :attr str prefix_filters_default: (optional) Default setting of permit or deny which applies to any routes that don't match a specified filter. This field does not apply to the `redundant_gre` network types. - :param int remote_bgp_asn: (optional) Remote network BGP ASN. This field only + :attr int remote_bgp_asn: (optional) Remote network BGP ASN. This field only applies to network type `gre_tunnel` and `unbound_gre_tunnel` connections. - :param str remote_gateway_ip: (optional) Remote gateway IP address. This field + :attr str remote_gateway_ip: (optional) Remote gateway IP address. This field only applies to network type `gre_tunnel` and `unbound_gre_tunnel` connections. - :param str remote_tunnel_ip: (optional) Remote tunnel IP address. This field + :attr str remote_tunnel_ip: (optional) Remote tunnel IP address. This field only applies to network type `gre_tunnel` and `unbound_gre_tunnel` connections. - :param str request_status: Only visible for cross account connections, this - field represents the status of a connection request between IBM Cloud accounts. - The list of enumerated values for this property may expand in the future. Code - and processes using this field must tolerate unexpected values. - :param str status: Connection's current configuration state. The list of + :attr str request_status: Only visible for cross account connections, this field + represents the status of a connection request between IBM Cloud accounts. The + list of enumerated values for this property may expand in the future. Code and + processes using this field must tolerate unexpected values. + :attr str status: Connection's current configuration state. The list of enumerated values for this property may expand in the future. Code and processes using this field must tolerate unexpected values. - :param TransitGatewayReference transit_gateway: Transit gateway reference. - :param List[TransitGatewayTunnel] tunnels: (optional) Collection of all tunnels - for `redundant_gre` and `vpn_gateway` connections. - :param datetime updated_at: The date and time that this connection was last + :attr TransitGatewayReference transit_gateway: Transit gateway reference. + :attr List[TransitGatewayTunnel] tunnels: (optional) Collection of all tunnels + for `redundant_gre`, `vpn_gateway` and `dynamic_route_server` connections. + :attr datetime updated_at: The date and time that this connection was last updated. - :param ZoneReference zone: (optional) Availability zone reference. + :attr ZoneReference zone: (optional) Availability zone reference. """ def __init__( @@ -3813,21 +4246,22 @@ def __init__( transit_gateway: 'TransitGatewayReference', updated_at: datetime, *, - base_network_type: Optional[str] = None, - network_id: Optional[str] = None, - base_connection_id: Optional[str] = None, - local_bgp_asn: Optional[int] = None, - local_gateway_ip: Optional[str] = None, - local_tunnel_ip: Optional[str] = None, - mtu: Optional[int] = None, - network_account_id: Optional[str] = None, - prefix_filters: Optional[List['TransitGatewayConnectionPrefixFilterReference']] = 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['TransitGatewayTunnel']] = None, - zone: Optional['ZoneReference'] = None, + base_network_type: str = None, + network_id: str = None, + base_connection_id: str = None, + cidr: str = None, + local_bgp_asn: int = None, + local_gateway_ip: str = None, + local_tunnel_ip: str = None, + mtu: int = None, + network_account_id: str = None, + prefix_filters: List['TransitGatewayConnectionPrefixFilterReference'] = None, + prefix_filters_default: str = None, + remote_bgp_asn: int = None, + remote_gateway_ip: str = None, + remote_tunnel_ip: str = None, + tunnels: List['TransitGatewayTunnel'] = None, + zone: 'ZoneReference' = None, ) -> None: """ Initialize a TransitConnection object. @@ -3855,10 +4289,11 @@ def __init__( is targeting. :param str network_id: (optional) The ID of the network being connected via this connection. This field is required for some types, such as `vpc`, - `power_virtual_server`, `directlink`, `vpn_gateway` and `redundant_gre`. - For network types `vpc`, `redundant_gre`, `power_virtual_server` and - `directlink` this is the CRN of the VPC / PowerVS / VDC / Direct Link - gateway respectively. + `power_virtual_server`, `directlink`, `vpn_gateway`, `dynamic_route_server` + and `redundant_gre`. For network types `vpc`, `vpn_gateway`, + `dynamic_route_server`, `power_virtual_server` and `directlink` this is the + CRN of the VPC / VPN / Dynamic Route Server / PowerVS / Direct Link gateway + respectively. :param str base_connection_id: (optional) Deprecated: network_type `gre_tunnel` connections use `base_connection_id` to specify the ID of a network_type `classic` connection the tunnel is configured over. The @@ -3866,6 +4301,9 @@ def __init__( active state. The `classic` connection cannot be deleted until any `gre_tunnel` connections using it are deleted. This field only applies to and is required for network type `gre_tunnel` connections. + :param str cidr: (optional) network_type `vpn_gateway` and + `dynamic_route_server` connections use `cidr` to specify the CIDR to use + for the `VPN gateway / Dynamic route server` GRE tunnels. :param int local_bgp_asn: (optional) Local network BGP ASN. This field only applies to network type `gre_tunnel` and `unbound_gre_tunnel` connections. @@ -3899,7 +4337,8 @@ def __init__( field only applies to network type `gre_tunnel` and `unbound_gre_tunnel` connections. :param List[TransitGatewayTunnel] tunnels: (optional) Collection of all - tunnels for `redundant_gre` and `vpn_gateway` connections. + tunnels for `redundant_gre`, `vpn_gateway` and `dynamic_route_server` + connections. :param ZoneReference zone: (optional) Availability zone reference. """ self.base_network_type = base_network_type @@ -3908,6 +4347,7 @@ def __init__( self.network_type = network_type self.id = id self.base_connection_id = base_connection_id + self.cidr = cidr self.created_at = created_at self.local_bgp_asn = local_bgp_asn self.local_gateway_ip = local_gateway_ip @@ -3930,68 +4370,70 @@ def __init__( def from_dict(cls, _dict: Dict) -> 'TransitConnection': """Initialize a TransitConnection object from a json dictionary.""" args = {} - if (base_network_type := _dict.get('base_network_type')) is not None: - args['base_network_type'] = base_network_type - if (name := _dict.get('name')) is not None: - args['name'] = name + if 'base_network_type' in _dict: + args['base_network_type'] = _dict.get('base_network_type') + if 'name' in _dict: + args['name'] = _dict.get('name') else: raise ValueError('Required property \'name\' not present in TransitConnection JSON') - if (network_id := _dict.get('network_id')) is not None: - args['network_id'] = network_id - if (network_type := _dict.get('network_type')) is not None: - args['network_type'] = network_type + if 'network_id' in _dict: + args['network_id'] = _dict.get('network_id') + if 'network_type' in _dict: + args['network_type'] = _dict.get('network_type') else: raise ValueError('Required property \'network_type\' not present in TransitConnection JSON') - if (id := _dict.get('id')) is not None: - args['id'] = id + if 'id' in _dict: + args['id'] = _dict.get('id') else: raise ValueError('Required property \'id\' not present in TransitConnection JSON') - if (base_connection_id := _dict.get('base_connection_id')) is not None: - args['base_connection_id'] = base_connection_id - if (created_at := _dict.get('created_at')) is not None: - args['created_at'] = string_to_datetime(created_at) + if 'base_connection_id' in _dict: + args['base_connection_id'] = _dict.get('base_connection_id') + if 'cidr' in _dict: + args['cidr'] = _dict.get('cidr') + if 'created_at' in _dict: + args['created_at'] = string_to_datetime(_dict.get('created_at')) else: raise ValueError('Required property \'created_at\' not present in TransitConnection JSON') - if (local_bgp_asn := _dict.get('local_bgp_asn')) is not None: - args['local_bgp_asn'] = local_bgp_asn - if (local_gateway_ip := _dict.get('local_gateway_ip')) is not None: - args['local_gateway_ip'] = local_gateway_ip - if (local_tunnel_ip := _dict.get('local_tunnel_ip')) is not None: - args['local_tunnel_ip'] = local_tunnel_ip - if (mtu := _dict.get('mtu')) is not None: - args['mtu'] = mtu - if (network_account_id := _dict.get('network_account_id')) is not None: - args['network_account_id'] = network_account_id - if (prefix_filters := _dict.get('prefix_filters')) is not None: - args['prefix_filters'] = [TransitGatewayConnectionPrefixFilterReference.from_dict(v) for v in prefix_filters] - if (prefix_filters_default := _dict.get('prefix_filters_default')) is not None: - args['prefix_filters_default'] = prefix_filters_default - if (remote_bgp_asn := _dict.get('remote_bgp_asn')) is not None: - args['remote_bgp_asn'] = remote_bgp_asn - if (remote_gateway_ip := _dict.get('remote_gateway_ip')) is not None: - args['remote_gateway_ip'] = remote_gateway_ip - if (remote_tunnel_ip := _dict.get('remote_tunnel_ip')) is not None: - args['remote_tunnel_ip'] = remote_tunnel_ip - if (request_status := _dict.get('request_status')) is not None: - args['request_status'] = request_status + if 'local_bgp_asn' in _dict: + args['local_bgp_asn'] = _dict.get('local_bgp_asn') + if 'local_gateway_ip' in _dict: + args['local_gateway_ip'] = _dict.get('local_gateway_ip') + if 'local_tunnel_ip' in _dict: + args['local_tunnel_ip'] = _dict.get('local_tunnel_ip') + if 'mtu' in _dict: + args['mtu'] = _dict.get('mtu') + if 'network_account_id' in _dict: + args['network_account_id'] = _dict.get('network_account_id') + if 'prefix_filters' in _dict: + args['prefix_filters'] = [TransitGatewayConnectionPrefixFilterReference.from_dict(v) for v in _dict.get('prefix_filters')] + if 'prefix_filters_default' in _dict: + args['prefix_filters_default'] = _dict.get('prefix_filters_default') + if 'remote_bgp_asn' in _dict: + args['remote_bgp_asn'] = _dict.get('remote_bgp_asn') + if 'remote_gateway_ip' in _dict: + args['remote_gateway_ip'] = _dict.get('remote_gateway_ip') + if 'remote_tunnel_ip' in _dict: + args['remote_tunnel_ip'] = _dict.get('remote_tunnel_ip') + if 'request_status' in _dict: + args['request_status'] = _dict.get('request_status') else: raise ValueError('Required property \'request_status\' not present in TransitConnection JSON') - if (status := _dict.get('status')) is not None: - args['status'] = status + if 'status' in _dict: + args['status'] = _dict.get('status') else: raise ValueError('Required property \'status\' not present in TransitConnection JSON') - if (transit_gateway := _dict.get('transit_gateway')) is not None: - args['transit_gateway'] = TransitGatewayReference.from_dict(transit_gateway) + if 'transit_gateway' in _dict: + args['transit_gateway'] = TransitGatewayReference.from_dict(_dict.get('transit_gateway')) else: raise ValueError('Required property \'transit_gateway\' not present in TransitConnection JSON') - if (tunnels := _dict.get('tunnels')) is not None: - args['tunnels'] = [TransitGatewayTunnel.from_dict(v) for v in tunnels] - if (updated_at := _dict.get('updated_at')) is not None: - args['updated_at'] = string_to_datetime(updated_at) + if 'tunnels' in _dict: + args['tunnels'] = [TransitGatewayTunnel.from_dict(v) for v in _dict.get('tunnels')] + if 'updated_at' in _dict: + args['updated_at'] = string_to_datetime(_dict.get('updated_at')) else: raise ValueError('Required property \'updated_at\' not present in TransitConnection JSON') - if (zone := _dict.get('zone')) is not None: - args['zone'] = ZoneReference.from_dict(zone) + if 'zone' in _dict: + args['zone'] = ZoneReference.from_dict(_dict.get('zone')) return cls(**args) @classmethod @@ -4014,6 +4456,8 @@ def to_dict(self) -> Dict: _dict['id'] = self.id if hasattr(self, 'base_connection_id') and self.base_connection_id is not None: _dict['base_connection_id'] = self.base_connection_id + if hasattr(self, 'cidr') and self.cidr is not None: + _dict['cidr'] = self.cidr if hasattr(self, 'created_at') and self.created_at is not None: _dict['created_at'] = datetime_to_string(self.created_at) if hasattr(self, 'local_bgp_asn') and self.local_bgp_asn is not None: @@ -4093,7 +4537,6 @@ class BaseNetworkTypeEnum(str, Enum): CLASSIC = 'classic' VPC = 'vpc' - VPN = 'vpn' class NetworkTypeEnum(str, Enum): @@ -4111,6 +4554,7 @@ class NetworkTypeEnum(str, Enum): POWER_VIRTUAL_SERVER = 'power_virtual_server' REDUNDANT_GRE = 'redundant_gre' VPN_GATEWAY = 'vpn_gateway' + DYNAMIC_ROUTE_SERVER = 'dynamic_route_server' class PrefixFiltersDefaultEnum(str, Enum): @@ -4162,12 +4606,11 @@ class TransitConnectionCollection: """ Transit gateway connections. - :param List[TransitConnection] connections: Array of transit gateway - connections. - :param PaginationFirstConnection first: A reference to the first page of + :attr List[TransitConnection] connections: Array of transit gateway connections. + :attr PaginationFirstConnection first: A reference to the first page of resources. - :param int limit: The maximum number of connections returned on one request. - :param PaginationNextConnection next: (optional) A reference to the next page of + :attr int limit: The maximum number of connections returned on one request. + :attr PaginationNextConnection next: (optional) A reference to the next page of resources; this reference is included for all pages except the last page. """ @@ -4177,7 +4620,7 @@ def __init__( first: 'PaginationFirstConnection', limit: int, *, - next: Optional['PaginationNextConnection'] = None, + next: 'PaginationNextConnection' = None, ) -> None: """ Initialize a TransitConnectionCollection object. @@ -4201,20 +4644,20 @@ def __init__( def from_dict(cls, _dict: Dict) -> 'TransitConnectionCollection': """Initialize a TransitConnectionCollection object from a json dictionary.""" args = {} - if (connections := _dict.get('connections')) is not None: - args['connections'] = [TransitConnection.from_dict(v) for v in connections] + if 'connections' in _dict: + args['connections'] = [TransitConnection.from_dict(v) for v in _dict.get('connections')] else: raise ValueError('Required property \'connections\' not present in TransitConnectionCollection JSON') - if (first := _dict.get('first')) is not None: - args['first'] = PaginationFirstConnection.from_dict(first) + if 'first' in _dict: + args['first'] = PaginationFirstConnection.from_dict(_dict.get('first')) else: raise ValueError('Required property \'first\' not present in TransitConnectionCollection JSON') - if (limit := _dict.get('limit')) is not None: - args['limit'] = limit + if 'limit' in _dict: + args['limit'] = _dict.get('limit') else: raise ValueError('Required property \'limit\' not present in TransitConnectionCollection JSON') - if (next := _dict.get('next')) is not None: - args['next'] = PaginationNextConnection.from_dict(next) + if 'next' in _dict: + args['next'] = PaginationNextConnection.from_dict(_dict.get('next')) return cls(**args) @classmethod @@ -4270,27 +4713,32 @@ class TransitGateway: """ Details of a Transit Gateway. - :param int connection_count: (optional) The number of connections associated - with this Transit Gateway. - :param bool connection_needs_attention: Indicates if this Transit Gateway has a + :attr int connection_count: (optional) The number of connections associated with + this Transit Gateway. + :attr bool connection_needs_attention: Indicates if this Transit Gateway has a connection that needs attention (Such as cross account approval). - :param datetime created_at: The date and time that this gateway was created. - :param str crn: (optional) Cloud Resource Name of a transit gateway. - :param bool global_: Allow global routing for a Transit Gateway. - :param bool gre_enhanced_route_propagation: Allow route propagation across all + :attr datetime created_at: The date and time that this gateway was created. + :attr str crn: (optional) Cloud Resource Name of a transit gateway. + :attr bool global_: Allow global routing for a Transit Gateway. + :attr bool gre_enhanced_route_propagation: 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`. - :param str id: A unique identifier for this transit gateway. - :param str location: Location of Transit Gateway Services. - :param str name: A human readable name for the transit gateway. - :param ResourceGroupReference resource_group: (optional) The resource group to + :attr str id: A unique identifier for this transit gateway. + :attr str location: Location of Transit Gateway Services. + :attr str name: A human readable name for the transit gateway. + :attr str redundancy_group: (optional) The redundancy group for this global + transit gateway. The global transit gateways in this redundancy group will be + redundant to each other. + :attr str redundancy_group_id: (optional) The unique identifier of the + redundancy group for this global transit gateway. + :attr ResourceGroupReference resource_group: (optional) The resource group to use. If unspecified, the account's [default resource group](https://console.bluemix.net/apidocs/resource-manager#introduction) is used. - :param str status: The status of the Transit Gateway. The list of enumerated + :attr str status: The status of the Transit Gateway. The list of enumerated values for this property may expand in the future. Code and processes using this field must tolerate unexpected values. - :param datetime updated_at: (optional) The date and time that this gateway was + :attr datetime updated_at: (optional) The date and time that this gateway was last updated. """ @@ -4305,10 +4753,12 @@ def __init__( name: str, status: str, *, - connection_count: Optional[int] = None, - crn: Optional[str] = None, - resource_group: Optional['ResourceGroupReference'] = None, - updated_at: Optional[datetime] = None, + connection_count: int = None, + crn: str = None, + redundancy_group: str = None, + redundancy_group_id: str = None, + resource_group: 'ResourceGroupReference' = None, + updated_at: datetime = None, ) -> None: """ Initialize a TransitGateway object. @@ -4330,6 +4780,11 @@ def __init__( :param int connection_count: (optional) The number of connections associated with this Transit Gateway. :param str crn: (optional) Cloud Resource Name of a transit gateway. + :param str redundancy_group: (optional) The redundancy group for this + global transit gateway. The global transit gateways in this redundancy + group will be redundant to each other. + :param str redundancy_group_id: (optional) The unique identifier of the + redundancy group for this global transit gateway. :param ResourceGroupReference resource_group: (optional) The resource group to use. If unspecified, the account's [default resource group](https://console.bluemix.net/apidocs/resource-manager#introduction) @@ -4346,6 +4801,8 @@ def __init__( self.id = id self.location = location self.name = name + self.redundancy_group = redundancy_group + self.redundancy_group_id = redundancy_group_id self.resource_group = resource_group self.status = status self.updated_at = updated_at @@ -4354,46 +4811,50 @@ def __init__( def from_dict(cls, _dict: Dict) -> 'TransitGateway': """Initialize a TransitGateway object from a json dictionary.""" args = {} - if (connection_count := _dict.get('connection_count')) is not None: - args['connection_count'] = connection_count - if (connection_needs_attention := _dict.get('connection_needs_attention')) is not None: - args['connection_needs_attention'] = connection_needs_attention + if 'connection_count' in _dict: + args['connection_count'] = _dict.get('connection_count') + if 'connection_needs_attention' in _dict: + args['connection_needs_attention'] = _dict.get('connection_needs_attention') else: raise ValueError('Required property \'connection_needs_attention\' not present in TransitGateway JSON') - if (created_at := _dict.get('created_at')) is not None: - args['created_at'] = string_to_datetime(created_at) + if 'created_at' in _dict: + args['created_at'] = string_to_datetime(_dict.get('created_at')) else: raise ValueError('Required property \'created_at\' not present in TransitGateway JSON') - if (crn := _dict.get('crn')) is not None: - args['crn'] = crn - if (global_ := _dict.get('global')) is not None: - args['global_'] = global_ + if 'crn' in _dict: + args['crn'] = _dict.get('crn') + if 'global' in _dict: + args['global_'] = _dict.get('global') else: raise ValueError('Required property \'global\' not present in TransitGateway JSON') - if (gre_enhanced_route_propagation := _dict.get('gre_enhanced_route_propagation')) is not None: - args['gre_enhanced_route_propagation'] = gre_enhanced_route_propagation + if 'gre_enhanced_route_propagation' in _dict: + args['gre_enhanced_route_propagation'] = _dict.get('gre_enhanced_route_propagation') else: raise ValueError('Required property \'gre_enhanced_route_propagation\' not present in TransitGateway JSON') - if (id := _dict.get('id')) is not None: - args['id'] = id + if 'id' in _dict: + args['id'] = _dict.get('id') else: raise ValueError('Required property \'id\' not present in TransitGateway JSON') - if (location := _dict.get('location')) is not None: - args['location'] = location + if 'location' in _dict: + args['location'] = _dict.get('location') else: raise ValueError('Required property \'location\' not present in TransitGateway JSON') - if (name := _dict.get('name')) is not None: - args['name'] = name + if 'name' in _dict: + args['name'] = _dict.get('name') else: raise ValueError('Required property \'name\' not present in TransitGateway JSON') - if (resource_group := _dict.get('resource_group')) is not None: - args['resource_group'] = ResourceGroupReference.from_dict(resource_group) - if (status := _dict.get('status')) is not None: - args['status'] = status + if 'redundancy_group' in _dict: + args['redundancy_group'] = _dict.get('redundancy_group') + if 'redundancy_group_id' in _dict: + args['redundancy_group_id'] = _dict.get('redundancy_group_id') + if 'resource_group' in _dict: + args['resource_group'] = ResourceGroupReference.from_dict(_dict.get('resource_group')) + if 'status' in _dict: + args['status'] = _dict.get('status') else: raise ValueError('Required property \'status\' not present in TransitGateway JSON') - if (updated_at := _dict.get('updated_at')) is not None: - args['updated_at'] = string_to_datetime(updated_at) + if 'updated_at' in _dict: + args['updated_at'] = string_to_datetime(_dict.get('updated_at')) return cls(**args) @classmethod @@ -4422,6 +4883,10 @@ def to_dict(self) -> Dict: _dict['location'] = self.location if hasattr(self, 'name') and self.name is not None: _dict['name'] = self.name + if hasattr(self, 'redundancy_group') and self.redundancy_group is not None: + _dict['redundancy_group'] = self.redundancy_group + if hasattr(self, 'redundancy_group_id') and self.redundancy_group_id is not None: + _dict['redundancy_group_id'] = self.redundancy_group_id if hasattr(self, 'resource_group') and self.resource_group is not None: if isinstance(self.resource_group, dict): _dict['resource_group'] = self.resource_group @@ -4471,11 +4936,11 @@ class TransitGatewayCollection: """ A list of Transit Gateways. - :param PaginationFirstTG first: A reference to the first page of resources. - :param int limit: The maximum number of gateways returned on one request. - :param PaginationNextTG next: (optional) A reference to the next page of + :attr PaginationFirstTG first: A reference to the first page of resources. + :attr int limit: The maximum number of gateways returned on one request. + :attr PaginationNextTG next: (optional) A reference to the next page of resources; this reference is included for all pages except the last page. - :param List[TransitGateway] transit_gateways: Collection of Transit Services + :attr List[TransitGateway] transit_gateways: Collection of Transit Services gateways. """ @@ -4485,7 +4950,7 @@ def __init__( limit: int, transit_gateways: List['TransitGateway'], *, - next: Optional['PaginationNextTG'] = None, + next: 'PaginationNextTG' = None, ) -> None: """ Initialize a TransitGatewayCollection object. @@ -4506,18 +4971,18 @@ def __init__( def from_dict(cls, _dict: Dict) -> 'TransitGatewayCollection': """Initialize a TransitGatewayCollection object from a json dictionary.""" args = {} - if (first := _dict.get('first')) is not None: - args['first'] = PaginationFirstTG.from_dict(first) + if 'first' in _dict: + args['first'] = PaginationFirstTG.from_dict(_dict.get('first')) else: raise ValueError('Required property \'first\' not present in TransitGatewayCollection JSON') - if (limit := _dict.get('limit')) is not None: - args['limit'] = limit + if 'limit' in _dict: + args['limit'] = _dict.get('limit') else: raise ValueError('Required property \'limit\' not present in TransitGatewayCollection JSON') - if (next := _dict.get('next')) is not None: - args['next'] = PaginationNextTG.from_dict(next) - if (transit_gateways := _dict.get('transit_gateways')) is not None: - args['transit_gateways'] = [TransitGateway.from_dict(v) for v in transit_gateways] + if 'next' in _dict: + args['next'] = PaginationNextTG.from_dict(_dict.get('next')) + if 'transit_gateways' in _dict: + args['transit_gateways'] = [TransitGateway.from_dict(v) for v in _dict.get('transit_gateways')] else: raise ValueError('Required property \'transit_gateways\' not present in TransitGatewayCollection JSON') return cls(**args) @@ -4575,18 +5040,18 @@ class TransitGatewayConnectionCollection: """ A set of Transit Gateway network connections. - :param List[TransitGatewayConnectionCust] connections: Array of transit gateways + :attr List[TransitGatewayConnectionCust] connections: Array of transit gateways network Connections. - :param PaginationFirstTGWConnection first: A reference to the first page of + :attr PaginationFirstTGWConnection first: A reference to the first page of resources. This will be returned when number of connections in response are greater than max page limit. - :param int limit: The maximum number of connections returned on one request. - This will be returned when number of connections in response are greater than - max page limit. - :param PaginationNextTGWConnection next: (optional) A reference to the next page + :attr int limit: The maximum number of connections returned on one request. This + will be returned when number of connections in response are greater than max + page limit. + :attr PaginationNextTGWConnection next: (optional) A reference to the next page of resources; this reference is included for all pages except the last page. - :param int total_count: total number of resources across all pages (considering + :attr int total_count: total number of resources across all pages (considering the supplied query parameter filters). """ @@ -4597,7 +5062,7 @@ def __init__( limit: int, total_count: int, *, - next: Optional['PaginationNextTGWConnection'] = None, + next: 'PaginationNextTGWConnection' = None, ) -> None: """ Initialize a TransitGatewayConnectionCollection object. @@ -4627,22 +5092,22 @@ def __init__( def from_dict(cls, _dict: Dict) -> 'TransitGatewayConnectionCollection': """Initialize a TransitGatewayConnectionCollection object from a json dictionary.""" args = {} - if (connections := _dict.get('connections')) is not None: - args['connections'] = [TransitGatewayConnectionCust.from_dict(v) for v in connections] + if 'connections' in _dict: + args['connections'] = [TransitGatewayConnectionCust.from_dict(v) for v in _dict.get('connections')] else: raise ValueError('Required property \'connections\' not present in TransitGatewayConnectionCollection JSON') - if (first := _dict.get('first')) is not None: - args['first'] = PaginationFirstTGWConnection.from_dict(first) + if 'first' in _dict: + args['first'] = PaginationFirstTGWConnection.from_dict(_dict.get('first')) else: raise ValueError('Required property \'first\' not present in TransitGatewayConnectionCollection JSON') - if (limit := _dict.get('limit')) is not None: - args['limit'] = limit + if 'limit' in _dict: + args['limit'] = _dict.get('limit') else: raise ValueError('Required property \'limit\' not present in TransitGatewayConnectionCollection JSON') - if (next := _dict.get('next')) is not None: - args['next'] = PaginationNextTGWConnection.from_dict(next) - if (total_count := _dict.get('total_count')) is not None: - args['total_count'] = total_count + if 'next' in _dict: + args['next'] = PaginationNextTGWConnection.from_dict(_dict.get('next')) + if 'total_count' in _dict: + args['total_count'] = _dict.get('total_count') else: raise ValueError('Required property \'total_count\' not present in TransitGatewayConnectionCollection JSON') return cls(**args) @@ -4702,77 +5167,80 @@ class TransitGatewayConnectionCust: """ Connection included in transit gateway. - :param str base_connection_id: (optional) Deprecated: network_type `gre_tunnel` + :attr str base_connection_id: (optional) Deprecated: network_type `gre_tunnel` connections use `base_connection_id` to specify the ID of a network_type `classic` connection the tunnel is configured over. The specified connection must reside in the same transit gateway and be in an active state. The `classic` connection cannot be deleted until any `gre_tunnel` connections using it are deleted. This field only applies to and is required for network type `gre_tunnel` connections. - :param str base_network_type: (optional) The type of network the Unbound GRE + :attr str base_network_type: (optional) 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. - :param str cidr: (optional) network_type 'vpn_gateway' connections use 'cidr' to - specify the CIDR to use for the VPN GRE tunnels. - :param datetime created_at: The date and time that this connection was created. - :param str id: The unique identifier for this Transit Gateway connection. - :param int local_bgp_asn: (optional) Local network BGP ASN. This field only + `power_virtual_server`, `vpn_gateway`, `dynamic_route_server` and `gre_tunnel` + connections. + :attr str cidr: (optional) network_type `vpn_gateway` and `dynamic_route_server` + connections use `cidr` to specify the CIDR to use for the `VPN gateway / Dynamic + route server` GRE tunnels. + :attr datetime created_at: The date and time that this connection was created. + :attr str id: The unique identifier for this Transit Gateway connection. + :attr int local_bgp_asn: (optional) Local network BGP ASN. This field only applies to network type `gre_tunnel` and `unbound_gre_tunnel` connections. - :param str local_gateway_ip: (optional) Local gateway IP address. This field + :attr str local_gateway_ip: (optional) Local gateway IP address. This field only applies to network type `gre_tunnel` and `unbound_gre_tunnel` connections. - :param str local_tunnel_ip: (optional) Local tunnel IP address. This field only + :attr str local_tunnel_ip: (optional) Local tunnel IP address. This field only applies to network type `gre_tunnel` and `unbound_gre_tunnel` connections. - :param int mtu: (optional) GRE tunnel MTU. This field only applies to network + :attr int mtu: (optional) GRE tunnel MTU. This field only applies to network type `gre_tunnel` and `unbound_gre_tunnel` connections. - :param str name: (optional) The user-defined name for this transit gateway + :attr str name: (optional) 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. + `gre_tunnel`, `unbound_gre_tunnel`, `vpn_gateway`, `dynamic_route_server` and + `redundant_gre` connections. This field is optional for network type `classic`, `vpc` connections. - :param str network_account_id: (optional) The ID of the account which owns the + :attr str network_account_id: (optional) The ID of the account which owns the connected network. Generally only used if the network is in a different IBM Cloud account than the gateway. - :param str network_id: (optional) 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. - :param str network_type: (optional) Defines what type of network is connected - via this connection. - :param List[TransitGatewayConnectionPrefixFilterReference] prefix_filters: + :attr str network_id: (optional) The ID of the network being connected via this + connection. For network types `vpc`, `vpn_gateway`, `dynamic_route_server`, + `power_virtual_server` and `directlink` this is the CRN of the VPC / VPN / + Dynamic Route Server / PowerVS / Direct Link gateway respectively. This field is + required for network type `vpc`, `power_virtual_server`, `vpn_gateway`, + `dynamic_route_server` 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. + :attr str network_type: (optional) Defines what type of network is connected via + this connection. + :attr List[TransitGatewayConnectionPrefixFilterReference] prefix_filters: (optional) Array of prefix route filters for a transit gateway connection. This is order dependent with those first in the array being applied first, and those at the end of the array is applied last, or just before the default. This field does not apply to the `redundant_gre` network type. - :param str prefix_filters_default: (optional) Default setting of permit or deny + :attr str prefix_filters_default: (optional) Default setting of permit or deny which applies to any routes that don't match a specified filter. This field does not apply to the `redundant_gre` network type. - :param int remote_bgp_asn: (optional) Remote network BGP ASN. This field only + :attr int remote_bgp_asn: (optional) Remote network BGP ASN. This field only applies to network type `gre_tunnel` and `unbound_gre_tunnel` connections. - :param str remote_gateway_ip: (optional) Remote gateway IP address. This field + :attr str remote_gateway_ip: (optional) Remote gateway IP address. This field only applies to network type `gre_tunnel` and `unbound_gre_tunnel` connections. - :param str remote_tunnel_ip: (optional) Remote tunnel IP address. This field + :attr str remote_tunnel_ip: (optional) Remote tunnel IP address. This field only applies to network type `gre_tunnel` and `unbound_gre_tunnel` connections. - :param str request_status: Only visible for cross account connections, this - field represents the status of a connection request between IBM Cloud accounts. - The list of enumerated values for this property may expand in the future. Code - and processes using this field must tolerate unexpected values. - :param str status: Connection's current configuration state. The list of + :attr str request_status: Only visible for cross account connections, this field + represents the status of a connection request between IBM Cloud accounts. The + list of enumerated values for this property may expand in the future. Code and + processes using this field must tolerate unexpected values. + :attr str status: Connection's current configuration state. The list of enumerated values for this property may expand in the future. Code and processes using this field must tolerate unexpected values. - :param List[TransitGatewayTunnel] tunnels: (optional) Collection of all tunnels - for `redundant_gre` and `vpn_gateway` connections. - :param datetime updated_at: The date and time that this connection was last + :attr List[TransitGatewayTunnel] tunnels: (optional) Collection of all tunnels + for `redundant_gre`, `vpn_gateway` and `dynamic_route_server` connections. + :attr datetime updated_at: The date and time that this connection was last updated. - :param ZoneReference zone: (optional) Location of GRE tunnel. This field is + :attr ZoneReference zone: (optional) Location of GRE tunnel. This field is required for network type `gre_tunnel` and `unbound_gre_tunnel` connections. This field is optional for network type `vpn_gateway` connections. """ @@ -4785,24 +5253,24 @@ def __init__( status: str, updated_at: datetime, *, - base_connection_id: Optional[str] = None, - base_network_type: Optional[str] = None, - cidr: Optional[str] = None, - local_bgp_asn: Optional[int] = None, - local_gateway_ip: Optional[str] = None, - local_tunnel_ip: Optional[str] = None, - mtu: Optional[int] = None, - name: Optional[str] = None, - network_account_id: Optional[str] = None, - network_id: Optional[str] = None, - network_type: Optional[str] = None, - prefix_filters: Optional[List['TransitGatewayConnectionPrefixFilterReference']] = 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['TransitGatewayTunnel']] = None, - zone: Optional['ZoneReference'] = None, + base_connection_id: str = None, + base_network_type: str = None, + cidr: str = None, + local_bgp_asn: int = None, + local_gateway_ip: str = None, + local_tunnel_ip: str = None, + mtu: int = None, + name: str = None, + network_account_id: str = None, + network_id: str = None, + network_type: str = None, + prefix_filters: List['TransitGatewayConnectionPrefixFilterReference'] = None, + prefix_filters_default: str = None, + remote_bgp_asn: int = None, + remote_gateway_ip: str = None, + remote_tunnel_ip: str = None, + tunnels: List['TransitGatewayTunnel'] = None, + zone: 'ZoneReference' = None, ) -> None: """ Initialize a TransitGatewayConnectionCust object. @@ -4832,10 +5300,11 @@ def __init__( `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. - :param str cidr: (optional) network_type 'vpn_gateway' connections use - 'cidr' to specify the CIDR to use for the VPN GRE tunnels. + `directlink`, `vpc`, `power_virtual_server`, `vpn_gateway`, + `dynamic_route_server` and `gre_tunnel` connections. + :param str cidr: (optional) network_type `vpn_gateway` and + `dynamic_route_server` connections use `cidr` to specify the CIDR to use + for the `VPN gateway / Dynamic route server` GRE tunnels. :param int local_bgp_asn: (optional) Local network BGP ASN. This field only applies to network type `gre_tunnel` and `unbound_gre_tunnel` connections. @@ -4851,21 +5320,22 @@ def __init__( 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. + `directlink`, `gre_tunnel`, `unbound_gre_tunnel`, `vpn_gateway`, + `dynamic_route_server` and `redundant_gre` connections. This field is optional for network type `classic`, `vpc` connections. :param str network_account_id: (optional) The ID of the account which owns the connected network. Generally only used if the network is in a different IBM Cloud account than the gateway. :param str network_id: (optional) 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. + this connection. For network types `vpc`, `vpn_gateway`, + `dynamic_route_server`, `power_virtual_server` and `directlink` this is the + CRN of the VPC / VPN / Dynamic Route Server / PowerVS / Direct Link gateway + respectively. This field is required for network type `vpc`, + `power_virtual_server`, `vpn_gateway`, `dynamic_route_server` 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. :param str network_type: (optional) Defines what type of network is connected via this connection. :param List[TransitGatewayConnectionPrefixFilterReference] prefix_filters: @@ -4886,7 +5356,8 @@ def __init__( field only applies to network type `gre_tunnel` and `unbound_gre_tunnel` connections. :param List[TransitGatewayTunnel] tunnels: (optional) Collection of all - tunnels for `redundant_gre` and `vpn_gateway` connections. + tunnels for `redundant_gre`, `vpn_gateway` and `dynamic_route_server` + connections. :param ZoneReference zone: (optional) Location of GRE tunnel. This field is required for network type `gre_tunnel` and `unbound_gre_tunnel` connections. @@ -4920,62 +5391,62 @@ def __init__( def from_dict(cls, _dict: Dict) -> 'TransitGatewayConnectionCust': """Initialize a TransitGatewayConnectionCust object from a json dictionary.""" args = {} - if (base_connection_id := _dict.get('base_connection_id')) is not None: - args['base_connection_id'] = base_connection_id - if (base_network_type := _dict.get('base_network_type')) is not None: - args['base_network_type'] = base_network_type - if (cidr := _dict.get('cidr')) is not None: - args['cidr'] = cidr - if (created_at := _dict.get('created_at')) is not None: - args['created_at'] = string_to_datetime(created_at) + if 'base_connection_id' in _dict: + args['base_connection_id'] = _dict.get('base_connection_id') + if 'base_network_type' in _dict: + args['base_network_type'] = _dict.get('base_network_type') + if 'cidr' in _dict: + args['cidr'] = _dict.get('cidr') + if 'created_at' in _dict: + args['created_at'] = string_to_datetime(_dict.get('created_at')) else: raise ValueError('Required property \'created_at\' not present in TransitGatewayConnectionCust JSON') - if (id := _dict.get('id')) is not None: - args['id'] = id + if 'id' in _dict: + args['id'] = _dict.get('id') else: raise ValueError('Required property \'id\' not present in TransitGatewayConnectionCust JSON') - if (local_bgp_asn := _dict.get('local_bgp_asn')) is not None: - args['local_bgp_asn'] = local_bgp_asn - if (local_gateway_ip := _dict.get('local_gateway_ip')) is not None: - args['local_gateway_ip'] = local_gateway_ip - if (local_tunnel_ip := _dict.get('local_tunnel_ip')) is not None: - args['local_tunnel_ip'] = local_tunnel_ip - if (mtu := _dict.get('mtu')) is not None: - args['mtu'] = mtu - if (name := _dict.get('name')) is not None: - args['name'] = name - if (network_account_id := _dict.get('network_account_id')) is not None: - args['network_account_id'] = network_account_id - if (network_id := _dict.get('network_id')) is not None: - args['network_id'] = network_id - if (network_type := _dict.get('network_type')) is not None: - args['network_type'] = network_type - if (prefix_filters := _dict.get('prefix_filters')) is not None: - args['prefix_filters'] = [TransitGatewayConnectionPrefixFilterReference.from_dict(v) for v in prefix_filters] - if (prefix_filters_default := _dict.get('prefix_filters_default')) is not None: - args['prefix_filters_default'] = prefix_filters_default - if (remote_bgp_asn := _dict.get('remote_bgp_asn')) is not None: - args['remote_bgp_asn'] = remote_bgp_asn - if (remote_gateway_ip := _dict.get('remote_gateway_ip')) is not None: - args['remote_gateway_ip'] = remote_gateway_ip - if (remote_tunnel_ip := _dict.get('remote_tunnel_ip')) is not None: - args['remote_tunnel_ip'] = remote_tunnel_ip - if (request_status := _dict.get('request_status')) is not None: - args['request_status'] = request_status + if 'local_bgp_asn' in _dict: + args['local_bgp_asn'] = _dict.get('local_bgp_asn') + if 'local_gateway_ip' in _dict: + args['local_gateway_ip'] = _dict.get('local_gateway_ip') + if 'local_tunnel_ip' in _dict: + args['local_tunnel_ip'] = _dict.get('local_tunnel_ip') + if 'mtu' in _dict: + args['mtu'] = _dict.get('mtu') + if 'name' in _dict: + args['name'] = _dict.get('name') + if 'network_account_id' in _dict: + args['network_account_id'] = _dict.get('network_account_id') + if 'network_id' in _dict: + args['network_id'] = _dict.get('network_id') + if 'network_type' in _dict: + args['network_type'] = _dict.get('network_type') + if 'prefix_filters' in _dict: + args['prefix_filters'] = [TransitGatewayConnectionPrefixFilterReference.from_dict(v) for v in _dict.get('prefix_filters')] + if 'prefix_filters_default' in _dict: + args['prefix_filters_default'] = _dict.get('prefix_filters_default') + if 'remote_bgp_asn' in _dict: + args['remote_bgp_asn'] = _dict.get('remote_bgp_asn') + if 'remote_gateway_ip' in _dict: + args['remote_gateway_ip'] = _dict.get('remote_gateway_ip') + if 'remote_tunnel_ip' in _dict: + args['remote_tunnel_ip'] = _dict.get('remote_tunnel_ip') + if 'request_status' in _dict: + args['request_status'] = _dict.get('request_status') else: raise ValueError('Required property \'request_status\' not present in TransitGatewayConnectionCust JSON') - if (status := _dict.get('status')) is not None: - args['status'] = status + if 'status' in _dict: + args['status'] = _dict.get('status') else: raise ValueError('Required property \'status\' not present in TransitGatewayConnectionCust JSON') - if (tunnels := _dict.get('tunnels')) is not None: - args['tunnels'] = [TransitGatewayTunnel.from_dict(v) for v in tunnels] - if (updated_at := _dict.get('updated_at')) is not None: - args['updated_at'] = string_to_datetime(updated_at) + if 'tunnels' in _dict: + args['tunnels'] = [TransitGatewayTunnel.from_dict(v) for v in _dict.get('tunnels')] + if 'updated_at' in _dict: + args['updated_at'] = string_to_datetime(_dict.get('updated_at')) else: raise ValueError('Required property \'updated_at\' not present in TransitGatewayConnectionCust JSON') - if (zone := _dict.get('zone')) is not None: - args['zone'] = ZoneReference.from_dict(zone) + if 'zone' in _dict: + args['zone'] = ZoneReference.from_dict(_dict.get('zone')) return cls(**args) @classmethod @@ -5073,13 +5544,12 @@ class BaseNetworkTypeEnum(str, Enum): 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. + `directlink`, `vpc`, `power_virtual_server`, `vpn_gateway`, `dynamic_route_server` + and `gre_tunnel` connections. """ CLASSIC = 'classic' VPC = 'vpc' - VPN = 'vpn' class NetworkTypeEnum(str, Enum): @@ -5095,6 +5565,7 @@ class NetworkTypeEnum(str, Enum): POWER_VIRTUAL_SERVER = 'power_virtual_server' REDUNDANT_GRE = 'redundant_gre' VPN_GATEWAY = 'vpn_gateway' + DYNAMIC_ROUTE_SERVER = 'dynamic_route_server' class PrefixFiltersDefaultEnum(str, Enum): @@ -5145,10 +5616,10 @@ class TransitGatewayConnectionPrefixFilter: """ A prefix filter for a Transit Gateway connection. - :param str action: Whether to permit or deny prefix filter. - :param int ge: (optional) IP Prefix GE. - :param int le: (optional) IP Prefix LE. - :param str prefix: IP Prefix. + :attr str action: Whether to permit or deny prefix filter. + :attr int ge: (optional) IP Prefix GE. + :attr int le: (optional) IP Prefix LE. + :attr str prefix: IP Prefix. """ def __init__( @@ -5156,8 +5627,8 @@ def __init__( action: str, prefix: str, *, - ge: Optional[int] = None, - le: Optional[int] = None, + ge: int = None, + le: int = None, ) -> None: """ Initialize a TransitGatewayConnectionPrefixFilter object. @@ -5176,16 +5647,16 @@ def __init__( def from_dict(cls, _dict: Dict) -> 'TransitGatewayConnectionPrefixFilter': """Initialize a TransitGatewayConnectionPrefixFilter object from a json dictionary.""" args = {} - if (action := _dict.get('action')) is not None: - args['action'] = action + if 'action' in _dict: + args['action'] = _dict.get('action') else: raise ValueError('Required property \'action\' not present in TransitGatewayConnectionPrefixFilter JSON') - if (ge := _dict.get('ge')) is not None: - args['ge'] = ge - if (le := _dict.get('le')) is not None: - args['le'] = le - if (prefix := _dict.get('prefix')) is not None: - args['prefix'] = prefix + if 'ge' in _dict: + args['ge'] = _dict.get('ge') + if 'le' in _dict: + args['le'] = _dict.get('le') + if 'prefix' in _dict: + args['prefix'] = _dict.get('prefix') else: raise ValueError('Required property \'prefix\' not present in TransitGatewayConnectionPrefixFilter JSON') return cls(**args) @@ -5240,8 +5711,8 @@ class TransitGatewayConnectionPrefixFilterReference: """ A prefix filter reference object for a Transit Gateway connection. - :param str action: Whether to permit or deny prefix filter. - :param str before: (optional) Identifier of prefix filter that handles the + :attr str action: Whether to permit or deny prefix filter. + :attr str before: (optional) Identifier of prefix filter that handles the ordering and follow semantics: - When a filter reference another filter in it's before field, then the filter making the reference is applied before @@ -5259,13 +5730,13 @@ class TransitGatewayConnectionPrefixFilterReference: it will be applied last, but if filter D is created with an empty before field, then B's before field will be modified to point to D, so B will be applied before D. - :param datetime created_at: The date and time that this prefix filter was + :attr datetime created_at: The date and time that this prefix filter was created. - :param int ge: (optional) IP Prefix GE. - :param str id: Prefix Filter identifier. - :param int le: (optional) IP Prefix LE. - :param str prefix: IP Prefix. - :param datetime updated_at: (optional) The date and time that this prefix filter + :attr int ge: (optional) IP Prefix GE. + :attr str id: Prefix Filter identifier. + :attr int le: (optional) IP Prefix LE. + :attr str prefix: IP Prefix. + :attr datetime updated_at: (optional) The date and time that this prefix filter was last updated. """ @@ -5276,10 +5747,10 @@ def __init__( id: str, prefix: str, *, - before: Optional[str] = None, - ge: Optional[int] = None, - le: Optional[int] = None, - updated_at: Optional[datetime] = None, + before: str = None, + ge: int = None, + le: int = None, + updated_at: datetime = None, ) -> None: """ Initialize a TransitGatewayConnectionPrefixFilterReference object. @@ -5325,30 +5796,30 @@ def __init__( def from_dict(cls, _dict: Dict) -> 'TransitGatewayConnectionPrefixFilterReference': """Initialize a TransitGatewayConnectionPrefixFilterReference object from a json dictionary.""" args = {} - if (action := _dict.get('action')) is not None: - args['action'] = action + if 'action' in _dict: + args['action'] = _dict.get('action') else: raise ValueError('Required property \'action\' not present in TransitGatewayConnectionPrefixFilterReference JSON') - if (before := _dict.get('before')) is not None: - args['before'] = before - if (created_at := _dict.get('created_at')) is not None: - args['created_at'] = string_to_datetime(created_at) + if 'before' in _dict: + args['before'] = _dict.get('before') + if 'created_at' in _dict: + args['created_at'] = string_to_datetime(_dict.get('created_at')) else: raise ValueError('Required property \'created_at\' not present in TransitGatewayConnectionPrefixFilterReference JSON') - if (ge := _dict.get('ge')) is not None: - args['ge'] = ge - if (id := _dict.get('id')) is not None: - args['id'] = id + if 'ge' in _dict: + args['ge'] = _dict.get('ge') + if 'id' in _dict: + args['id'] = _dict.get('id') else: raise ValueError('Required property \'id\' not present in TransitGatewayConnectionPrefixFilterReference JSON') - if (le := _dict.get('le')) is not None: - args['le'] = le - if (prefix := _dict.get('prefix')) is not None: - args['prefix'] = prefix + if 'le' in _dict: + args['le'] = _dict.get('le') + if 'prefix' in _dict: + args['prefix'] = _dict.get('prefix') else: raise ValueError('Required property \'prefix\' not present in TransitGatewayConnectionPrefixFilterReference JSON') - if (updated_at := _dict.get('updated_at')) is not None: - args['updated_at'] = string_to_datetime(updated_at) + if 'updated_at' in _dict: + args['updated_at'] = string_to_datetime(_dict.get('updated_at')) return cls(**args) @classmethod @@ -5409,9 +5880,9 @@ class TransitGatewayReference: """ Transit gateway reference. - :param str crn: gateway CRN. - :param str id: gateway ID. - :param str name: transit gateway name. + :attr str crn: gateway CRN. + :attr str id: gateway ID. + :attr str name: transit gateway name. """ def __init__( @@ -5435,16 +5906,16 @@ def __init__( def from_dict(cls, _dict: Dict) -> 'TransitGatewayReference': """Initialize a TransitGatewayReference object from a json dictionary.""" args = {} - if (crn := _dict.get('crn')) is not None: - args['crn'] = crn + if 'crn' in _dict: + args['crn'] = _dict.get('crn') else: raise ValueError('Required property \'crn\' not present in TransitGatewayReference JSON') - if (id := _dict.get('id')) is not None: - args['id'] = id + if 'id' in _dict: + args['id'] = _dict.get('id') else: raise ValueError('Required property \'id\' not present in TransitGatewayReference JSON') - if (name := _dict.get('name')) is not None: - args['name'] = name + if 'name' in _dict: + args['name'] = _dict.get('name') else: raise ValueError('Required property \'name\' not present in TransitGatewayReference JSON') return cls(**args) @@ -5488,36 +5959,36 @@ class TransitGatewayTunnel: """ Details for a redundant GRE tunnel. - :param str base_network_type: The type of network the redundant GRE tunnel is + :attr str base_network_type: The type of network the redundant GRE tunnel is targeting. - :param datetime created_at: The date and time that this GRE tunnel was created. - :param str id: The unique identifier for this redundant GRE tunnel. - :param int local_bgp_asn: Local network BGP ASN. It is assigned by IBM when the + :attr datetime created_at: The date and time that this GRE tunnel was created. + :attr str id: The unique identifier for this redundant GRE tunnel. + :attr int local_bgp_asn: Local network BGP ASN. It is assigned by IBM when the tunnel is created. - :param str local_gateway_ip: Local gateway IP address. - :param str local_tunnel_ip: Local tunnel IP address. The local_tunnel_ip and + :attr str local_gateway_ip: Local gateway IP address. + :attr str local_tunnel_ip: 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. - :param int mtu: (optional) GRE tunnel MTU. - :param str name: The user-defined name for this tunnel. - :param str network_account_id: (optional) The ID of the account for cross - account Classic connections. This field is required when the GRE tunnel is in a + :attr int mtu: (optional) GRE tunnel MTU. + :attr str name: The user-defined name for this tunnel. + :attr str network_account_id: (optional) The ID of the account for cross account + Classic connections. This field is required when the GRE tunnel is in a different account than the gateway and the base network is Classic. - :param str network_id: (optional) The ID of the network VPC being connected via + :attr str network_id: (optional) The ID of the network VPC being connected via this connection. - :param int remote_bgp_asn: Remote network BGP ASN. The following ASN values are + :attr int remote_bgp_asn: 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 create requests, IBM will assign an ASN. - :param str remote_gateway_ip: Remote gateway IP address. - :param str remote_tunnel_ip: Remote tunnel IP address. The local_tunnel_ip and + :attr str remote_gateway_ip: Remote gateway IP address. + :attr str remote_tunnel_ip: 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. - :param str status: Tunnel's current configuration state. The list of enumerated + :attr str status: Tunnel's current configuration state. The list of enumerated values for this property may expand in the future. Code and processes using this field must tolerate unexpected values. - :param datetime updated_at: The date and time that this tunnel was last updated. - :param ZoneReference zone: Availability zone reference. + :attr datetime updated_at: The date and time that this tunnel was last updated. + :attr ZoneReference zone: Availability zone reference. """ def __init__( @@ -5536,9 +6007,9 @@ def __init__( updated_at: datetime, zone: 'ZoneReference', *, - mtu: Optional[int] = None, - network_account_id: Optional[str] = None, - network_id: Optional[str] = None, + mtu: int = None, + network_account_id: str = None, + network_id: str = None, ) -> None: """ Initialize a TransitGatewayTunnel object. @@ -5598,62 +6069,62 @@ def __init__( def from_dict(cls, _dict: Dict) -> 'TransitGatewayTunnel': """Initialize a TransitGatewayTunnel object from a json dictionary.""" args = {} - if (base_network_type := _dict.get('base_network_type')) is not None: - args['base_network_type'] = base_network_type + if 'base_network_type' in _dict: + args['base_network_type'] = _dict.get('base_network_type') else: raise ValueError('Required property \'base_network_type\' not present in TransitGatewayTunnel JSON') - if (created_at := _dict.get('created_at')) is not None: - args['created_at'] = string_to_datetime(created_at) + if 'created_at' in _dict: + args['created_at'] = string_to_datetime(_dict.get('created_at')) else: raise ValueError('Required property \'created_at\' not present in TransitGatewayTunnel JSON') - if (id := _dict.get('id')) is not None: - args['id'] = id + if 'id' in _dict: + args['id'] = _dict.get('id') else: raise ValueError('Required property \'id\' not present in TransitGatewayTunnel JSON') - if (local_bgp_asn := _dict.get('local_bgp_asn')) is not None: - args['local_bgp_asn'] = local_bgp_asn + if 'local_bgp_asn' in _dict: + args['local_bgp_asn'] = _dict.get('local_bgp_asn') else: raise ValueError('Required property \'local_bgp_asn\' not present in TransitGatewayTunnel JSON') - if (local_gateway_ip := _dict.get('local_gateway_ip')) is not None: - args['local_gateway_ip'] = local_gateway_ip + if 'local_gateway_ip' in _dict: + args['local_gateway_ip'] = _dict.get('local_gateway_ip') else: raise ValueError('Required property \'local_gateway_ip\' not present in TransitGatewayTunnel JSON') - if (local_tunnel_ip := _dict.get('local_tunnel_ip')) is not None: - args['local_tunnel_ip'] = local_tunnel_ip + if 'local_tunnel_ip' in _dict: + args['local_tunnel_ip'] = _dict.get('local_tunnel_ip') else: raise ValueError('Required property \'local_tunnel_ip\' not present in TransitGatewayTunnel JSON') - if (mtu := _dict.get('mtu')) is not None: - args['mtu'] = mtu - if (name := _dict.get('name')) is not None: - args['name'] = name + if 'mtu' in _dict: + args['mtu'] = _dict.get('mtu') + if 'name' in _dict: + args['name'] = _dict.get('name') else: raise ValueError('Required property \'name\' not present in TransitGatewayTunnel JSON') - if (network_account_id := _dict.get('network_account_id')) is not None: - args['network_account_id'] = network_account_id - if (network_id := _dict.get('network_id')) is not None: - args['network_id'] = network_id - if (remote_bgp_asn := _dict.get('remote_bgp_asn')) is not None: - args['remote_bgp_asn'] = remote_bgp_asn + if 'network_account_id' in _dict: + args['network_account_id'] = _dict.get('network_account_id') + if 'network_id' in _dict: + args['network_id'] = _dict.get('network_id') + if 'remote_bgp_asn' in _dict: + args['remote_bgp_asn'] = _dict.get('remote_bgp_asn') else: raise ValueError('Required property \'remote_bgp_asn\' not present in TransitGatewayTunnel JSON') - if (remote_gateway_ip := _dict.get('remote_gateway_ip')) is not None: - args['remote_gateway_ip'] = remote_gateway_ip + if 'remote_gateway_ip' in _dict: + args['remote_gateway_ip'] = _dict.get('remote_gateway_ip') else: raise ValueError('Required property \'remote_gateway_ip\' not present in TransitGatewayTunnel JSON') - if (remote_tunnel_ip := _dict.get('remote_tunnel_ip')) is not None: - args['remote_tunnel_ip'] = remote_tunnel_ip + if 'remote_tunnel_ip' in _dict: + args['remote_tunnel_ip'] = _dict.get('remote_tunnel_ip') else: raise ValueError('Required property \'remote_tunnel_ip\' not present in TransitGatewayTunnel JSON') - if (status := _dict.get('status')) is not None: - args['status'] = status + if 'status' in _dict: + args['status'] = _dict.get('status') else: raise ValueError('Required property \'status\' not present in TransitGatewayTunnel JSON') - if (updated_at := _dict.get('updated_at')) is not None: - args['updated_at'] = string_to_datetime(updated_at) + if 'updated_at' in _dict: + args['updated_at'] = string_to_datetime(_dict.get('updated_at')) else: raise ValueError('Required property \'updated_at\' not present in TransitGatewayTunnel JSON') - if (zone := _dict.get('zone')) is not None: - args['zone'] = ZoneReference.from_dict(zone) + if 'zone' in _dict: + args['zone'] = ZoneReference.from_dict(_dict.get('zone')) else: raise ValueError('Required property \'zone\' not present in TransitGatewayTunnel JSON') return cls(**args) @@ -5728,7 +6199,6 @@ class BaseNetworkTypeEnum(str, Enum): CLASSIC = 'classic' VPC = 'vpc' - VPN = 'vpn' class StatusEnum(str, Enum): @@ -5751,10 +6221,11 @@ class StatusEnum(str, Enum): class TransitGatewayTunnelCollection: """ - Collection of all tunnels for `redundant_gre` and `vpn_gateway` connections. + Collection of all tunnels for `redundant_gre`, `vpn_gateway` and + `dynamic_route_server` connections. - :param List[TransitGatewayTunnel] tunnels: Collection of all tunnels for - `redundant_gre` and `vpn_gateway` connections. + :attr List[TransitGatewayTunnel] tunnels: Collection of all tunnels for + `redundant_gre`, `vpn_gateway` and `dynamic_route_server` connections. """ def __init__( @@ -5765,7 +6236,7 @@ def __init__( Initialize a TransitGatewayTunnelCollection object. :param List[TransitGatewayTunnel] tunnels: Collection of all tunnels for - `redundant_gre` and `vpn_gateway` connections. + `redundant_gre`, `vpn_gateway` and `dynamic_route_server` connections. """ self.tunnels = tunnels @@ -5773,8 +6244,8 @@ def __init__( def from_dict(cls, _dict: Dict) -> 'TransitGatewayTunnelCollection': """Initialize a TransitGatewayTunnelCollection object from a json dictionary.""" args = {} - if (tunnels := _dict.get('tunnels')) is not None: - args['tunnels'] = [TransitGatewayTunnel.from_dict(v) for v in tunnels] + if 'tunnels' in _dict: + args['tunnels'] = [TransitGatewayTunnel.from_dict(v) for v in _dict.get('tunnels')] else: raise ValueError('Required property \'tunnels\' not present in TransitGatewayTunnelCollection JSON') return cls(**args) @@ -5820,13 +6291,13 @@ class TransitGatewayTunnelPatch: """ An update template for a Transit Gateway connection tunnel. - :param str name: (optional) The user-defined name for this connection tunnel. + :attr str name: (optional) The user-defined name for this connection tunnel. """ def __init__( self, *, - name: Optional[str] = None, + name: str = None, ) -> None: """ Initialize a TransitGatewayTunnelPatch object. @@ -5840,8 +6311,8 @@ def __init__( def from_dict(cls, _dict: Dict) -> 'TransitGatewayTunnelPatch': """Initialize a TransitGatewayTunnelPatch object from a json dictionary.""" args = {} - if (name := _dict.get('name')) is not None: - args['name'] = name + if 'name' in _dict: + args['name'] = _dict.get('name') return cls(**args) @classmethod @@ -5879,21 +6350,21 @@ class TransitGatewayTunnelTemplate: """ A create template with information for redundant GRE tunnel. - :param str local_gateway_ip: Local gateway IP address. - :param str local_tunnel_ip: Local tunnel IP address. The local_tunnel_ip and + :attr str local_gateway_ip: Local gateway IP address. + :attr str local_tunnel_ip: 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. - :param str name: The user-defined name for this tunnel connection. - :param int remote_bgp_asn: (optional) Remote network BGP ASN. The following ASN + :attr str name: The user-defined name for this tunnel connection. + :attr int remote_bgp_asn: (optional) 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 create requests, IBM will assign an ASN. - :param str remote_gateway_ip: Remote gateway IP address. - :param str remote_tunnel_ip: Remote tunnel IP address. The local_tunnel_ip and + :attr str remote_gateway_ip: Remote gateway IP address. + :attr str remote_tunnel_ip: 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. - :param ZoneIdentity zone: Specify the connection's location. The specified + :attr ZoneIdentity zone: Specify the connection's location. The specified availability zone must reside in the gateway's region. Use the IBM Cloud global catalog to list zones within the desired region. """ @@ -5907,7 +6378,7 @@ def __init__( remote_tunnel_ip: str, zone: 'ZoneIdentity', *, - remote_bgp_asn: Optional[int] = None, + remote_bgp_asn: int = None, ) -> None: """ Initialize a TransitGatewayTunnelTemplate object. @@ -5942,30 +6413,30 @@ def __init__( def from_dict(cls, _dict: Dict) -> 'TransitGatewayTunnelTemplate': """Initialize a TransitGatewayTunnelTemplate object from a json dictionary.""" args = {} - if (local_gateway_ip := _dict.get('local_gateway_ip')) is not None: - args['local_gateway_ip'] = local_gateway_ip + if 'local_gateway_ip' in _dict: + args['local_gateway_ip'] = _dict.get('local_gateway_ip') else: raise ValueError('Required property \'local_gateway_ip\' not present in TransitGatewayTunnelTemplate JSON') - if (local_tunnel_ip := _dict.get('local_tunnel_ip')) is not None: - args['local_tunnel_ip'] = local_tunnel_ip + if 'local_tunnel_ip' in _dict: + args['local_tunnel_ip'] = _dict.get('local_tunnel_ip') else: raise ValueError('Required property \'local_tunnel_ip\' not present in TransitGatewayTunnelTemplate JSON') - if (name := _dict.get('name')) is not None: - args['name'] = name + if 'name' in _dict: + args['name'] = _dict.get('name') else: raise ValueError('Required property \'name\' not present in TransitGatewayTunnelTemplate JSON') - if (remote_bgp_asn := _dict.get('remote_bgp_asn')) is not None: - args['remote_bgp_asn'] = remote_bgp_asn - if (remote_gateway_ip := _dict.get('remote_gateway_ip')) is not None: - args['remote_gateway_ip'] = remote_gateway_ip + if 'remote_bgp_asn' in _dict: + args['remote_bgp_asn'] = _dict.get('remote_bgp_asn') + if 'remote_gateway_ip' in _dict: + args['remote_gateway_ip'] = _dict.get('remote_gateway_ip') else: raise ValueError('Required property \'remote_gateway_ip\' not present in TransitGatewayTunnelTemplate JSON') - if (remote_tunnel_ip := _dict.get('remote_tunnel_ip')) is not None: - args['remote_tunnel_ip'] = remote_tunnel_ip + if 'remote_tunnel_ip' in _dict: + args['remote_tunnel_ip'] = _dict.get('remote_tunnel_ip') else: raise ValueError('Required property \'remote_tunnel_ip\' not present in TransitGatewayTunnelTemplate JSON') - if (zone := _dict.get('zone')) is not None: - args['zone'] = zone + if 'zone' in _dict: + args['zone'] = _dict.get('zone') else: raise ValueError('Required property \'zone\' not present in TransitGatewayTunnelTemplate JSON') return cls(**args) @@ -6039,7 +6510,7 @@ class ZoneReference: """ Availability zone reference. - :param str name: Availability zone name. + :attr str name: Availability zone name. """ def __init__( @@ -6057,8 +6528,8 @@ def __init__( def from_dict(cls, _dict: Dict) -> 'ZoneReference': """Initialize a ZoneReference object from a json dictionary.""" args = {} - if (name := _dict.get('name')) is not None: - args['name'] = name + if 'name' in _dict: + args['name'] = _dict.get('name') else: raise ValueError('Required property \'name\' not present in ZoneReference JSON') return cls(**args) @@ -6098,13 +6569,13 @@ class ZoneIdentityByName(ZoneIdentity): """ Availability zone. - :param str name: (optional) Availability zone name. + :attr str name: (optional) Availability zone name. """ def __init__( self, *, - name: Optional[str] = None, + name: str = None, ) -> None: """ Initialize a ZoneIdentityByName object. @@ -6118,8 +6589,8 @@ def __init__( def from_dict(cls, _dict: Dict) -> 'ZoneIdentityByName': """Initialize a ZoneIdentityByName object from a json dictionary.""" args = {} - if (name := _dict.get('name')) is not None: - args['name'] = name + if 'name' in _dict: + args['name'] = _dict.get('name') return cls(**args) @classmethod @@ -6167,16 +6638,20 @@ def __init__( *, client: TransitGatewayApisV1, limit: int = None, + redundancy_group: str = None, ) -> None: """ Initialize a TransitGatewaysPager object. :param int limit: (optional) The maximum number of resources to return per page. + :param str redundancy_group: (optional) Filter the list of transit gateways + by redundancy group name. """ self._has_next = True self._client = client self._page_context = {'next': None} self._limit = limit + self._redundancy_group = redundancy_group def has_next(self) -> bool: """ @@ -6195,6 +6670,7 @@ def get_next(self) -> List[dict]: result = self._client.list_transit_gateways( limit=self._limit, + redundancy_group=self._redundancy_group, start=self._page_context.get('next'), ).get_result() diff --git a/test/unit/test_transit_gateway_apis_v1.py b/test/unit/test_transit_gateway_apis_v1.py index 94c5d09..6206f97 100644 --- a/test/unit/test_transit_gateway_apis_v1.py +++ b/test/unit/test_transit_gateway_apis_v1.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# (C) Copyright IBM Corp. 2025. +# (C) Copyright IBM Corp. 2026. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -48,15 +48,23 @@ def preprocess_url(operation_path: str): The returned request URL is used to register the mock response so it needs to match the request URL that is formed by the requests library. """ + # First, unquote the path since it might have some quoted/escaped characters in it + # due to how the generator inserts the operation paths into the unit test code. + operation_path = urllib.parse.unquote(operation_path) - # Form the request URL from the base URL and operation path. + # Next, quote the path using urllib so that we approximate what will + # happen during request processing. + operation_path = urllib.parse.quote(operation_path, safe='/') + + # Finally, form the request URL from the base URL and operation path. request_url = _base_url + operation_path # If the request url does NOT end with a /, then just return it as-is. # Otherwise, return a regular expression that matches one or more trailing /. - if not request_url.endswith('/'): + if re.fullmatch('.*/+', request_url) is None: return request_url - return re.compile(request_url.rstrip('/') + '/+') + else: + return re.compile(request_url.rstrip('/') + '/+') ############################################################################## @@ -123,7 +131,7 @@ def test_list_transit_gateways_all_params(self): """ # Set up mock url = preprocess_url('/transit_gateways') - mock_response = '{"first": {"href": "https://transit.cloud.ibm.com/v1/transit_gateways?limit=50"}, "limit": 50, "next": {"href": "https://transit.cloud.ibm.com/v1/transit_gateways?start=MjAyMC0wNS0wOFQxNDoxNzowMy45NzQ5NzNa&limit=50", "start": "MjAyMC0wNS0wOFQxNDoxNzowMy45NzQ5NzNa"}, "transit_gateways": [{"connection_count": 5, "connection_needs_attention": true, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:transit:dal03:a/57a7d05f36894e3cb9b46a43556d903e::gateway:ef4dcb1a-fee4-41c7-9e11-9cd99e65c1f4", "global": true, "gre_enhanced_route_propagation": true, "id": "0a06fb9b-820f-4c44-8a31-77f1f0806d28", "location": "us-south", "name": "my-transit-gateway-in-TransitGateway", "resource_group": {"href": "https://resource-manager.bluemix.net/v1/resource_groups/56969d6043e9465c883cb9f7363e78e8", "id": "56969d6043e9465c883cb9f7363e78e8"}, "status": "available", "updated_at": "2019-01-01T12:00:00.000Z"}]}' + mock_response = '{"first": {"href": "https://transit.cloud.ibm.com/v1/transit_gateways?limit=50"}, "limit": 50, "next": {"href": "https://transit.cloud.ibm.com/v1/transit_gateways?start=MjAyMC0wNS0wOFQxNDoxNzowMy45NzQ5NzNa&limit=50", "start": "MjAyMC0wNS0wOFQxNDoxNzowMy45NzQ5NzNa"}, "transit_gateways": [{"connection_count": 5, "connection_needs_attention": true, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:transit:dal03:a/57a7d05f36894e3cb9b46a43556d903e::gateway:ef4dcb1a-fee4-41c7-9e11-9cd99e65c1f4", "global": true, "gre_enhanced_route_propagation": true, "id": "0a06fb9b-820f-4c44-8a31-77f1f0806d28", "location": "us-south", "name": "my-transit-gateway-in-TransitGateway", "redundancy_group": "rg-1", "redundancy_group_id": "ef4dcb1a-fee4-41c7-9e11-9cd99e65c1f4", "resource_group": {"href": "https://resource-manager.bluemix.net/v1/resource_groups/56969d6043e9465c883cb9f7363e78e8", "id": "56969d6043e9465c883cb9f7363e78e8"}, "status": "available", "updated_at": "2019-01-01T12:00:00.000Z"}]}' responses.add( responses.GET, url, @@ -135,11 +143,13 @@ def test_list_transit_gateways_all_params(self): # Set up parameter values limit = 50 start = 'testString' + redundancy_group = 'testString' # Invoke method response = _service.list_transit_gateways( limit=limit, start=start, + redundancy_group=redundancy_group, headers={}, ) @@ -151,6 +161,7 @@ def test_list_transit_gateways_all_params(self): query_string = urllib.parse.unquote_plus(query_string) assert 'limit={}'.format(limit) in query_string assert 'start={}'.format(start) in query_string + assert 'redundancy_group={}'.format(redundancy_group) in query_string def test_list_transit_gateways_all_params_with_retries(self): # Enable retries and run test_list_transit_gateways_all_params. @@ -168,7 +179,7 @@ def test_list_transit_gateways_required_params(self): """ # Set up mock url = preprocess_url('/transit_gateways') - mock_response = '{"first": {"href": "https://transit.cloud.ibm.com/v1/transit_gateways?limit=50"}, "limit": 50, "next": {"href": "https://transit.cloud.ibm.com/v1/transit_gateways?start=MjAyMC0wNS0wOFQxNDoxNzowMy45NzQ5NzNa&limit=50", "start": "MjAyMC0wNS0wOFQxNDoxNzowMy45NzQ5NzNa"}, "transit_gateways": [{"connection_count": 5, "connection_needs_attention": true, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:transit:dal03:a/57a7d05f36894e3cb9b46a43556d903e::gateway:ef4dcb1a-fee4-41c7-9e11-9cd99e65c1f4", "global": true, "gre_enhanced_route_propagation": true, "id": "0a06fb9b-820f-4c44-8a31-77f1f0806d28", "location": "us-south", "name": "my-transit-gateway-in-TransitGateway", "resource_group": {"href": "https://resource-manager.bluemix.net/v1/resource_groups/56969d6043e9465c883cb9f7363e78e8", "id": "56969d6043e9465c883cb9f7363e78e8"}, "status": "available", "updated_at": "2019-01-01T12:00:00.000Z"}]}' + mock_response = '{"first": {"href": "https://transit.cloud.ibm.com/v1/transit_gateways?limit=50"}, "limit": 50, "next": {"href": "https://transit.cloud.ibm.com/v1/transit_gateways?start=MjAyMC0wNS0wOFQxNDoxNzowMy45NzQ5NzNa&limit=50", "start": "MjAyMC0wNS0wOFQxNDoxNzowMy45NzQ5NzNa"}, "transit_gateways": [{"connection_count": 5, "connection_needs_attention": true, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:transit:dal03:a/57a7d05f36894e3cb9b46a43556d903e::gateway:ef4dcb1a-fee4-41c7-9e11-9cd99e65c1f4", "global": true, "gre_enhanced_route_propagation": true, "id": "0a06fb9b-820f-4c44-8a31-77f1f0806d28", "location": "us-south", "name": "my-transit-gateway-in-TransitGateway", "redundancy_group": "rg-1", "redundancy_group_id": "ef4dcb1a-fee4-41c7-9e11-9cd99e65c1f4", "resource_group": {"href": "https://resource-manager.bluemix.net/v1/resource_groups/56969d6043e9465c883cb9f7363e78e8", "id": "56969d6043e9465c883cb9f7363e78e8"}, "status": "available", "updated_at": "2019-01-01T12:00:00.000Z"}]}' responses.add( responses.GET, url, @@ -200,7 +211,7 @@ def test_list_transit_gateways_value_error(self): """ # Set up mock url = preprocess_url('/transit_gateways') - mock_response = '{"first": {"href": "https://transit.cloud.ibm.com/v1/transit_gateways?limit=50"}, "limit": 50, "next": {"href": "https://transit.cloud.ibm.com/v1/transit_gateways?start=MjAyMC0wNS0wOFQxNDoxNzowMy45NzQ5NzNa&limit=50", "start": "MjAyMC0wNS0wOFQxNDoxNzowMy45NzQ5NzNa"}, "transit_gateways": [{"connection_count": 5, "connection_needs_attention": true, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:transit:dal03:a/57a7d05f36894e3cb9b46a43556d903e::gateway:ef4dcb1a-fee4-41c7-9e11-9cd99e65c1f4", "global": true, "gre_enhanced_route_propagation": true, "id": "0a06fb9b-820f-4c44-8a31-77f1f0806d28", "location": "us-south", "name": "my-transit-gateway-in-TransitGateway", "resource_group": {"href": "https://resource-manager.bluemix.net/v1/resource_groups/56969d6043e9465c883cb9f7363e78e8", "id": "56969d6043e9465c883cb9f7363e78e8"}, "status": "available", "updated_at": "2019-01-01T12:00:00.000Z"}]}' + mock_response = '{"first": {"href": "https://transit.cloud.ibm.com/v1/transit_gateways?limit=50"}, "limit": 50, "next": {"href": "https://transit.cloud.ibm.com/v1/transit_gateways?start=MjAyMC0wNS0wOFQxNDoxNzowMy45NzQ5NzNa&limit=50", "start": "MjAyMC0wNS0wOFQxNDoxNzowMy45NzQ5NzNa"}, "transit_gateways": [{"connection_count": 5, "connection_needs_attention": true, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:transit:dal03:a/57a7d05f36894e3cb9b46a43556d903e::gateway:ef4dcb1a-fee4-41c7-9e11-9cd99e65c1f4", "global": true, "gre_enhanced_route_propagation": true, "id": "0a06fb9b-820f-4c44-8a31-77f1f0806d28", "location": "us-south", "name": "my-transit-gateway-in-TransitGateway", "redundancy_group": "rg-1", "redundancy_group_id": "ef4dcb1a-fee4-41c7-9e11-9cd99e65c1f4", "resource_group": {"href": "https://resource-manager.bluemix.net/v1/resource_groups/56969d6043e9465c883cb9f7363e78e8", "id": "56969d6043e9465c883cb9f7363e78e8"}, "status": "available", "updated_at": "2019-01-01T12:00:00.000Z"}]}' responses.add( responses.GET, url, @@ -233,8 +244,8 @@ def test_list_transit_gateways_with_pager_get_next(self): """ # Set up a two-page mock response url = preprocess_url('/transit_gateways') - mock_response1 = '{"next":{"start":"1"},"transit_gateways":[{"connection_count":5,"connection_needs_attention":true,"created_at":"2019-01-01T12:00:00.000Z","crn":"crn:v1:bluemix:public:transit:dal03:a/57a7d05f36894e3cb9b46a43556d903e::gateway:ef4dcb1a-fee4-41c7-9e11-9cd99e65c1f4","global":true,"gre_enhanced_route_propagation":true,"id":"0a06fb9b-820f-4c44-8a31-77f1f0806d28","location":"us-south","name":"my-transit-gateway-in-TransitGateway","resource_group":{"href":"https://resource-manager.bluemix.net/v1/resource_groups/56969d6043e9465c883cb9f7363e78e8","id":"56969d6043e9465c883cb9f7363e78e8"},"status":"available","updated_at":"2019-01-01T12:00:00.000Z"}],"total_count":2,"limit":1}' - mock_response2 = '{"transit_gateways":[{"connection_count":5,"connection_needs_attention":true,"created_at":"2019-01-01T12:00:00.000Z","crn":"crn:v1:bluemix:public:transit:dal03:a/57a7d05f36894e3cb9b46a43556d903e::gateway:ef4dcb1a-fee4-41c7-9e11-9cd99e65c1f4","global":true,"gre_enhanced_route_propagation":true,"id":"0a06fb9b-820f-4c44-8a31-77f1f0806d28","location":"us-south","name":"my-transit-gateway-in-TransitGateway","resource_group":{"href":"https://resource-manager.bluemix.net/v1/resource_groups/56969d6043e9465c883cb9f7363e78e8","id":"56969d6043e9465c883cb9f7363e78e8"},"status":"available","updated_at":"2019-01-01T12:00:00.000Z"}],"total_count":2,"limit":1}' + mock_response1 = '{"next":{"start":"1"},"transit_gateways":[{"connection_count":5,"connection_needs_attention":true,"created_at":"2019-01-01T12:00:00.000Z","crn":"crn:v1:bluemix:public:transit:dal03:a/57a7d05f36894e3cb9b46a43556d903e::gateway:ef4dcb1a-fee4-41c7-9e11-9cd99e65c1f4","global":true,"gre_enhanced_route_propagation":true,"id":"0a06fb9b-820f-4c44-8a31-77f1f0806d28","location":"us-south","name":"my-transit-gateway-in-TransitGateway","redundancy_group":"rg-1","redundancy_group_id":"ef4dcb1a-fee4-41c7-9e11-9cd99e65c1f4","resource_group":{"href":"https://resource-manager.bluemix.net/v1/resource_groups/56969d6043e9465c883cb9f7363e78e8","id":"56969d6043e9465c883cb9f7363e78e8"},"status":"available","updated_at":"2019-01-01T12:00:00.000Z"}],"total_count":2,"limit":1}' + mock_response2 = '{"transit_gateways":[{"connection_count":5,"connection_needs_attention":true,"created_at":"2019-01-01T12:00:00.000Z","crn":"crn:v1:bluemix:public:transit:dal03:a/57a7d05f36894e3cb9b46a43556d903e::gateway:ef4dcb1a-fee4-41c7-9e11-9cd99e65c1f4","global":true,"gre_enhanced_route_propagation":true,"id":"0a06fb9b-820f-4c44-8a31-77f1f0806d28","location":"us-south","name":"my-transit-gateway-in-TransitGateway","redundancy_group":"rg-1","redundancy_group_id":"ef4dcb1a-fee4-41c7-9e11-9cd99e65c1f4","resource_group":{"href":"https://resource-manager.bluemix.net/v1/resource_groups/56969d6043e9465c883cb9f7363e78e8","id":"56969d6043e9465c883cb9f7363e78e8"},"status":"available","updated_at":"2019-01-01T12:00:00.000Z"}],"total_count":2,"limit":1}' responses.add( responses.GET, url, @@ -255,6 +266,7 @@ def test_list_transit_gateways_with_pager_get_next(self): pager = TransitGatewaysPager( client=_service, limit=10, + redundancy_group='testString', ) while pager.has_next(): next_page = pager.get_next() @@ -269,8 +281,8 @@ def test_list_transit_gateways_with_pager_get_all(self): """ # Set up a two-page mock response url = preprocess_url('/transit_gateways') - mock_response1 = '{"next":{"start":"1"},"transit_gateways":[{"connection_count":5,"connection_needs_attention":true,"created_at":"2019-01-01T12:00:00.000Z","crn":"crn:v1:bluemix:public:transit:dal03:a/57a7d05f36894e3cb9b46a43556d903e::gateway:ef4dcb1a-fee4-41c7-9e11-9cd99e65c1f4","global":true,"gre_enhanced_route_propagation":true,"id":"0a06fb9b-820f-4c44-8a31-77f1f0806d28","location":"us-south","name":"my-transit-gateway-in-TransitGateway","resource_group":{"href":"https://resource-manager.bluemix.net/v1/resource_groups/56969d6043e9465c883cb9f7363e78e8","id":"56969d6043e9465c883cb9f7363e78e8"},"status":"available","updated_at":"2019-01-01T12:00:00.000Z"}],"total_count":2,"limit":1}' - mock_response2 = '{"transit_gateways":[{"connection_count":5,"connection_needs_attention":true,"created_at":"2019-01-01T12:00:00.000Z","crn":"crn:v1:bluemix:public:transit:dal03:a/57a7d05f36894e3cb9b46a43556d903e::gateway:ef4dcb1a-fee4-41c7-9e11-9cd99e65c1f4","global":true,"gre_enhanced_route_propagation":true,"id":"0a06fb9b-820f-4c44-8a31-77f1f0806d28","location":"us-south","name":"my-transit-gateway-in-TransitGateway","resource_group":{"href":"https://resource-manager.bluemix.net/v1/resource_groups/56969d6043e9465c883cb9f7363e78e8","id":"56969d6043e9465c883cb9f7363e78e8"},"status":"available","updated_at":"2019-01-01T12:00:00.000Z"}],"total_count":2,"limit":1}' + mock_response1 = '{"next":{"start":"1"},"transit_gateways":[{"connection_count":5,"connection_needs_attention":true,"created_at":"2019-01-01T12:00:00.000Z","crn":"crn:v1:bluemix:public:transit:dal03:a/57a7d05f36894e3cb9b46a43556d903e::gateway:ef4dcb1a-fee4-41c7-9e11-9cd99e65c1f4","global":true,"gre_enhanced_route_propagation":true,"id":"0a06fb9b-820f-4c44-8a31-77f1f0806d28","location":"us-south","name":"my-transit-gateway-in-TransitGateway","redundancy_group":"rg-1","redundancy_group_id":"ef4dcb1a-fee4-41c7-9e11-9cd99e65c1f4","resource_group":{"href":"https://resource-manager.bluemix.net/v1/resource_groups/56969d6043e9465c883cb9f7363e78e8","id":"56969d6043e9465c883cb9f7363e78e8"},"status":"available","updated_at":"2019-01-01T12:00:00.000Z"}],"total_count":2,"limit":1}' + mock_response2 = '{"transit_gateways":[{"connection_count":5,"connection_needs_attention":true,"created_at":"2019-01-01T12:00:00.000Z","crn":"crn:v1:bluemix:public:transit:dal03:a/57a7d05f36894e3cb9b46a43556d903e::gateway:ef4dcb1a-fee4-41c7-9e11-9cd99e65c1f4","global":true,"gre_enhanced_route_propagation":true,"id":"0a06fb9b-820f-4c44-8a31-77f1f0806d28","location":"us-south","name":"my-transit-gateway-in-TransitGateway","redundancy_group":"rg-1","redundancy_group_id":"ef4dcb1a-fee4-41c7-9e11-9cd99e65c1f4","resource_group":{"href":"https://resource-manager.bluemix.net/v1/resource_groups/56969d6043e9465c883cb9f7363e78e8","id":"56969d6043e9465c883cb9f7363e78e8"},"status":"available","updated_at":"2019-01-01T12:00:00.000Z"}],"total_count":2,"limit":1}' responses.add( responses.GET, url, @@ -290,6 +302,7 @@ def test_list_transit_gateways_with_pager_get_all(self): pager = TransitGatewaysPager( client=_service, limit=10, + redundancy_group='testString', ) all_results = pager.get_all() assert all_results is not None @@ -308,7 +321,7 @@ def test_create_transit_gateway_all_params(self): """ # Set up mock url = preprocess_url('/transit_gateways') - mock_response = '{"connection_count": 5, "connection_needs_attention": true, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:transit:dal03:a/57a7d05f36894e3cb9b46a43556d903e::gateway:ef4dcb1a-fee4-41c7-9e11-9cd99e65c1f4", "global": true, "gre_enhanced_route_propagation": true, "id": "0a06fb9b-820f-4c44-8a31-77f1f0806d28", "location": "us-south", "name": "my-transit-gateway-in-TransitGateway", "resource_group": {"href": "https://resource-manager.bluemix.net/v1/resource_groups/56969d6043e9465c883cb9f7363e78e8", "id": "56969d6043e9465c883cb9f7363e78e8"}, "status": "available", "updated_at": "2019-01-01T12:00:00.000Z"}' + mock_response = '{"connection_count": 5, "connection_needs_attention": true, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:transit:dal03:a/57a7d05f36894e3cb9b46a43556d903e::gateway:ef4dcb1a-fee4-41c7-9e11-9cd99e65c1f4", "global": true, "gre_enhanced_route_propagation": true, "id": "0a06fb9b-820f-4c44-8a31-77f1f0806d28", "location": "us-south", "name": "my-transit-gateway-in-TransitGateway", "redundancy_group": "rg-1", "redundancy_group_id": "ef4dcb1a-fee4-41c7-9e11-9cd99e65c1f4", "resource_group": {"href": "https://resource-manager.bluemix.net/v1/resource_groups/56969d6043e9465c883cb9f7363e78e8", "id": "56969d6043e9465c883cb9f7363e78e8"}, "status": "available", "updated_at": "2019-01-01T12:00:00.000Z"}' responses.add( responses.POST, url, @@ -326,6 +339,7 @@ def test_create_transit_gateway_all_params(self): name = 'my-transit-gateway-in-TransitGateway' global_ = True gre_enhanced_route_propagation = True + redundancy_group = 'rg-1' resource_group = resource_group_identity_model # Invoke method @@ -334,6 +348,7 @@ def test_create_transit_gateway_all_params(self): name, global_=global_, gre_enhanced_route_propagation=gre_enhanced_route_propagation, + redundancy_group=redundancy_group, resource_group=resource_group, headers={}, ) @@ -347,6 +362,7 @@ def test_create_transit_gateway_all_params(self): assert req_body['name'] == 'my-transit-gateway-in-TransitGateway' assert req_body['global'] == True assert req_body['gre_enhanced_route_propagation'] == True + assert req_body['redundancy_group'] == 'rg-1' assert req_body['resource_group'] == resource_group_identity_model def test_create_transit_gateway_all_params_with_retries(self): @@ -365,7 +381,7 @@ def test_create_transit_gateway_value_error(self): """ # Set up mock url = preprocess_url('/transit_gateways') - mock_response = '{"connection_count": 5, "connection_needs_attention": true, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:transit:dal03:a/57a7d05f36894e3cb9b46a43556d903e::gateway:ef4dcb1a-fee4-41c7-9e11-9cd99e65c1f4", "global": true, "gre_enhanced_route_propagation": true, "id": "0a06fb9b-820f-4c44-8a31-77f1f0806d28", "location": "us-south", "name": "my-transit-gateway-in-TransitGateway", "resource_group": {"href": "https://resource-manager.bluemix.net/v1/resource_groups/56969d6043e9465c883cb9f7363e78e8", "id": "56969d6043e9465c883cb9f7363e78e8"}, "status": "available", "updated_at": "2019-01-01T12:00:00.000Z"}' + mock_response = '{"connection_count": 5, "connection_needs_attention": true, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:transit:dal03:a/57a7d05f36894e3cb9b46a43556d903e::gateway:ef4dcb1a-fee4-41c7-9e11-9cd99e65c1f4", "global": true, "gre_enhanced_route_propagation": true, "id": "0a06fb9b-820f-4c44-8a31-77f1f0806d28", "location": "us-south", "name": "my-transit-gateway-in-TransitGateway", "redundancy_group": "rg-1", "redundancy_group_id": "ef4dcb1a-fee4-41c7-9e11-9cd99e65c1f4", "resource_group": {"href": "https://resource-manager.bluemix.net/v1/resource_groups/56969d6043e9465c883cb9f7363e78e8", "id": "56969d6043e9465c883cb9f7363e78e8"}, "status": "available", "updated_at": "2019-01-01T12:00:00.000Z"}' responses.add( responses.POST, url, @@ -383,6 +399,7 @@ def test_create_transit_gateway_value_error(self): name = 'my-transit-gateway-in-TransitGateway' global_ = True gre_enhanced_route_propagation = True + redundancy_group = 'rg-1' resource_group = resource_group_identity_model # Pass in all but one required param and check for a ValueError @@ -492,7 +509,7 @@ def test_get_transit_gateway_all_params(self): """ # Set up mock url = preprocess_url('/transit_gateways/testString') - mock_response = '{"connection_count": 5, "connection_needs_attention": true, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:transit:dal03:a/57a7d05f36894e3cb9b46a43556d903e::gateway:ef4dcb1a-fee4-41c7-9e11-9cd99e65c1f4", "global": true, "gre_enhanced_route_propagation": true, "id": "0a06fb9b-820f-4c44-8a31-77f1f0806d28", "location": "us-south", "name": "my-transit-gateway-in-TransitGateway", "resource_group": {"href": "https://resource-manager.bluemix.net/v1/resource_groups/56969d6043e9465c883cb9f7363e78e8", "id": "56969d6043e9465c883cb9f7363e78e8"}, "status": "available", "updated_at": "2019-01-01T12:00:00.000Z"}' + mock_response = '{"connection_count": 5, "connection_needs_attention": true, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:transit:dal03:a/57a7d05f36894e3cb9b46a43556d903e::gateway:ef4dcb1a-fee4-41c7-9e11-9cd99e65c1f4", "global": true, "gre_enhanced_route_propagation": true, "id": "0a06fb9b-820f-4c44-8a31-77f1f0806d28", "location": "us-south", "name": "my-transit-gateway-in-TransitGateway", "redundancy_group": "rg-1", "redundancy_group_id": "ef4dcb1a-fee4-41c7-9e11-9cd99e65c1f4", "resource_group": {"href": "https://resource-manager.bluemix.net/v1/resource_groups/56969d6043e9465c883cb9f7363e78e8", "id": "56969d6043e9465c883cb9f7363e78e8"}, "status": "available", "updated_at": "2019-01-01T12:00:00.000Z"}' responses.add( responses.GET, url, @@ -530,7 +547,7 @@ def test_get_transit_gateway_value_error(self): """ # Set up mock url = preprocess_url('/transit_gateways/testString') - mock_response = '{"connection_count": 5, "connection_needs_attention": true, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:transit:dal03:a/57a7d05f36894e3cb9b46a43556d903e::gateway:ef4dcb1a-fee4-41c7-9e11-9cd99e65c1f4", "global": true, "gre_enhanced_route_propagation": true, "id": "0a06fb9b-820f-4c44-8a31-77f1f0806d28", "location": "us-south", "name": "my-transit-gateway-in-TransitGateway", "resource_group": {"href": "https://resource-manager.bluemix.net/v1/resource_groups/56969d6043e9465c883cb9f7363e78e8", "id": "56969d6043e9465c883cb9f7363e78e8"}, "status": "available", "updated_at": "2019-01-01T12:00:00.000Z"}' + mock_response = '{"connection_count": 5, "connection_needs_attention": true, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:transit:dal03:a/57a7d05f36894e3cb9b46a43556d903e::gateway:ef4dcb1a-fee4-41c7-9e11-9cd99e65c1f4", "global": true, "gre_enhanced_route_propagation": true, "id": "0a06fb9b-820f-4c44-8a31-77f1f0806d28", "location": "us-south", "name": "my-transit-gateway-in-TransitGateway", "redundancy_group": "rg-1", "redundancy_group_id": "ef4dcb1a-fee4-41c7-9e11-9cd99e65c1f4", "resource_group": {"href": "https://resource-manager.bluemix.net/v1/resource_groups/56969d6043e9465c883cb9f7363e78e8", "id": "56969d6043e9465c883cb9f7363e78e8"}, "status": "available", "updated_at": "2019-01-01T12:00:00.000Z"}' responses.add( responses.GET, url, @@ -573,7 +590,7 @@ def test_update_transit_gateway_all_params(self): """ # Set up mock url = preprocess_url('/transit_gateways/testString') - mock_response = '{"connection_count": 5, "connection_needs_attention": true, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:transit:dal03:a/57a7d05f36894e3cb9b46a43556d903e::gateway:ef4dcb1a-fee4-41c7-9e11-9cd99e65c1f4", "global": true, "gre_enhanced_route_propagation": true, "id": "0a06fb9b-820f-4c44-8a31-77f1f0806d28", "location": "us-south", "name": "my-transit-gateway-in-TransitGateway", "resource_group": {"href": "https://resource-manager.bluemix.net/v1/resource_groups/56969d6043e9465c883cb9f7363e78e8", "id": "56969d6043e9465c883cb9f7363e78e8"}, "status": "available", "updated_at": "2019-01-01T12:00:00.000Z"}' + mock_response = '{"connection_count": 5, "connection_needs_attention": true, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:transit:dal03:a/57a7d05f36894e3cb9b46a43556d903e::gateway:ef4dcb1a-fee4-41c7-9e11-9cd99e65c1f4", "global": true, "gre_enhanced_route_propagation": true, "id": "0a06fb9b-820f-4c44-8a31-77f1f0806d28", "location": "us-south", "name": "my-transit-gateway-in-TransitGateway", "redundancy_group": "rg-1", "redundancy_group_id": "ef4dcb1a-fee4-41c7-9e11-9cd99e65c1f4", "resource_group": {"href": "https://resource-manager.bluemix.net/v1/resource_groups/56969d6043e9465c883cb9f7363e78e8", "id": "56969d6043e9465c883cb9f7363e78e8"}, "status": "available", "updated_at": "2019-01-01T12:00:00.000Z"}' responses.add( responses.PATCH, url, @@ -587,6 +604,7 @@ def test_update_transit_gateway_all_params(self): global_ = True gre_enhanced_route_propagation = True name = 'my-resource' + redundancy_group = 'rg-1' # Invoke method response = _service.update_transit_gateway( @@ -594,6 +612,7 @@ def test_update_transit_gateway_all_params(self): global_=global_, gre_enhanced_route_propagation=gre_enhanced_route_propagation, name=name, + redundancy_group=redundancy_group, headers={}, ) @@ -605,6 +624,7 @@ def test_update_transit_gateway_all_params(self): assert req_body['global'] == True assert req_body['gre_enhanced_route_propagation'] == True assert req_body['name'] == 'my-resource' + assert req_body['redundancy_group'] == 'rg-1' def test_update_transit_gateway_all_params_with_retries(self): # Enable retries and run test_update_transit_gateway_all_params. @@ -622,7 +642,7 @@ def test_update_transit_gateway_value_error(self): """ # Set up mock url = preprocess_url('/transit_gateways/testString') - mock_response = '{"connection_count": 5, "connection_needs_attention": true, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:transit:dal03:a/57a7d05f36894e3cb9b46a43556d903e::gateway:ef4dcb1a-fee4-41c7-9e11-9cd99e65c1f4", "global": true, "gre_enhanced_route_propagation": true, "id": "0a06fb9b-820f-4c44-8a31-77f1f0806d28", "location": "us-south", "name": "my-transit-gateway-in-TransitGateway", "resource_group": {"href": "https://resource-manager.bluemix.net/v1/resource_groups/56969d6043e9465c883cb9f7363e78e8", "id": "56969d6043e9465c883cb9f7363e78e8"}, "status": "available", "updated_at": "2019-01-01T12:00:00.000Z"}' + mock_response = '{"connection_count": 5, "connection_needs_attention": true, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:transit:dal03:a/57a7d05f36894e3cb9b46a43556d903e::gateway:ef4dcb1a-fee4-41c7-9e11-9cd99e65c1f4", "global": true, "gre_enhanced_route_propagation": true, "id": "0a06fb9b-820f-4c44-8a31-77f1f0806d28", "location": "us-south", "name": "my-transit-gateway-in-TransitGateway", "redundancy_group": "rg-1", "redundancy_group_id": "ef4dcb1a-fee4-41c7-9e11-9cd99e65c1f4", "resource_group": {"href": "https://resource-manager.bluemix.net/v1/resource_groups/56969d6043e9465c883cb9f7363e78e8", "id": "56969d6043e9465c883cb9f7363e78e8"}, "status": "available", "updated_at": "2019-01-01T12:00:00.000Z"}' responses.add( responses.PATCH, url, @@ -636,6 +656,7 @@ def test_update_transit_gateway_value_error(self): global_ = True gre_enhanced_route_propagation = True name = 'my-resource' + redundancy_group = 'rg-1' # Pass in all but one required param and check for a ValueError req_param_dict = { @@ -725,7 +746,7 @@ def test_list_connections_all_params(self): """ # Set up mock url = preprocess_url('/connections') - mock_response = '{"connections": [{"base_network_type": "classic", "name": "Transit_Service_BWTN_SJ_DL", "network_id": "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b", "network_type": "vpc", "id": "1a15dca5-7e33-45e1-b7c5-bc690e569531", "base_connection_id": "975f58c1-afe7-469a-9727-7f3d720f2d32", "created_at": "2019-01-01T12:00:00.000Z", "local_bgp_asn": 64490, "local_gateway_ip": "192.168.100.1", "local_tunnel_ip": "192.168.129.2", "mtu": 9000, "network_account_id": "network_account_id", "prefix_filters": [{"action": "permit", "before": "1a15dcab-7e40-45e1-b7c5-bc690eaa9782", "created_at": "2019-01-01T12:00:00.000Z", "ge": 0, "id": "1a15dcab-7e30-45e1-b7c5-bc690eaa9865", "le": 32, "prefix": "192.168.100.0/24", "updated_at": "2019-01-01T12:00:00.000Z"}], "prefix_filters_default": "permit", "remote_bgp_asn": 65010, "remote_gateway_ip": "10.242.63.12", "remote_tunnel_ip": "192.168.129.1", "request_status": "pending", "status": "attached", "transit_gateway": {"crn": "crn:v1:bluemix:public:transit:us-south:a/123456::gateway:456f58c1-afe7-123a-0a0a-7f3d720f1a44", "id": "456f58c1-afe7-123a-0a0a-7f3d720f1a44", "name": "my-transit-gw100"}, "tunnels": [{"base_network_type": "classic", "created_at": "2019-01-01T12:00:00.000Z", "id": "1a15dca5-7e33-45e1-b7c5-bc690e569531", "local_bgp_asn": 13, "local_gateway_ip": "10.242.63.12", "local_tunnel_ip": "192.168.100.20", "mtu": 9000, "name": "gre1", "network_account_id": "network_account_id", "network_id": "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b", "remote_bgp_asn": 65010, "remote_gateway_ip": "10.242.33.22", "remote_tunnel_ip": "192.168.129.1", "status": "attached", "updated_at": "2019-01-01T12:00:00.000Z", "zone": {"name": "us-south-1"}}], "updated_at": "2019-01-01T12:00:00.000Z", "zone": {"name": "us-south-1"}}], "first": {"href": "https://transit.cloud.ibm.com/v1/connections?limit=50"}, "limit": 50, "next": {"href": "https://transit.cloud.ibm.com/v1/connections?start=MjAyMC0wNS0wOFQxNDoxNzowMy45NzQ5NzNa&limit=50", "start": "MjAyMC0wNS0wOFQxNDoxNzowMy45NzQ5NzNa"}}' + mock_response = '{"connections": [{"base_network_type": "classic", "name": "Transit_Service_BWTN_SJ_DL", "network_id": "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b", "network_type": "vpc", "id": "1a15dca5-7e33-45e1-b7c5-bc690e569531", "base_connection_id": "975f58c1-afe7-469a-9727-7f3d720f2d32", "cidr": "198.19.174.0/23", "created_at": "2019-01-01T12:00:00.000Z", "local_bgp_asn": 64490, "local_gateway_ip": "192.168.100.1", "local_tunnel_ip": "192.168.129.2", "mtu": 9000, "network_account_id": "network_account_id", "prefix_filters": [{"action": "permit", "before": "1a15dcab-7e40-45e1-b7c5-bc690eaa9782", "created_at": "2019-01-01T12:00:00.000Z", "ge": 0, "id": "1a15dcab-7e30-45e1-b7c5-bc690eaa9865", "le": 32, "prefix": "192.168.100.0/24", "updated_at": "2019-01-01T12:00:00.000Z"}], "prefix_filters_default": "permit", "remote_bgp_asn": 65010, "remote_gateway_ip": "10.242.63.12", "remote_tunnel_ip": "192.168.129.1", "request_status": "pending", "status": "attached", "transit_gateway": {"crn": "crn:v1:bluemix:public:transit:us-south:a/123456::gateway:456f58c1-afe7-123a-0a0a-7f3d720f1a44", "id": "456f58c1-afe7-123a-0a0a-7f3d720f1a44", "name": "my-transit-gw100"}, "tunnels": [{"base_network_type": "classic", "created_at": "2019-01-01T12:00:00.000Z", "id": "1a15dca5-7e33-45e1-b7c5-bc690e569531", "local_bgp_asn": 1, "local_gateway_ip": "10.242.63.12", "local_tunnel_ip": "192.168.100.20", "mtu": 9000, "name": "gre1", "network_account_id": "network_account_id", "network_id": "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b", "remote_bgp_asn": 65010, "remote_gateway_ip": "10.242.33.22", "remote_tunnel_ip": "192.168.129.1", "status": "attached", "updated_at": "2019-01-01T12:00:00.000Z", "zone": {"name": "us-south-1"}}], "updated_at": "2019-01-01T12:00:00.000Z", "zone": {"name": "us-south-1"}}], "first": {"href": "https://transit.cloud.ibm.com/v1/connections?limit=50"}, "limit": 50, "next": {"href": "https://transit.cloud.ibm.com/v1/connections?start=MjAyMC0wNS0wOFQxNDoxNzowMy45NzQ5NzNa&limit=50", "start": "MjAyMC0wNS0wOFQxNDoxNzowMy45NzQ5NzNa"}}' responses.add( responses.GET, url, @@ -776,7 +797,7 @@ def test_list_connections_required_params(self): """ # Set up mock url = preprocess_url('/connections') - mock_response = '{"connections": [{"base_network_type": "classic", "name": "Transit_Service_BWTN_SJ_DL", "network_id": "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b", "network_type": "vpc", "id": "1a15dca5-7e33-45e1-b7c5-bc690e569531", "base_connection_id": "975f58c1-afe7-469a-9727-7f3d720f2d32", "created_at": "2019-01-01T12:00:00.000Z", "local_bgp_asn": 64490, "local_gateway_ip": "192.168.100.1", "local_tunnel_ip": "192.168.129.2", "mtu": 9000, "network_account_id": "network_account_id", "prefix_filters": [{"action": "permit", "before": "1a15dcab-7e40-45e1-b7c5-bc690eaa9782", "created_at": "2019-01-01T12:00:00.000Z", "ge": 0, "id": "1a15dcab-7e30-45e1-b7c5-bc690eaa9865", "le": 32, "prefix": "192.168.100.0/24", "updated_at": "2019-01-01T12:00:00.000Z"}], "prefix_filters_default": "permit", "remote_bgp_asn": 65010, "remote_gateway_ip": "10.242.63.12", "remote_tunnel_ip": "192.168.129.1", "request_status": "pending", "status": "attached", "transit_gateway": {"crn": "crn:v1:bluemix:public:transit:us-south:a/123456::gateway:456f58c1-afe7-123a-0a0a-7f3d720f1a44", "id": "456f58c1-afe7-123a-0a0a-7f3d720f1a44", "name": "my-transit-gw100"}, "tunnels": [{"base_network_type": "classic", "created_at": "2019-01-01T12:00:00.000Z", "id": "1a15dca5-7e33-45e1-b7c5-bc690e569531", "local_bgp_asn": 13, "local_gateway_ip": "10.242.63.12", "local_tunnel_ip": "192.168.100.20", "mtu": 9000, "name": "gre1", "network_account_id": "network_account_id", "network_id": "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b", "remote_bgp_asn": 65010, "remote_gateway_ip": "10.242.33.22", "remote_tunnel_ip": "192.168.129.1", "status": "attached", "updated_at": "2019-01-01T12:00:00.000Z", "zone": {"name": "us-south-1"}}], "updated_at": "2019-01-01T12:00:00.000Z", "zone": {"name": "us-south-1"}}], "first": {"href": "https://transit.cloud.ibm.com/v1/connections?limit=50"}, "limit": 50, "next": {"href": "https://transit.cloud.ibm.com/v1/connections?start=MjAyMC0wNS0wOFQxNDoxNzowMy45NzQ5NzNa&limit=50", "start": "MjAyMC0wNS0wOFQxNDoxNzowMy45NzQ5NzNa"}}' + mock_response = '{"connections": [{"base_network_type": "classic", "name": "Transit_Service_BWTN_SJ_DL", "network_id": "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b", "network_type": "vpc", "id": "1a15dca5-7e33-45e1-b7c5-bc690e569531", "base_connection_id": "975f58c1-afe7-469a-9727-7f3d720f2d32", "cidr": "198.19.174.0/23", "created_at": "2019-01-01T12:00:00.000Z", "local_bgp_asn": 64490, "local_gateway_ip": "192.168.100.1", "local_tunnel_ip": "192.168.129.2", "mtu": 9000, "network_account_id": "network_account_id", "prefix_filters": [{"action": "permit", "before": "1a15dcab-7e40-45e1-b7c5-bc690eaa9782", "created_at": "2019-01-01T12:00:00.000Z", "ge": 0, "id": "1a15dcab-7e30-45e1-b7c5-bc690eaa9865", "le": 32, "prefix": "192.168.100.0/24", "updated_at": "2019-01-01T12:00:00.000Z"}], "prefix_filters_default": "permit", "remote_bgp_asn": 65010, "remote_gateway_ip": "10.242.63.12", "remote_tunnel_ip": "192.168.129.1", "request_status": "pending", "status": "attached", "transit_gateway": {"crn": "crn:v1:bluemix:public:transit:us-south:a/123456::gateway:456f58c1-afe7-123a-0a0a-7f3d720f1a44", "id": "456f58c1-afe7-123a-0a0a-7f3d720f1a44", "name": "my-transit-gw100"}, "tunnels": [{"base_network_type": "classic", "created_at": "2019-01-01T12:00:00.000Z", "id": "1a15dca5-7e33-45e1-b7c5-bc690e569531", "local_bgp_asn": 1, "local_gateway_ip": "10.242.63.12", "local_tunnel_ip": "192.168.100.20", "mtu": 9000, "name": "gre1", "network_account_id": "network_account_id", "network_id": "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b", "remote_bgp_asn": 65010, "remote_gateway_ip": "10.242.33.22", "remote_tunnel_ip": "192.168.129.1", "status": "attached", "updated_at": "2019-01-01T12:00:00.000Z", "zone": {"name": "us-south-1"}}], "updated_at": "2019-01-01T12:00:00.000Z", "zone": {"name": "us-south-1"}}], "first": {"href": "https://transit.cloud.ibm.com/v1/connections?limit=50"}, "limit": 50, "next": {"href": "https://transit.cloud.ibm.com/v1/connections?start=MjAyMC0wNS0wOFQxNDoxNzowMy45NzQ5NzNa&limit=50", "start": "MjAyMC0wNS0wOFQxNDoxNzowMy45NzQ5NzNa"}}' responses.add( responses.GET, url, @@ -808,7 +829,7 @@ def test_list_connections_value_error(self): """ # Set up mock url = preprocess_url('/connections') - mock_response = '{"connections": [{"base_network_type": "classic", "name": "Transit_Service_BWTN_SJ_DL", "network_id": "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b", "network_type": "vpc", "id": "1a15dca5-7e33-45e1-b7c5-bc690e569531", "base_connection_id": "975f58c1-afe7-469a-9727-7f3d720f2d32", "created_at": "2019-01-01T12:00:00.000Z", "local_bgp_asn": 64490, "local_gateway_ip": "192.168.100.1", "local_tunnel_ip": "192.168.129.2", "mtu": 9000, "network_account_id": "network_account_id", "prefix_filters": [{"action": "permit", "before": "1a15dcab-7e40-45e1-b7c5-bc690eaa9782", "created_at": "2019-01-01T12:00:00.000Z", "ge": 0, "id": "1a15dcab-7e30-45e1-b7c5-bc690eaa9865", "le": 32, "prefix": "192.168.100.0/24", "updated_at": "2019-01-01T12:00:00.000Z"}], "prefix_filters_default": "permit", "remote_bgp_asn": 65010, "remote_gateway_ip": "10.242.63.12", "remote_tunnel_ip": "192.168.129.1", "request_status": "pending", "status": "attached", "transit_gateway": {"crn": "crn:v1:bluemix:public:transit:us-south:a/123456::gateway:456f58c1-afe7-123a-0a0a-7f3d720f1a44", "id": "456f58c1-afe7-123a-0a0a-7f3d720f1a44", "name": "my-transit-gw100"}, "tunnels": [{"base_network_type": "classic", "created_at": "2019-01-01T12:00:00.000Z", "id": "1a15dca5-7e33-45e1-b7c5-bc690e569531", "local_bgp_asn": 13, "local_gateway_ip": "10.242.63.12", "local_tunnel_ip": "192.168.100.20", "mtu": 9000, "name": "gre1", "network_account_id": "network_account_id", "network_id": "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b", "remote_bgp_asn": 65010, "remote_gateway_ip": "10.242.33.22", "remote_tunnel_ip": "192.168.129.1", "status": "attached", "updated_at": "2019-01-01T12:00:00.000Z", "zone": {"name": "us-south-1"}}], "updated_at": "2019-01-01T12:00:00.000Z", "zone": {"name": "us-south-1"}}], "first": {"href": "https://transit.cloud.ibm.com/v1/connections?limit=50"}, "limit": 50, "next": {"href": "https://transit.cloud.ibm.com/v1/connections?start=MjAyMC0wNS0wOFQxNDoxNzowMy45NzQ5NzNa&limit=50", "start": "MjAyMC0wNS0wOFQxNDoxNzowMy45NzQ5NzNa"}}' + mock_response = '{"connections": [{"base_network_type": "classic", "name": "Transit_Service_BWTN_SJ_DL", "network_id": "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b", "network_type": "vpc", "id": "1a15dca5-7e33-45e1-b7c5-bc690e569531", "base_connection_id": "975f58c1-afe7-469a-9727-7f3d720f2d32", "cidr": "198.19.174.0/23", "created_at": "2019-01-01T12:00:00.000Z", "local_bgp_asn": 64490, "local_gateway_ip": "192.168.100.1", "local_tunnel_ip": "192.168.129.2", "mtu": 9000, "network_account_id": "network_account_id", "prefix_filters": [{"action": "permit", "before": "1a15dcab-7e40-45e1-b7c5-bc690eaa9782", "created_at": "2019-01-01T12:00:00.000Z", "ge": 0, "id": "1a15dcab-7e30-45e1-b7c5-bc690eaa9865", "le": 32, "prefix": "192.168.100.0/24", "updated_at": "2019-01-01T12:00:00.000Z"}], "prefix_filters_default": "permit", "remote_bgp_asn": 65010, "remote_gateway_ip": "10.242.63.12", "remote_tunnel_ip": "192.168.129.1", "request_status": "pending", "status": "attached", "transit_gateway": {"crn": "crn:v1:bluemix:public:transit:us-south:a/123456::gateway:456f58c1-afe7-123a-0a0a-7f3d720f1a44", "id": "456f58c1-afe7-123a-0a0a-7f3d720f1a44", "name": "my-transit-gw100"}, "tunnels": [{"base_network_type": "classic", "created_at": "2019-01-01T12:00:00.000Z", "id": "1a15dca5-7e33-45e1-b7c5-bc690e569531", "local_bgp_asn": 1, "local_gateway_ip": "10.242.63.12", "local_tunnel_ip": "192.168.100.20", "mtu": 9000, "name": "gre1", "network_account_id": "network_account_id", "network_id": "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b", "remote_bgp_asn": 65010, "remote_gateway_ip": "10.242.33.22", "remote_tunnel_ip": "192.168.129.1", "status": "attached", "updated_at": "2019-01-01T12:00:00.000Z", "zone": {"name": "us-south-1"}}], "updated_at": "2019-01-01T12:00:00.000Z", "zone": {"name": "us-south-1"}}], "first": {"href": "https://transit.cloud.ibm.com/v1/connections?limit=50"}, "limit": 50, "next": {"href": "https://transit.cloud.ibm.com/v1/connections?start=MjAyMC0wNS0wOFQxNDoxNzowMy45NzQ5NzNa&limit=50", "start": "MjAyMC0wNS0wOFQxNDoxNzowMy45NzQ5NzNa"}}' responses.add( responses.GET, url, @@ -841,8 +862,8 @@ def test_list_connections_with_pager_get_next(self): """ # Set up a two-page mock response url = preprocess_url('/connections') - mock_response1 = '{"next":{"start":"1"},"total_count":2,"limit":1,"connections":[{"base_network_type":"classic","name":"Transit_Service_BWTN_SJ_DL","network_id":"crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b","network_type":"vpc","id":"1a15dca5-7e33-45e1-b7c5-bc690e569531","base_connection_id":"975f58c1-afe7-469a-9727-7f3d720f2d32","created_at":"2019-01-01T12:00:00.000Z","local_bgp_asn":64490,"local_gateway_ip":"192.168.100.1","local_tunnel_ip":"192.168.129.2","mtu":9000,"network_account_id":"network_account_id","prefix_filters":[{"action":"permit","before":"1a15dcab-7e40-45e1-b7c5-bc690eaa9782","created_at":"2019-01-01T12:00:00.000Z","ge":0,"id":"1a15dcab-7e30-45e1-b7c5-bc690eaa9865","le":32,"prefix":"192.168.100.0/24","updated_at":"2019-01-01T12:00:00.000Z"}],"prefix_filters_default":"permit","remote_bgp_asn":65010,"remote_gateway_ip":"10.242.63.12","remote_tunnel_ip":"192.168.129.1","request_status":"pending","status":"attached","transit_gateway":{"crn":"crn:v1:bluemix:public:transit:us-south:a/123456::gateway:456f58c1-afe7-123a-0a0a-7f3d720f1a44","id":"456f58c1-afe7-123a-0a0a-7f3d720f1a44","name":"my-transit-gw100"},"tunnels":[{"base_network_type":"classic","created_at":"2019-01-01T12:00:00.000Z","id":"1a15dca5-7e33-45e1-b7c5-bc690e569531","local_bgp_asn":13,"local_gateway_ip":"10.242.63.12","local_tunnel_ip":"192.168.100.20","mtu":9000,"name":"gre1","network_account_id":"network_account_id","network_id":"crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b","remote_bgp_asn":65010,"remote_gateway_ip":"10.242.33.22","remote_tunnel_ip":"192.168.129.1","status":"attached","updated_at":"2019-01-01T12:00:00.000Z","zone":{"name":"us-south-1"}}],"updated_at":"2019-01-01T12:00:00.000Z","zone":{"name":"us-south-1"}}]}' - mock_response2 = '{"total_count":2,"limit":1,"connections":[{"base_network_type":"classic","name":"Transit_Service_BWTN_SJ_DL","network_id":"crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b","network_type":"vpc","id":"1a15dca5-7e33-45e1-b7c5-bc690e569531","base_connection_id":"975f58c1-afe7-469a-9727-7f3d720f2d32","created_at":"2019-01-01T12:00:00.000Z","local_bgp_asn":64490,"local_gateway_ip":"192.168.100.1","local_tunnel_ip":"192.168.129.2","mtu":9000,"network_account_id":"network_account_id","prefix_filters":[{"action":"permit","before":"1a15dcab-7e40-45e1-b7c5-bc690eaa9782","created_at":"2019-01-01T12:00:00.000Z","ge":0,"id":"1a15dcab-7e30-45e1-b7c5-bc690eaa9865","le":32,"prefix":"192.168.100.0/24","updated_at":"2019-01-01T12:00:00.000Z"}],"prefix_filters_default":"permit","remote_bgp_asn":65010,"remote_gateway_ip":"10.242.63.12","remote_tunnel_ip":"192.168.129.1","request_status":"pending","status":"attached","transit_gateway":{"crn":"crn:v1:bluemix:public:transit:us-south:a/123456::gateway:456f58c1-afe7-123a-0a0a-7f3d720f1a44","id":"456f58c1-afe7-123a-0a0a-7f3d720f1a44","name":"my-transit-gw100"},"tunnels":[{"base_network_type":"classic","created_at":"2019-01-01T12:00:00.000Z","id":"1a15dca5-7e33-45e1-b7c5-bc690e569531","local_bgp_asn":13,"local_gateway_ip":"10.242.63.12","local_tunnel_ip":"192.168.100.20","mtu":9000,"name":"gre1","network_account_id":"network_account_id","network_id":"crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b","remote_bgp_asn":65010,"remote_gateway_ip":"10.242.33.22","remote_tunnel_ip":"192.168.129.1","status":"attached","updated_at":"2019-01-01T12:00:00.000Z","zone":{"name":"us-south-1"}}],"updated_at":"2019-01-01T12:00:00.000Z","zone":{"name":"us-south-1"}}]}' + mock_response1 = '{"next":{"start":"1"},"total_count":2,"limit":1,"connections":[{"base_network_type":"classic","name":"Transit_Service_BWTN_SJ_DL","network_id":"crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b","network_type":"vpc","id":"1a15dca5-7e33-45e1-b7c5-bc690e569531","base_connection_id":"975f58c1-afe7-469a-9727-7f3d720f2d32","cidr":"198.19.174.0/23","created_at":"2019-01-01T12:00:00.000Z","local_bgp_asn":64490,"local_gateway_ip":"192.168.100.1","local_tunnel_ip":"192.168.129.2","mtu":9000,"network_account_id":"network_account_id","prefix_filters":[{"action":"permit","before":"1a15dcab-7e40-45e1-b7c5-bc690eaa9782","created_at":"2019-01-01T12:00:00.000Z","ge":0,"id":"1a15dcab-7e30-45e1-b7c5-bc690eaa9865","le":32,"prefix":"192.168.100.0/24","updated_at":"2019-01-01T12:00:00.000Z"}],"prefix_filters_default":"permit","remote_bgp_asn":65010,"remote_gateway_ip":"10.242.63.12","remote_tunnel_ip":"192.168.129.1","request_status":"pending","status":"attached","transit_gateway":{"crn":"crn:v1:bluemix:public:transit:us-south:a/123456::gateway:456f58c1-afe7-123a-0a0a-7f3d720f1a44","id":"456f58c1-afe7-123a-0a0a-7f3d720f1a44","name":"my-transit-gw100"},"tunnels":[{"base_network_type":"classic","created_at":"2019-01-01T12:00:00.000Z","id":"1a15dca5-7e33-45e1-b7c5-bc690e569531","local_bgp_asn":1,"local_gateway_ip":"10.242.63.12","local_tunnel_ip":"192.168.100.20","mtu":9000,"name":"gre1","network_account_id":"network_account_id","network_id":"crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b","remote_bgp_asn":65010,"remote_gateway_ip":"10.242.33.22","remote_tunnel_ip":"192.168.129.1","status":"attached","updated_at":"2019-01-01T12:00:00.000Z","zone":{"name":"us-south-1"}}],"updated_at":"2019-01-01T12:00:00.000Z","zone":{"name":"us-south-1"}}]}' + mock_response2 = '{"total_count":2,"limit":1,"connections":[{"base_network_type":"classic","name":"Transit_Service_BWTN_SJ_DL","network_id":"crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b","network_type":"vpc","id":"1a15dca5-7e33-45e1-b7c5-bc690e569531","base_connection_id":"975f58c1-afe7-469a-9727-7f3d720f2d32","cidr":"198.19.174.0/23","created_at":"2019-01-01T12:00:00.000Z","local_bgp_asn":64490,"local_gateway_ip":"192.168.100.1","local_tunnel_ip":"192.168.129.2","mtu":9000,"network_account_id":"network_account_id","prefix_filters":[{"action":"permit","before":"1a15dcab-7e40-45e1-b7c5-bc690eaa9782","created_at":"2019-01-01T12:00:00.000Z","ge":0,"id":"1a15dcab-7e30-45e1-b7c5-bc690eaa9865","le":32,"prefix":"192.168.100.0/24","updated_at":"2019-01-01T12:00:00.000Z"}],"prefix_filters_default":"permit","remote_bgp_asn":65010,"remote_gateway_ip":"10.242.63.12","remote_tunnel_ip":"192.168.129.1","request_status":"pending","status":"attached","transit_gateway":{"crn":"crn:v1:bluemix:public:transit:us-south:a/123456::gateway:456f58c1-afe7-123a-0a0a-7f3d720f1a44","id":"456f58c1-afe7-123a-0a0a-7f3d720f1a44","name":"my-transit-gw100"},"tunnels":[{"base_network_type":"classic","created_at":"2019-01-01T12:00:00.000Z","id":"1a15dca5-7e33-45e1-b7c5-bc690e569531","local_bgp_asn":1,"local_gateway_ip":"10.242.63.12","local_tunnel_ip":"192.168.100.20","mtu":9000,"name":"gre1","network_account_id":"network_account_id","network_id":"crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b","remote_bgp_asn":65010,"remote_gateway_ip":"10.242.33.22","remote_tunnel_ip":"192.168.129.1","status":"attached","updated_at":"2019-01-01T12:00:00.000Z","zone":{"name":"us-south-1"}}],"updated_at":"2019-01-01T12:00:00.000Z","zone":{"name":"us-south-1"}}]}' responses.add( responses.GET, url, @@ -879,8 +900,8 @@ def test_list_connections_with_pager_get_all(self): """ # Set up a two-page mock response url = preprocess_url('/connections') - mock_response1 = '{"next":{"start":"1"},"total_count":2,"limit":1,"connections":[{"base_network_type":"classic","name":"Transit_Service_BWTN_SJ_DL","network_id":"crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b","network_type":"vpc","id":"1a15dca5-7e33-45e1-b7c5-bc690e569531","base_connection_id":"975f58c1-afe7-469a-9727-7f3d720f2d32","created_at":"2019-01-01T12:00:00.000Z","local_bgp_asn":64490,"local_gateway_ip":"192.168.100.1","local_tunnel_ip":"192.168.129.2","mtu":9000,"network_account_id":"network_account_id","prefix_filters":[{"action":"permit","before":"1a15dcab-7e40-45e1-b7c5-bc690eaa9782","created_at":"2019-01-01T12:00:00.000Z","ge":0,"id":"1a15dcab-7e30-45e1-b7c5-bc690eaa9865","le":32,"prefix":"192.168.100.0/24","updated_at":"2019-01-01T12:00:00.000Z"}],"prefix_filters_default":"permit","remote_bgp_asn":65010,"remote_gateway_ip":"10.242.63.12","remote_tunnel_ip":"192.168.129.1","request_status":"pending","status":"attached","transit_gateway":{"crn":"crn:v1:bluemix:public:transit:us-south:a/123456::gateway:456f58c1-afe7-123a-0a0a-7f3d720f1a44","id":"456f58c1-afe7-123a-0a0a-7f3d720f1a44","name":"my-transit-gw100"},"tunnels":[{"base_network_type":"classic","created_at":"2019-01-01T12:00:00.000Z","id":"1a15dca5-7e33-45e1-b7c5-bc690e569531","local_bgp_asn":13,"local_gateway_ip":"10.242.63.12","local_tunnel_ip":"192.168.100.20","mtu":9000,"name":"gre1","network_account_id":"network_account_id","network_id":"crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b","remote_bgp_asn":65010,"remote_gateway_ip":"10.242.33.22","remote_tunnel_ip":"192.168.129.1","status":"attached","updated_at":"2019-01-01T12:00:00.000Z","zone":{"name":"us-south-1"}}],"updated_at":"2019-01-01T12:00:00.000Z","zone":{"name":"us-south-1"}}]}' - mock_response2 = '{"total_count":2,"limit":1,"connections":[{"base_network_type":"classic","name":"Transit_Service_BWTN_SJ_DL","network_id":"crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b","network_type":"vpc","id":"1a15dca5-7e33-45e1-b7c5-bc690e569531","base_connection_id":"975f58c1-afe7-469a-9727-7f3d720f2d32","created_at":"2019-01-01T12:00:00.000Z","local_bgp_asn":64490,"local_gateway_ip":"192.168.100.1","local_tunnel_ip":"192.168.129.2","mtu":9000,"network_account_id":"network_account_id","prefix_filters":[{"action":"permit","before":"1a15dcab-7e40-45e1-b7c5-bc690eaa9782","created_at":"2019-01-01T12:00:00.000Z","ge":0,"id":"1a15dcab-7e30-45e1-b7c5-bc690eaa9865","le":32,"prefix":"192.168.100.0/24","updated_at":"2019-01-01T12:00:00.000Z"}],"prefix_filters_default":"permit","remote_bgp_asn":65010,"remote_gateway_ip":"10.242.63.12","remote_tunnel_ip":"192.168.129.1","request_status":"pending","status":"attached","transit_gateway":{"crn":"crn:v1:bluemix:public:transit:us-south:a/123456::gateway:456f58c1-afe7-123a-0a0a-7f3d720f1a44","id":"456f58c1-afe7-123a-0a0a-7f3d720f1a44","name":"my-transit-gw100"},"tunnels":[{"base_network_type":"classic","created_at":"2019-01-01T12:00:00.000Z","id":"1a15dca5-7e33-45e1-b7c5-bc690e569531","local_bgp_asn":13,"local_gateway_ip":"10.242.63.12","local_tunnel_ip":"192.168.100.20","mtu":9000,"name":"gre1","network_account_id":"network_account_id","network_id":"crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b","remote_bgp_asn":65010,"remote_gateway_ip":"10.242.33.22","remote_tunnel_ip":"192.168.129.1","status":"attached","updated_at":"2019-01-01T12:00:00.000Z","zone":{"name":"us-south-1"}}],"updated_at":"2019-01-01T12:00:00.000Z","zone":{"name":"us-south-1"}}]}' + mock_response1 = '{"next":{"start":"1"},"total_count":2,"limit":1,"connections":[{"base_network_type":"classic","name":"Transit_Service_BWTN_SJ_DL","network_id":"crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b","network_type":"vpc","id":"1a15dca5-7e33-45e1-b7c5-bc690e569531","base_connection_id":"975f58c1-afe7-469a-9727-7f3d720f2d32","cidr":"198.19.174.0/23","created_at":"2019-01-01T12:00:00.000Z","local_bgp_asn":64490,"local_gateway_ip":"192.168.100.1","local_tunnel_ip":"192.168.129.2","mtu":9000,"network_account_id":"network_account_id","prefix_filters":[{"action":"permit","before":"1a15dcab-7e40-45e1-b7c5-bc690eaa9782","created_at":"2019-01-01T12:00:00.000Z","ge":0,"id":"1a15dcab-7e30-45e1-b7c5-bc690eaa9865","le":32,"prefix":"192.168.100.0/24","updated_at":"2019-01-01T12:00:00.000Z"}],"prefix_filters_default":"permit","remote_bgp_asn":65010,"remote_gateway_ip":"10.242.63.12","remote_tunnel_ip":"192.168.129.1","request_status":"pending","status":"attached","transit_gateway":{"crn":"crn:v1:bluemix:public:transit:us-south:a/123456::gateway:456f58c1-afe7-123a-0a0a-7f3d720f1a44","id":"456f58c1-afe7-123a-0a0a-7f3d720f1a44","name":"my-transit-gw100"},"tunnels":[{"base_network_type":"classic","created_at":"2019-01-01T12:00:00.000Z","id":"1a15dca5-7e33-45e1-b7c5-bc690e569531","local_bgp_asn":1,"local_gateway_ip":"10.242.63.12","local_tunnel_ip":"192.168.100.20","mtu":9000,"name":"gre1","network_account_id":"network_account_id","network_id":"crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b","remote_bgp_asn":65010,"remote_gateway_ip":"10.242.33.22","remote_tunnel_ip":"192.168.129.1","status":"attached","updated_at":"2019-01-01T12:00:00.000Z","zone":{"name":"us-south-1"}}],"updated_at":"2019-01-01T12:00:00.000Z","zone":{"name":"us-south-1"}}]}' + mock_response2 = '{"total_count":2,"limit":1,"connections":[{"base_network_type":"classic","name":"Transit_Service_BWTN_SJ_DL","network_id":"crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b","network_type":"vpc","id":"1a15dca5-7e33-45e1-b7c5-bc690e569531","base_connection_id":"975f58c1-afe7-469a-9727-7f3d720f2d32","cidr":"198.19.174.0/23","created_at":"2019-01-01T12:00:00.000Z","local_bgp_asn":64490,"local_gateway_ip":"192.168.100.1","local_tunnel_ip":"192.168.129.2","mtu":9000,"network_account_id":"network_account_id","prefix_filters":[{"action":"permit","before":"1a15dcab-7e40-45e1-b7c5-bc690eaa9782","created_at":"2019-01-01T12:00:00.000Z","ge":0,"id":"1a15dcab-7e30-45e1-b7c5-bc690eaa9865","le":32,"prefix":"192.168.100.0/24","updated_at":"2019-01-01T12:00:00.000Z"}],"prefix_filters_default":"permit","remote_bgp_asn":65010,"remote_gateway_ip":"10.242.63.12","remote_tunnel_ip":"192.168.129.1","request_status":"pending","status":"attached","transit_gateway":{"crn":"crn:v1:bluemix:public:transit:us-south:a/123456::gateway:456f58c1-afe7-123a-0a0a-7f3d720f1a44","id":"456f58c1-afe7-123a-0a0a-7f3d720f1a44","name":"my-transit-gw100"},"tunnels":[{"base_network_type":"classic","created_at":"2019-01-01T12:00:00.000Z","id":"1a15dca5-7e33-45e1-b7c5-bc690e569531","local_bgp_asn":1,"local_gateway_ip":"10.242.63.12","local_tunnel_ip":"192.168.100.20","mtu":9000,"name":"gre1","network_account_id":"network_account_id","network_id":"crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b","remote_bgp_asn":65010,"remote_gateway_ip":"10.242.33.22","remote_tunnel_ip":"192.168.129.1","status":"attached","updated_at":"2019-01-01T12:00:00.000Z","zone":{"name":"us-south-1"}}],"updated_at":"2019-01-01T12:00:00.000Z","zone":{"name":"us-south-1"}}]}' responses.add( responses.GET, url, @@ -977,7 +998,7 @@ def test_list_transit_gateway_connections_all_params(self): """ # Set up mock url = preprocess_url('/transit_gateways/testString/connections') - mock_response = '{"connections": [{"base_connection_id": "975f58c1-afe7-469a-9727-7f3d720f2d32", "base_network_type": "classic", "cidr": "192.168.0.0/24", "created_at": "2019-01-01T12:00:00.000Z", "id": "1a15dca5-7e33-45e1-b7c5-bc690e569531", "local_bgp_asn": 64490, "local_gateway_ip": "192.168.100.1", "local_tunnel_ip": "192.168.129.2", "mtu": 9000, "name": "Transit_Service_BWTN_SJ_DL", "network_account_id": "network_account_id", "network_id": "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b", "network_type": "vpc", "prefix_filters": [{"action": "permit", "before": "1a15dcab-7e40-45e1-b7c5-bc690eaa9782", "created_at": "2019-01-01T12:00:00.000Z", "ge": 0, "id": "1a15dcab-7e30-45e1-b7c5-bc690eaa9865", "le": 32, "prefix": "192.168.100.0/24", "updated_at": "2019-01-01T12:00:00.000Z"}], "prefix_filters_default": "permit", "remote_bgp_asn": 65010, "remote_gateway_ip": "10.242.63.12", "remote_tunnel_ip": "192.168.129.1", "request_status": "pending", "status": "attached", "tunnels": [{"base_network_type": "classic", "created_at": "2019-01-01T12:00:00.000Z", "id": "1a15dca5-7e33-45e1-b7c5-bc690e569531", "local_bgp_asn": 13, "local_gateway_ip": "10.242.63.12", "local_tunnel_ip": "192.168.100.20", "mtu": 9000, "name": "gre1", "network_account_id": "network_account_id", "network_id": "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b", "remote_bgp_asn": 65010, "remote_gateway_ip": "10.242.33.22", "remote_tunnel_ip": "192.168.129.1", "status": "attached", "updated_at": "2019-01-01T12:00:00.000Z", "zone": {"name": "us-south-1"}}], "updated_at": "2019-01-01T12:00:00.000Z", "zone": {"name": "us-south-1"}}], "first": {"href": "https://transit.cloud.ibm.com/v1/transit_gateways/{transit_gateway_id}/connections?limit=50"}, "limit": 50, "next": {"href": "https://transit.cloud.ibm.com/v1/transit_gateways/{transit_gateway_id}/connections?start=MjAyMC0wNS0wOFQxNDoxNzowMy45NzQ5NzNa&limit=50", "start": "MjAyMC0wNS0wOFQxNDoxNzowMy45NzQ5NzNa"}, "total_count": 500}' + mock_response = '{"connections": [{"base_connection_id": "975f58c1-afe7-469a-9727-7f3d720f2d32", "base_network_type": "classic", "cidr": "198.19.174.0/23", "created_at": "2019-01-01T12:00:00.000Z", "id": "1a15dca5-7e33-45e1-b7c5-bc690e569531", "local_bgp_asn": 64490, "local_gateway_ip": "192.168.100.1", "local_tunnel_ip": "192.168.129.2", "mtu": 9000, "name": "Transit_Service_BWTN_SJ_DL", "network_account_id": "network_account_id", "network_id": "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b", "network_type": "vpc", "prefix_filters": [{"action": "permit", "before": "1a15dcab-7e40-45e1-b7c5-bc690eaa9782", "created_at": "2019-01-01T12:00:00.000Z", "ge": 0, "id": "1a15dcab-7e30-45e1-b7c5-bc690eaa9865", "le": 32, "prefix": "192.168.100.0/24", "updated_at": "2019-01-01T12:00:00.000Z"}], "prefix_filters_default": "permit", "remote_bgp_asn": 65010, "remote_gateway_ip": "10.242.63.12", "remote_tunnel_ip": "192.168.129.1", "request_status": "pending", "status": "attached", "tunnels": [{"base_network_type": "classic", "created_at": "2019-01-01T12:00:00.000Z", "id": "1a15dca5-7e33-45e1-b7c5-bc690e569531", "local_bgp_asn": 1, "local_gateway_ip": "10.242.63.12", "local_tunnel_ip": "192.168.100.20", "mtu": 9000, "name": "gre1", "network_account_id": "network_account_id", "network_id": "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b", "remote_bgp_asn": 65010, "remote_gateway_ip": "10.242.33.22", "remote_tunnel_ip": "192.168.129.1", "status": "attached", "updated_at": "2019-01-01T12:00:00.000Z", "zone": {"name": "us-south-1"}}], "updated_at": "2019-01-01T12:00:00.000Z", "zone": {"name": "us-south-1"}}], "first": {"href": "https://transit.cloud.ibm.com/v1/transit_gateways/{transit_gateway_id}/connections?limit=50"}, "limit": 50, "next": {"href": "https://transit.cloud.ibm.com/v1/transit_gateways/{transit_gateway_id}/connections?start=MjAyMC0wNS0wOFQxNDoxNzowMy45NzQ5NzNa&limit=50", "start": "MjAyMC0wNS0wOFQxNDoxNzowMy45NzQ5NzNa"}, "total_count": 500}' responses.add( responses.GET, url, @@ -1027,7 +1048,7 @@ def test_list_transit_gateway_connections_required_params(self): """ # Set up mock url = preprocess_url('/transit_gateways/testString/connections') - mock_response = '{"connections": [{"base_connection_id": "975f58c1-afe7-469a-9727-7f3d720f2d32", "base_network_type": "classic", "cidr": "192.168.0.0/24", "created_at": "2019-01-01T12:00:00.000Z", "id": "1a15dca5-7e33-45e1-b7c5-bc690e569531", "local_bgp_asn": 64490, "local_gateway_ip": "192.168.100.1", "local_tunnel_ip": "192.168.129.2", "mtu": 9000, "name": "Transit_Service_BWTN_SJ_DL", "network_account_id": "network_account_id", "network_id": "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b", "network_type": "vpc", "prefix_filters": [{"action": "permit", "before": "1a15dcab-7e40-45e1-b7c5-bc690eaa9782", "created_at": "2019-01-01T12:00:00.000Z", "ge": 0, "id": "1a15dcab-7e30-45e1-b7c5-bc690eaa9865", "le": 32, "prefix": "192.168.100.0/24", "updated_at": "2019-01-01T12:00:00.000Z"}], "prefix_filters_default": "permit", "remote_bgp_asn": 65010, "remote_gateway_ip": "10.242.63.12", "remote_tunnel_ip": "192.168.129.1", "request_status": "pending", "status": "attached", "tunnels": [{"base_network_type": "classic", "created_at": "2019-01-01T12:00:00.000Z", "id": "1a15dca5-7e33-45e1-b7c5-bc690e569531", "local_bgp_asn": 13, "local_gateway_ip": "10.242.63.12", "local_tunnel_ip": "192.168.100.20", "mtu": 9000, "name": "gre1", "network_account_id": "network_account_id", "network_id": "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b", "remote_bgp_asn": 65010, "remote_gateway_ip": "10.242.33.22", "remote_tunnel_ip": "192.168.129.1", "status": "attached", "updated_at": "2019-01-01T12:00:00.000Z", "zone": {"name": "us-south-1"}}], "updated_at": "2019-01-01T12:00:00.000Z", "zone": {"name": "us-south-1"}}], "first": {"href": "https://transit.cloud.ibm.com/v1/transit_gateways/{transit_gateway_id}/connections?limit=50"}, "limit": 50, "next": {"href": "https://transit.cloud.ibm.com/v1/transit_gateways/{transit_gateway_id}/connections?start=MjAyMC0wNS0wOFQxNDoxNzowMy45NzQ5NzNa&limit=50", "start": "MjAyMC0wNS0wOFQxNDoxNzowMy45NzQ5NzNa"}, "total_count": 500}' + mock_response = '{"connections": [{"base_connection_id": "975f58c1-afe7-469a-9727-7f3d720f2d32", "base_network_type": "classic", "cidr": "198.19.174.0/23", "created_at": "2019-01-01T12:00:00.000Z", "id": "1a15dca5-7e33-45e1-b7c5-bc690e569531", "local_bgp_asn": 64490, "local_gateway_ip": "192.168.100.1", "local_tunnel_ip": "192.168.129.2", "mtu": 9000, "name": "Transit_Service_BWTN_SJ_DL", "network_account_id": "network_account_id", "network_id": "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b", "network_type": "vpc", "prefix_filters": [{"action": "permit", "before": "1a15dcab-7e40-45e1-b7c5-bc690eaa9782", "created_at": "2019-01-01T12:00:00.000Z", "ge": 0, "id": "1a15dcab-7e30-45e1-b7c5-bc690eaa9865", "le": 32, "prefix": "192.168.100.0/24", "updated_at": "2019-01-01T12:00:00.000Z"}], "prefix_filters_default": "permit", "remote_bgp_asn": 65010, "remote_gateway_ip": "10.242.63.12", "remote_tunnel_ip": "192.168.129.1", "request_status": "pending", "status": "attached", "tunnels": [{"base_network_type": "classic", "created_at": "2019-01-01T12:00:00.000Z", "id": "1a15dca5-7e33-45e1-b7c5-bc690e569531", "local_bgp_asn": 1, "local_gateway_ip": "10.242.63.12", "local_tunnel_ip": "192.168.100.20", "mtu": 9000, "name": "gre1", "network_account_id": "network_account_id", "network_id": "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b", "remote_bgp_asn": 65010, "remote_gateway_ip": "10.242.33.22", "remote_tunnel_ip": "192.168.129.1", "status": "attached", "updated_at": "2019-01-01T12:00:00.000Z", "zone": {"name": "us-south-1"}}], "updated_at": "2019-01-01T12:00:00.000Z", "zone": {"name": "us-south-1"}}], "first": {"href": "https://transit.cloud.ibm.com/v1/transit_gateways/{transit_gateway_id}/connections?limit=50"}, "limit": 50, "next": {"href": "https://transit.cloud.ibm.com/v1/transit_gateways/{transit_gateway_id}/connections?start=MjAyMC0wNS0wOFQxNDoxNzowMy45NzQ5NzNa&limit=50", "start": "MjAyMC0wNS0wOFQxNDoxNzowMy45NzQ5NzNa"}, "total_count": 500}' responses.add( responses.GET, url, @@ -1065,7 +1086,7 @@ def test_list_transit_gateway_connections_value_error(self): """ # Set up mock url = preprocess_url('/transit_gateways/testString/connections') - mock_response = '{"connections": [{"base_connection_id": "975f58c1-afe7-469a-9727-7f3d720f2d32", "base_network_type": "classic", "cidr": "192.168.0.0/24", "created_at": "2019-01-01T12:00:00.000Z", "id": "1a15dca5-7e33-45e1-b7c5-bc690e569531", "local_bgp_asn": 64490, "local_gateway_ip": "192.168.100.1", "local_tunnel_ip": "192.168.129.2", "mtu": 9000, "name": "Transit_Service_BWTN_SJ_DL", "network_account_id": "network_account_id", "network_id": "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b", "network_type": "vpc", "prefix_filters": [{"action": "permit", "before": "1a15dcab-7e40-45e1-b7c5-bc690eaa9782", "created_at": "2019-01-01T12:00:00.000Z", "ge": 0, "id": "1a15dcab-7e30-45e1-b7c5-bc690eaa9865", "le": 32, "prefix": "192.168.100.0/24", "updated_at": "2019-01-01T12:00:00.000Z"}], "prefix_filters_default": "permit", "remote_bgp_asn": 65010, "remote_gateway_ip": "10.242.63.12", "remote_tunnel_ip": "192.168.129.1", "request_status": "pending", "status": "attached", "tunnels": [{"base_network_type": "classic", "created_at": "2019-01-01T12:00:00.000Z", "id": "1a15dca5-7e33-45e1-b7c5-bc690e569531", "local_bgp_asn": 13, "local_gateway_ip": "10.242.63.12", "local_tunnel_ip": "192.168.100.20", "mtu": 9000, "name": "gre1", "network_account_id": "network_account_id", "network_id": "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b", "remote_bgp_asn": 65010, "remote_gateway_ip": "10.242.33.22", "remote_tunnel_ip": "192.168.129.1", "status": "attached", "updated_at": "2019-01-01T12:00:00.000Z", "zone": {"name": "us-south-1"}}], "updated_at": "2019-01-01T12:00:00.000Z", "zone": {"name": "us-south-1"}}], "first": {"href": "https://transit.cloud.ibm.com/v1/transit_gateways/{transit_gateway_id}/connections?limit=50"}, "limit": 50, "next": {"href": "https://transit.cloud.ibm.com/v1/transit_gateways/{transit_gateway_id}/connections?start=MjAyMC0wNS0wOFQxNDoxNzowMy45NzQ5NzNa&limit=50", "start": "MjAyMC0wNS0wOFQxNDoxNzowMy45NzQ5NzNa"}, "total_count": 500}' + mock_response = '{"connections": [{"base_connection_id": "975f58c1-afe7-469a-9727-7f3d720f2d32", "base_network_type": "classic", "cidr": "198.19.174.0/23", "created_at": "2019-01-01T12:00:00.000Z", "id": "1a15dca5-7e33-45e1-b7c5-bc690e569531", "local_bgp_asn": 64490, "local_gateway_ip": "192.168.100.1", "local_tunnel_ip": "192.168.129.2", "mtu": 9000, "name": "Transit_Service_BWTN_SJ_DL", "network_account_id": "network_account_id", "network_id": "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b", "network_type": "vpc", "prefix_filters": [{"action": "permit", "before": "1a15dcab-7e40-45e1-b7c5-bc690eaa9782", "created_at": "2019-01-01T12:00:00.000Z", "ge": 0, "id": "1a15dcab-7e30-45e1-b7c5-bc690eaa9865", "le": 32, "prefix": "192.168.100.0/24", "updated_at": "2019-01-01T12:00:00.000Z"}], "prefix_filters_default": "permit", "remote_bgp_asn": 65010, "remote_gateway_ip": "10.242.63.12", "remote_tunnel_ip": "192.168.129.1", "request_status": "pending", "status": "attached", "tunnels": [{"base_network_type": "classic", "created_at": "2019-01-01T12:00:00.000Z", "id": "1a15dca5-7e33-45e1-b7c5-bc690e569531", "local_bgp_asn": 1, "local_gateway_ip": "10.242.63.12", "local_tunnel_ip": "192.168.100.20", "mtu": 9000, "name": "gre1", "network_account_id": "network_account_id", "network_id": "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b", "remote_bgp_asn": 65010, "remote_gateway_ip": "10.242.33.22", "remote_tunnel_ip": "192.168.129.1", "status": "attached", "updated_at": "2019-01-01T12:00:00.000Z", "zone": {"name": "us-south-1"}}], "updated_at": "2019-01-01T12:00:00.000Z", "zone": {"name": "us-south-1"}}], "first": {"href": "https://transit.cloud.ibm.com/v1/transit_gateways/{transit_gateway_id}/connections?limit=50"}, "limit": 50, "next": {"href": "https://transit.cloud.ibm.com/v1/transit_gateways/{transit_gateway_id}/connections?start=MjAyMC0wNS0wOFQxNDoxNzowMy45NzQ5NzNa&limit=50", "start": "MjAyMC0wNS0wOFQxNDoxNzowMy45NzQ5NzNa"}, "total_count": 500}' responses.add( responses.GET, url, @@ -1102,8 +1123,8 @@ def test_list_transit_gateway_connections_with_pager_get_next(self): """ # Set up a two-page mock response url = preprocess_url('/transit_gateways/testString/connections') - mock_response1 = '{"next":{"start":"1"},"total_count":2,"limit":1,"connections":[{"base_connection_id":"975f58c1-afe7-469a-9727-7f3d720f2d32","base_network_type":"classic","cidr":"192.168.0.0/24","created_at":"2019-01-01T12:00:00.000Z","id":"1a15dca5-7e33-45e1-b7c5-bc690e569531","local_bgp_asn":64490,"local_gateway_ip":"192.168.100.1","local_tunnel_ip":"192.168.129.2","mtu":9000,"name":"Transit_Service_BWTN_SJ_DL","network_account_id":"network_account_id","network_id":"crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b","network_type":"vpc","prefix_filters":[{"action":"permit","before":"1a15dcab-7e40-45e1-b7c5-bc690eaa9782","created_at":"2019-01-01T12:00:00.000Z","ge":0,"id":"1a15dcab-7e30-45e1-b7c5-bc690eaa9865","le":32,"prefix":"192.168.100.0/24","updated_at":"2019-01-01T12:00:00.000Z"}],"prefix_filters_default":"permit","remote_bgp_asn":65010,"remote_gateway_ip":"10.242.63.12","remote_tunnel_ip":"192.168.129.1","request_status":"pending","status":"attached","tunnels":[{"base_network_type":"classic","created_at":"2019-01-01T12:00:00.000Z","id":"1a15dca5-7e33-45e1-b7c5-bc690e569531","local_bgp_asn":13,"local_gateway_ip":"10.242.63.12","local_tunnel_ip":"192.168.100.20","mtu":9000,"name":"gre1","network_account_id":"network_account_id","network_id":"crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b","remote_bgp_asn":65010,"remote_gateway_ip":"10.242.33.22","remote_tunnel_ip":"192.168.129.1","status":"attached","updated_at":"2019-01-01T12:00:00.000Z","zone":{"name":"us-south-1"}}],"updated_at":"2019-01-01T12:00:00.000Z","zone":{"name":"us-south-1"}}]}' - mock_response2 = '{"total_count":2,"limit":1,"connections":[{"base_connection_id":"975f58c1-afe7-469a-9727-7f3d720f2d32","base_network_type":"classic","cidr":"192.168.0.0/24","created_at":"2019-01-01T12:00:00.000Z","id":"1a15dca5-7e33-45e1-b7c5-bc690e569531","local_bgp_asn":64490,"local_gateway_ip":"192.168.100.1","local_tunnel_ip":"192.168.129.2","mtu":9000,"name":"Transit_Service_BWTN_SJ_DL","network_account_id":"network_account_id","network_id":"crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b","network_type":"vpc","prefix_filters":[{"action":"permit","before":"1a15dcab-7e40-45e1-b7c5-bc690eaa9782","created_at":"2019-01-01T12:00:00.000Z","ge":0,"id":"1a15dcab-7e30-45e1-b7c5-bc690eaa9865","le":32,"prefix":"192.168.100.0/24","updated_at":"2019-01-01T12:00:00.000Z"}],"prefix_filters_default":"permit","remote_bgp_asn":65010,"remote_gateway_ip":"10.242.63.12","remote_tunnel_ip":"192.168.129.1","request_status":"pending","status":"attached","tunnels":[{"base_network_type":"classic","created_at":"2019-01-01T12:00:00.000Z","id":"1a15dca5-7e33-45e1-b7c5-bc690e569531","local_bgp_asn":13,"local_gateway_ip":"10.242.63.12","local_tunnel_ip":"192.168.100.20","mtu":9000,"name":"gre1","network_account_id":"network_account_id","network_id":"crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b","remote_bgp_asn":65010,"remote_gateway_ip":"10.242.33.22","remote_tunnel_ip":"192.168.129.1","status":"attached","updated_at":"2019-01-01T12:00:00.000Z","zone":{"name":"us-south-1"}}],"updated_at":"2019-01-01T12:00:00.000Z","zone":{"name":"us-south-1"}}]}' + mock_response1 = '{"next":{"start":"1"},"total_count":2,"limit":1,"connections":[{"base_connection_id":"975f58c1-afe7-469a-9727-7f3d720f2d32","base_network_type":"classic","cidr":"198.19.174.0/23","created_at":"2019-01-01T12:00:00.000Z","id":"1a15dca5-7e33-45e1-b7c5-bc690e569531","local_bgp_asn":64490,"local_gateway_ip":"192.168.100.1","local_tunnel_ip":"192.168.129.2","mtu":9000,"name":"Transit_Service_BWTN_SJ_DL","network_account_id":"network_account_id","network_id":"crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b","network_type":"vpc","prefix_filters":[{"action":"permit","before":"1a15dcab-7e40-45e1-b7c5-bc690eaa9782","created_at":"2019-01-01T12:00:00.000Z","ge":0,"id":"1a15dcab-7e30-45e1-b7c5-bc690eaa9865","le":32,"prefix":"192.168.100.0/24","updated_at":"2019-01-01T12:00:00.000Z"}],"prefix_filters_default":"permit","remote_bgp_asn":65010,"remote_gateway_ip":"10.242.63.12","remote_tunnel_ip":"192.168.129.1","request_status":"pending","status":"attached","tunnels":[{"base_network_type":"classic","created_at":"2019-01-01T12:00:00.000Z","id":"1a15dca5-7e33-45e1-b7c5-bc690e569531","local_bgp_asn":1,"local_gateway_ip":"10.242.63.12","local_tunnel_ip":"192.168.100.20","mtu":9000,"name":"gre1","network_account_id":"network_account_id","network_id":"crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b","remote_bgp_asn":65010,"remote_gateway_ip":"10.242.33.22","remote_tunnel_ip":"192.168.129.1","status":"attached","updated_at":"2019-01-01T12:00:00.000Z","zone":{"name":"us-south-1"}}],"updated_at":"2019-01-01T12:00:00.000Z","zone":{"name":"us-south-1"}}]}' + mock_response2 = '{"total_count":2,"limit":1,"connections":[{"base_connection_id":"975f58c1-afe7-469a-9727-7f3d720f2d32","base_network_type":"classic","cidr":"198.19.174.0/23","created_at":"2019-01-01T12:00:00.000Z","id":"1a15dca5-7e33-45e1-b7c5-bc690e569531","local_bgp_asn":64490,"local_gateway_ip":"192.168.100.1","local_tunnel_ip":"192.168.129.2","mtu":9000,"name":"Transit_Service_BWTN_SJ_DL","network_account_id":"network_account_id","network_id":"crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b","network_type":"vpc","prefix_filters":[{"action":"permit","before":"1a15dcab-7e40-45e1-b7c5-bc690eaa9782","created_at":"2019-01-01T12:00:00.000Z","ge":0,"id":"1a15dcab-7e30-45e1-b7c5-bc690eaa9865","le":32,"prefix":"192.168.100.0/24","updated_at":"2019-01-01T12:00:00.000Z"}],"prefix_filters_default":"permit","remote_bgp_asn":65010,"remote_gateway_ip":"10.242.63.12","remote_tunnel_ip":"192.168.129.1","request_status":"pending","status":"attached","tunnels":[{"base_network_type":"classic","created_at":"2019-01-01T12:00:00.000Z","id":"1a15dca5-7e33-45e1-b7c5-bc690e569531","local_bgp_asn":1,"local_gateway_ip":"10.242.63.12","local_tunnel_ip":"192.168.100.20","mtu":9000,"name":"gre1","network_account_id":"network_account_id","network_id":"crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b","remote_bgp_asn":65010,"remote_gateway_ip":"10.242.33.22","remote_tunnel_ip":"192.168.129.1","status":"attached","updated_at":"2019-01-01T12:00:00.000Z","zone":{"name":"us-south-1"}}],"updated_at":"2019-01-01T12:00:00.000Z","zone":{"name":"us-south-1"}}]}' responses.add( responses.GET, url, @@ -1140,8 +1161,8 @@ def test_list_transit_gateway_connections_with_pager_get_all(self): """ # Set up a two-page mock response url = preprocess_url('/transit_gateways/testString/connections') - mock_response1 = '{"next":{"start":"1"},"total_count":2,"limit":1,"connections":[{"base_connection_id":"975f58c1-afe7-469a-9727-7f3d720f2d32","base_network_type":"classic","cidr":"192.168.0.0/24","created_at":"2019-01-01T12:00:00.000Z","id":"1a15dca5-7e33-45e1-b7c5-bc690e569531","local_bgp_asn":64490,"local_gateway_ip":"192.168.100.1","local_tunnel_ip":"192.168.129.2","mtu":9000,"name":"Transit_Service_BWTN_SJ_DL","network_account_id":"network_account_id","network_id":"crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b","network_type":"vpc","prefix_filters":[{"action":"permit","before":"1a15dcab-7e40-45e1-b7c5-bc690eaa9782","created_at":"2019-01-01T12:00:00.000Z","ge":0,"id":"1a15dcab-7e30-45e1-b7c5-bc690eaa9865","le":32,"prefix":"192.168.100.0/24","updated_at":"2019-01-01T12:00:00.000Z"}],"prefix_filters_default":"permit","remote_bgp_asn":65010,"remote_gateway_ip":"10.242.63.12","remote_tunnel_ip":"192.168.129.1","request_status":"pending","status":"attached","tunnels":[{"base_network_type":"classic","created_at":"2019-01-01T12:00:00.000Z","id":"1a15dca5-7e33-45e1-b7c5-bc690e569531","local_bgp_asn":13,"local_gateway_ip":"10.242.63.12","local_tunnel_ip":"192.168.100.20","mtu":9000,"name":"gre1","network_account_id":"network_account_id","network_id":"crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b","remote_bgp_asn":65010,"remote_gateway_ip":"10.242.33.22","remote_tunnel_ip":"192.168.129.1","status":"attached","updated_at":"2019-01-01T12:00:00.000Z","zone":{"name":"us-south-1"}}],"updated_at":"2019-01-01T12:00:00.000Z","zone":{"name":"us-south-1"}}]}' - mock_response2 = '{"total_count":2,"limit":1,"connections":[{"base_connection_id":"975f58c1-afe7-469a-9727-7f3d720f2d32","base_network_type":"classic","cidr":"192.168.0.0/24","created_at":"2019-01-01T12:00:00.000Z","id":"1a15dca5-7e33-45e1-b7c5-bc690e569531","local_bgp_asn":64490,"local_gateway_ip":"192.168.100.1","local_tunnel_ip":"192.168.129.2","mtu":9000,"name":"Transit_Service_BWTN_SJ_DL","network_account_id":"network_account_id","network_id":"crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b","network_type":"vpc","prefix_filters":[{"action":"permit","before":"1a15dcab-7e40-45e1-b7c5-bc690eaa9782","created_at":"2019-01-01T12:00:00.000Z","ge":0,"id":"1a15dcab-7e30-45e1-b7c5-bc690eaa9865","le":32,"prefix":"192.168.100.0/24","updated_at":"2019-01-01T12:00:00.000Z"}],"prefix_filters_default":"permit","remote_bgp_asn":65010,"remote_gateway_ip":"10.242.63.12","remote_tunnel_ip":"192.168.129.1","request_status":"pending","status":"attached","tunnels":[{"base_network_type":"classic","created_at":"2019-01-01T12:00:00.000Z","id":"1a15dca5-7e33-45e1-b7c5-bc690e569531","local_bgp_asn":13,"local_gateway_ip":"10.242.63.12","local_tunnel_ip":"192.168.100.20","mtu":9000,"name":"gre1","network_account_id":"network_account_id","network_id":"crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b","remote_bgp_asn":65010,"remote_gateway_ip":"10.242.33.22","remote_tunnel_ip":"192.168.129.1","status":"attached","updated_at":"2019-01-01T12:00:00.000Z","zone":{"name":"us-south-1"}}],"updated_at":"2019-01-01T12:00:00.000Z","zone":{"name":"us-south-1"}}]}' + mock_response1 = '{"next":{"start":"1"},"total_count":2,"limit":1,"connections":[{"base_connection_id":"975f58c1-afe7-469a-9727-7f3d720f2d32","base_network_type":"classic","cidr":"198.19.174.0/23","created_at":"2019-01-01T12:00:00.000Z","id":"1a15dca5-7e33-45e1-b7c5-bc690e569531","local_bgp_asn":64490,"local_gateway_ip":"192.168.100.1","local_tunnel_ip":"192.168.129.2","mtu":9000,"name":"Transit_Service_BWTN_SJ_DL","network_account_id":"network_account_id","network_id":"crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b","network_type":"vpc","prefix_filters":[{"action":"permit","before":"1a15dcab-7e40-45e1-b7c5-bc690eaa9782","created_at":"2019-01-01T12:00:00.000Z","ge":0,"id":"1a15dcab-7e30-45e1-b7c5-bc690eaa9865","le":32,"prefix":"192.168.100.0/24","updated_at":"2019-01-01T12:00:00.000Z"}],"prefix_filters_default":"permit","remote_bgp_asn":65010,"remote_gateway_ip":"10.242.63.12","remote_tunnel_ip":"192.168.129.1","request_status":"pending","status":"attached","tunnels":[{"base_network_type":"classic","created_at":"2019-01-01T12:00:00.000Z","id":"1a15dca5-7e33-45e1-b7c5-bc690e569531","local_bgp_asn":1,"local_gateway_ip":"10.242.63.12","local_tunnel_ip":"192.168.100.20","mtu":9000,"name":"gre1","network_account_id":"network_account_id","network_id":"crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b","remote_bgp_asn":65010,"remote_gateway_ip":"10.242.33.22","remote_tunnel_ip":"192.168.129.1","status":"attached","updated_at":"2019-01-01T12:00:00.000Z","zone":{"name":"us-south-1"}}],"updated_at":"2019-01-01T12:00:00.000Z","zone":{"name":"us-south-1"}}]}' + mock_response2 = '{"total_count":2,"limit":1,"connections":[{"base_connection_id":"975f58c1-afe7-469a-9727-7f3d720f2d32","base_network_type":"classic","cidr":"198.19.174.0/23","created_at":"2019-01-01T12:00:00.000Z","id":"1a15dca5-7e33-45e1-b7c5-bc690e569531","local_bgp_asn":64490,"local_gateway_ip":"192.168.100.1","local_tunnel_ip":"192.168.129.2","mtu":9000,"name":"Transit_Service_BWTN_SJ_DL","network_account_id":"network_account_id","network_id":"crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b","network_type":"vpc","prefix_filters":[{"action":"permit","before":"1a15dcab-7e40-45e1-b7c5-bc690eaa9782","created_at":"2019-01-01T12:00:00.000Z","ge":0,"id":"1a15dcab-7e30-45e1-b7c5-bc690eaa9865","le":32,"prefix":"192.168.100.0/24","updated_at":"2019-01-01T12:00:00.000Z"}],"prefix_filters_default":"permit","remote_bgp_asn":65010,"remote_gateway_ip":"10.242.63.12","remote_tunnel_ip":"192.168.129.1","request_status":"pending","status":"attached","tunnels":[{"base_network_type":"classic","created_at":"2019-01-01T12:00:00.000Z","id":"1a15dca5-7e33-45e1-b7c5-bc690e569531","local_bgp_asn":1,"local_gateway_ip":"10.242.63.12","local_tunnel_ip":"192.168.100.20","mtu":9000,"name":"gre1","network_account_id":"network_account_id","network_id":"crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b","remote_bgp_asn":65010,"remote_gateway_ip":"10.242.33.22","remote_tunnel_ip":"192.168.129.1","status":"attached","updated_at":"2019-01-01T12:00:00.000Z","zone":{"name":"us-south-1"}}],"updated_at":"2019-01-01T12:00:00.000Z","zone":{"name":"us-south-1"}}]}' responses.add( responses.GET, url, @@ -1181,7 +1202,7 @@ def test_create_transit_gateway_connection_all_params(self): """ # Set up mock url = preprocess_url('/transit_gateways/testString/connections') - mock_response = '{"base_connection_id": "975f58c1-afe7-469a-9727-7f3d720f2d32", "base_network_type": "classic", "cidr": "192.168.0.0/24", "created_at": "2019-01-01T12:00:00.000Z", "id": "1a15dca5-7e33-45e1-b7c5-bc690e569531", "local_bgp_asn": 64490, "local_gateway_ip": "192.168.100.1", "local_tunnel_ip": "192.168.129.2", "mtu": 9000, "name": "Transit_Service_BWTN_SJ_DL", "network_account_id": "network_account_id", "network_id": "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b", "network_type": "vpc", "prefix_filters": [{"action": "permit", "before": "1a15dcab-7e40-45e1-b7c5-bc690eaa9782", "created_at": "2019-01-01T12:00:00.000Z", "ge": 0, "id": "1a15dcab-7e30-45e1-b7c5-bc690eaa9865", "le": 32, "prefix": "192.168.100.0/24", "updated_at": "2019-01-01T12:00:00.000Z"}], "prefix_filters_default": "permit", "remote_bgp_asn": 65010, "remote_gateway_ip": "10.242.63.12", "remote_tunnel_ip": "192.168.129.1", "request_status": "pending", "status": "attached", "tunnels": [{"base_network_type": "classic", "created_at": "2019-01-01T12:00:00.000Z", "id": "1a15dca5-7e33-45e1-b7c5-bc690e569531", "local_bgp_asn": 13, "local_gateway_ip": "10.242.63.12", "local_tunnel_ip": "192.168.100.20", "mtu": 9000, "name": "gre1", "network_account_id": "network_account_id", "network_id": "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b", "remote_bgp_asn": 65010, "remote_gateway_ip": "10.242.33.22", "remote_tunnel_ip": "192.168.129.1", "status": "attached", "updated_at": "2019-01-01T12:00:00.000Z", "zone": {"name": "us-south-1"}}], "updated_at": "2019-01-01T12:00:00.000Z", "zone": {"name": "us-south-1"}}' + mock_response = '{"base_connection_id": "975f58c1-afe7-469a-9727-7f3d720f2d32", "base_network_type": "classic", "cidr": "198.19.174.0/23", "created_at": "2019-01-01T12:00:00.000Z", "id": "1a15dca5-7e33-45e1-b7c5-bc690e569531", "local_bgp_asn": 64490, "local_gateway_ip": "192.168.100.1", "local_tunnel_ip": "192.168.129.2", "mtu": 9000, "name": "Transit_Service_BWTN_SJ_DL", "network_account_id": "network_account_id", "network_id": "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b", "network_type": "vpc", "prefix_filters": [{"action": "permit", "before": "1a15dcab-7e40-45e1-b7c5-bc690eaa9782", "created_at": "2019-01-01T12:00:00.000Z", "ge": 0, "id": "1a15dcab-7e30-45e1-b7c5-bc690eaa9865", "le": 32, "prefix": "192.168.100.0/24", "updated_at": "2019-01-01T12:00:00.000Z"}], "prefix_filters_default": "permit", "remote_bgp_asn": 65010, "remote_gateway_ip": "10.242.63.12", "remote_tunnel_ip": "192.168.129.1", "request_status": "pending", "status": "attached", "tunnels": [{"base_network_type": "classic", "created_at": "2019-01-01T12:00:00.000Z", "id": "1a15dca5-7e33-45e1-b7c5-bc690e569531", "local_bgp_asn": 1, "local_gateway_ip": "10.242.63.12", "local_tunnel_ip": "192.168.100.20", "mtu": 9000, "name": "gre1", "network_account_id": "network_account_id", "network_id": "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b", "remote_bgp_asn": 65010, "remote_gateway_ip": "10.242.33.22", "remote_tunnel_ip": "192.168.129.1", "status": "attached", "updated_at": "2019-01-01T12:00:00.000Z", "zone": {"name": "us-south-1"}}], "updated_at": "2019-01-01T12:00:00.000Z", "zone": {"name": "us-south-1"}}' responses.add( responses.POST, url, @@ -1216,7 +1237,7 @@ def test_create_transit_gateway_connection_all_params(self): network_type = 'vpc' base_connection_id = '975f58c1-afe7-469a-9727-7f3d720f2d32' base_network_type = 'classic' - cidr = '192.168.0.0/24' + cidr = '198.19.174.0/23' local_gateway_ip = '192.168.100.1' local_tunnel_ip = '192.168.129.2' name = 'Transit_Service_BWTN_SJ_DL' @@ -1260,7 +1281,7 @@ def test_create_transit_gateway_connection_all_params(self): assert req_body['network_type'] == 'vpc' assert req_body['base_connection_id'] == '975f58c1-afe7-469a-9727-7f3d720f2d32' assert req_body['base_network_type'] == 'classic' - assert req_body['cidr'] == '192.168.0.0/24' + assert req_body['cidr'] == '198.19.174.0/23' assert req_body['local_gateway_ip'] == '192.168.100.1' assert req_body['local_tunnel_ip'] == '192.168.129.2' assert req_body['name'] == 'Transit_Service_BWTN_SJ_DL' @@ -1290,7 +1311,7 @@ def test_create_transit_gateway_connection_value_error(self): """ # Set up mock url = preprocess_url('/transit_gateways/testString/connections') - mock_response = '{"base_connection_id": "975f58c1-afe7-469a-9727-7f3d720f2d32", "base_network_type": "classic", "cidr": "192.168.0.0/24", "created_at": "2019-01-01T12:00:00.000Z", "id": "1a15dca5-7e33-45e1-b7c5-bc690e569531", "local_bgp_asn": 64490, "local_gateway_ip": "192.168.100.1", "local_tunnel_ip": "192.168.129.2", "mtu": 9000, "name": "Transit_Service_BWTN_SJ_DL", "network_account_id": "network_account_id", "network_id": "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b", "network_type": "vpc", "prefix_filters": [{"action": "permit", "before": "1a15dcab-7e40-45e1-b7c5-bc690eaa9782", "created_at": "2019-01-01T12:00:00.000Z", "ge": 0, "id": "1a15dcab-7e30-45e1-b7c5-bc690eaa9865", "le": 32, "prefix": "192.168.100.0/24", "updated_at": "2019-01-01T12:00:00.000Z"}], "prefix_filters_default": "permit", "remote_bgp_asn": 65010, "remote_gateway_ip": "10.242.63.12", "remote_tunnel_ip": "192.168.129.1", "request_status": "pending", "status": "attached", "tunnels": [{"base_network_type": "classic", "created_at": "2019-01-01T12:00:00.000Z", "id": "1a15dca5-7e33-45e1-b7c5-bc690e569531", "local_bgp_asn": 13, "local_gateway_ip": "10.242.63.12", "local_tunnel_ip": "192.168.100.20", "mtu": 9000, "name": "gre1", "network_account_id": "network_account_id", "network_id": "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b", "remote_bgp_asn": 65010, "remote_gateway_ip": "10.242.33.22", "remote_tunnel_ip": "192.168.129.1", "status": "attached", "updated_at": "2019-01-01T12:00:00.000Z", "zone": {"name": "us-south-1"}}], "updated_at": "2019-01-01T12:00:00.000Z", "zone": {"name": "us-south-1"}}' + mock_response = '{"base_connection_id": "975f58c1-afe7-469a-9727-7f3d720f2d32", "base_network_type": "classic", "cidr": "198.19.174.0/23", "created_at": "2019-01-01T12:00:00.000Z", "id": "1a15dca5-7e33-45e1-b7c5-bc690e569531", "local_bgp_asn": 64490, "local_gateway_ip": "192.168.100.1", "local_tunnel_ip": "192.168.129.2", "mtu": 9000, "name": "Transit_Service_BWTN_SJ_DL", "network_account_id": "network_account_id", "network_id": "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b", "network_type": "vpc", "prefix_filters": [{"action": "permit", "before": "1a15dcab-7e40-45e1-b7c5-bc690eaa9782", "created_at": "2019-01-01T12:00:00.000Z", "ge": 0, "id": "1a15dcab-7e30-45e1-b7c5-bc690eaa9865", "le": 32, "prefix": "192.168.100.0/24", "updated_at": "2019-01-01T12:00:00.000Z"}], "prefix_filters_default": "permit", "remote_bgp_asn": 65010, "remote_gateway_ip": "10.242.63.12", "remote_tunnel_ip": "192.168.129.1", "request_status": "pending", "status": "attached", "tunnels": [{"base_network_type": "classic", "created_at": "2019-01-01T12:00:00.000Z", "id": "1a15dca5-7e33-45e1-b7c5-bc690e569531", "local_bgp_asn": 1, "local_gateway_ip": "10.242.63.12", "local_tunnel_ip": "192.168.100.20", "mtu": 9000, "name": "gre1", "network_account_id": "network_account_id", "network_id": "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b", "remote_bgp_asn": 65010, "remote_gateway_ip": "10.242.33.22", "remote_tunnel_ip": "192.168.129.1", "status": "attached", "updated_at": "2019-01-01T12:00:00.000Z", "zone": {"name": "us-south-1"}}], "updated_at": "2019-01-01T12:00:00.000Z", "zone": {"name": "us-south-1"}}' responses.add( responses.POST, url, @@ -1325,7 +1346,7 @@ def test_create_transit_gateway_connection_value_error(self): network_type = 'vpc' base_connection_id = '975f58c1-afe7-469a-9727-7f3d720f2d32' base_network_type = 'classic' - cidr = '192.168.0.0/24' + cidr = '198.19.174.0/23' local_gateway_ip = '192.168.100.1' local_tunnel_ip = '192.168.129.2' name = 'Transit_Service_BWTN_SJ_DL' @@ -1450,7 +1471,7 @@ def test_get_transit_gateway_connection_all_params(self): """ # Set up mock url = preprocess_url('/transit_gateways/testString/connections/testString') - mock_response = '{"base_connection_id": "975f58c1-afe7-469a-9727-7f3d720f2d32", "base_network_type": "classic", "cidr": "192.168.0.0/24", "created_at": "2019-01-01T12:00:00.000Z", "id": "1a15dca5-7e33-45e1-b7c5-bc690e569531", "local_bgp_asn": 64490, "local_gateway_ip": "192.168.100.1", "local_tunnel_ip": "192.168.129.2", "mtu": 9000, "name": "Transit_Service_BWTN_SJ_DL", "network_account_id": "network_account_id", "network_id": "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b", "network_type": "vpc", "prefix_filters": [{"action": "permit", "before": "1a15dcab-7e40-45e1-b7c5-bc690eaa9782", "created_at": "2019-01-01T12:00:00.000Z", "ge": 0, "id": "1a15dcab-7e30-45e1-b7c5-bc690eaa9865", "le": 32, "prefix": "192.168.100.0/24", "updated_at": "2019-01-01T12:00:00.000Z"}], "prefix_filters_default": "permit", "remote_bgp_asn": 65010, "remote_gateway_ip": "10.242.63.12", "remote_tunnel_ip": "192.168.129.1", "request_status": "pending", "status": "attached", "tunnels": [{"base_network_type": "classic", "created_at": "2019-01-01T12:00:00.000Z", "id": "1a15dca5-7e33-45e1-b7c5-bc690e569531", "local_bgp_asn": 13, "local_gateway_ip": "10.242.63.12", "local_tunnel_ip": "192.168.100.20", "mtu": 9000, "name": "gre1", "network_account_id": "network_account_id", "network_id": "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b", "remote_bgp_asn": 65010, "remote_gateway_ip": "10.242.33.22", "remote_tunnel_ip": "192.168.129.1", "status": "attached", "updated_at": "2019-01-01T12:00:00.000Z", "zone": {"name": "us-south-1"}}], "updated_at": "2019-01-01T12:00:00.000Z", "zone": {"name": "us-south-1"}}' + mock_response = '{"base_connection_id": "975f58c1-afe7-469a-9727-7f3d720f2d32", "base_network_type": "classic", "cidr": "198.19.174.0/23", "created_at": "2019-01-01T12:00:00.000Z", "id": "1a15dca5-7e33-45e1-b7c5-bc690e569531", "local_bgp_asn": 64490, "local_gateway_ip": "192.168.100.1", "local_tunnel_ip": "192.168.129.2", "mtu": 9000, "name": "Transit_Service_BWTN_SJ_DL", "network_account_id": "network_account_id", "network_id": "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b", "network_type": "vpc", "prefix_filters": [{"action": "permit", "before": "1a15dcab-7e40-45e1-b7c5-bc690eaa9782", "created_at": "2019-01-01T12:00:00.000Z", "ge": 0, "id": "1a15dcab-7e30-45e1-b7c5-bc690eaa9865", "le": 32, "prefix": "192.168.100.0/24", "updated_at": "2019-01-01T12:00:00.000Z"}], "prefix_filters_default": "permit", "remote_bgp_asn": 65010, "remote_gateway_ip": "10.242.63.12", "remote_tunnel_ip": "192.168.129.1", "request_status": "pending", "status": "attached", "tunnels": [{"base_network_type": "classic", "created_at": "2019-01-01T12:00:00.000Z", "id": "1a15dca5-7e33-45e1-b7c5-bc690e569531", "local_bgp_asn": 1, "local_gateway_ip": "10.242.63.12", "local_tunnel_ip": "192.168.100.20", "mtu": 9000, "name": "gre1", "network_account_id": "network_account_id", "network_id": "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b", "remote_bgp_asn": 65010, "remote_gateway_ip": "10.242.33.22", "remote_tunnel_ip": "192.168.129.1", "status": "attached", "updated_at": "2019-01-01T12:00:00.000Z", "zone": {"name": "us-south-1"}}], "updated_at": "2019-01-01T12:00:00.000Z", "zone": {"name": "us-south-1"}}' responses.add( responses.GET, url, @@ -1490,7 +1511,7 @@ def test_get_transit_gateway_connection_value_error(self): """ # Set up mock url = preprocess_url('/transit_gateways/testString/connections/testString') - mock_response = '{"base_connection_id": "975f58c1-afe7-469a-9727-7f3d720f2d32", "base_network_type": "classic", "cidr": "192.168.0.0/24", "created_at": "2019-01-01T12:00:00.000Z", "id": "1a15dca5-7e33-45e1-b7c5-bc690e569531", "local_bgp_asn": 64490, "local_gateway_ip": "192.168.100.1", "local_tunnel_ip": "192.168.129.2", "mtu": 9000, "name": "Transit_Service_BWTN_SJ_DL", "network_account_id": "network_account_id", "network_id": "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b", "network_type": "vpc", "prefix_filters": [{"action": "permit", "before": "1a15dcab-7e40-45e1-b7c5-bc690eaa9782", "created_at": "2019-01-01T12:00:00.000Z", "ge": 0, "id": "1a15dcab-7e30-45e1-b7c5-bc690eaa9865", "le": 32, "prefix": "192.168.100.0/24", "updated_at": "2019-01-01T12:00:00.000Z"}], "prefix_filters_default": "permit", "remote_bgp_asn": 65010, "remote_gateway_ip": "10.242.63.12", "remote_tunnel_ip": "192.168.129.1", "request_status": "pending", "status": "attached", "tunnels": [{"base_network_type": "classic", "created_at": "2019-01-01T12:00:00.000Z", "id": "1a15dca5-7e33-45e1-b7c5-bc690e569531", "local_bgp_asn": 13, "local_gateway_ip": "10.242.63.12", "local_tunnel_ip": "192.168.100.20", "mtu": 9000, "name": "gre1", "network_account_id": "network_account_id", "network_id": "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b", "remote_bgp_asn": 65010, "remote_gateway_ip": "10.242.33.22", "remote_tunnel_ip": "192.168.129.1", "status": "attached", "updated_at": "2019-01-01T12:00:00.000Z", "zone": {"name": "us-south-1"}}], "updated_at": "2019-01-01T12:00:00.000Z", "zone": {"name": "us-south-1"}}' + mock_response = '{"base_connection_id": "975f58c1-afe7-469a-9727-7f3d720f2d32", "base_network_type": "classic", "cidr": "198.19.174.0/23", "created_at": "2019-01-01T12:00:00.000Z", "id": "1a15dca5-7e33-45e1-b7c5-bc690e569531", "local_bgp_asn": 64490, "local_gateway_ip": "192.168.100.1", "local_tunnel_ip": "192.168.129.2", "mtu": 9000, "name": "Transit_Service_BWTN_SJ_DL", "network_account_id": "network_account_id", "network_id": "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b", "network_type": "vpc", "prefix_filters": [{"action": "permit", "before": "1a15dcab-7e40-45e1-b7c5-bc690eaa9782", "created_at": "2019-01-01T12:00:00.000Z", "ge": 0, "id": "1a15dcab-7e30-45e1-b7c5-bc690eaa9865", "le": 32, "prefix": "192.168.100.0/24", "updated_at": "2019-01-01T12:00:00.000Z"}], "prefix_filters_default": "permit", "remote_bgp_asn": 65010, "remote_gateway_ip": "10.242.63.12", "remote_tunnel_ip": "192.168.129.1", "request_status": "pending", "status": "attached", "tunnels": [{"base_network_type": "classic", "created_at": "2019-01-01T12:00:00.000Z", "id": "1a15dca5-7e33-45e1-b7c5-bc690e569531", "local_bgp_asn": 1, "local_gateway_ip": "10.242.63.12", "local_tunnel_ip": "192.168.100.20", "mtu": 9000, "name": "gre1", "network_account_id": "network_account_id", "network_id": "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b", "remote_bgp_asn": 65010, "remote_gateway_ip": "10.242.33.22", "remote_tunnel_ip": "192.168.129.1", "status": "attached", "updated_at": "2019-01-01T12:00:00.000Z", "zone": {"name": "us-south-1"}}], "updated_at": "2019-01-01T12:00:00.000Z", "zone": {"name": "us-south-1"}}' responses.add( responses.GET, url, @@ -1535,7 +1556,7 @@ def test_update_transit_gateway_connection_all_params(self): """ # Set up mock url = preprocess_url('/transit_gateways/testString/connections/testString') - mock_response = '{"base_connection_id": "975f58c1-afe7-469a-9727-7f3d720f2d32", "base_network_type": "classic", "cidr": "192.168.0.0/24", "created_at": "2019-01-01T12:00:00.000Z", "id": "1a15dca5-7e33-45e1-b7c5-bc690e569531", "local_bgp_asn": 64490, "local_gateway_ip": "192.168.100.1", "local_tunnel_ip": "192.168.129.2", "mtu": 9000, "name": "Transit_Service_BWTN_SJ_DL", "network_account_id": "network_account_id", "network_id": "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b", "network_type": "vpc", "prefix_filters": [{"action": "permit", "before": "1a15dcab-7e40-45e1-b7c5-bc690eaa9782", "created_at": "2019-01-01T12:00:00.000Z", "ge": 0, "id": "1a15dcab-7e30-45e1-b7c5-bc690eaa9865", "le": 32, "prefix": "192.168.100.0/24", "updated_at": "2019-01-01T12:00:00.000Z"}], "prefix_filters_default": "permit", "remote_bgp_asn": 65010, "remote_gateway_ip": "10.242.63.12", "remote_tunnel_ip": "192.168.129.1", "request_status": "pending", "status": "attached", "tunnels": [{"base_network_type": "classic", "created_at": "2019-01-01T12:00:00.000Z", "id": "1a15dca5-7e33-45e1-b7c5-bc690e569531", "local_bgp_asn": 13, "local_gateway_ip": "10.242.63.12", "local_tunnel_ip": "192.168.100.20", "mtu": 9000, "name": "gre1", "network_account_id": "network_account_id", "network_id": "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b", "remote_bgp_asn": 65010, "remote_gateway_ip": "10.242.33.22", "remote_tunnel_ip": "192.168.129.1", "status": "attached", "updated_at": "2019-01-01T12:00:00.000Z", "zone": {"name": "us-south-1"}}], "updated_at": "2019-01-01T12:00:00.000Z", "zone": {"name": "us-south-1"}}' + mock_response = '{"base_connection_id": "975f58c1-afe7-469a-9727-7f3d720f2d32", "base_network_type": "classic", "cidr": "198.19.174.0/23", "created_at": "2019-01-01T12:00:00.000Z", "id": "1a15dca5-7e33-45e1-b7c5-bc690e569531", "local_bgp_asn": 64490, "local_gateway_ip": "192.168.100.1", "local_tunnel_ip": "192.168.129.2", "mtu": 9000, "name": "Transit_Service_BWTN_SJ_DL", "network_account_id": "network_account_id", "network_id": "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b", "network_type": "vpc", "prefix_filters": [{"action": "permit", "before": "1a15dcab-7e40-45e1-b7c5-bc690eaa9782", "created_at": "2019-01-01T12:00:00.000Z", "ge": 0, "id": "1a15dcab-7e30-45e1-b7c5-bc690eaa9865", "le": 32, "prefix": "192.168.100.0/24", "updated_at": "2019-01-01T12:00:00.000Z"}], "prefix_filters_default": "permit", "remote_bgp_asn": 65010, "remote_gateway_ip": "10.242.63.12", "remote_tunnel_ip": "192.168.129.1", "request_status": "pending", "status": "attached", "tunnels": [{"base_network_type": "classic", "created_at": "2019-01-01T12:00:00.000Z", "id": "1a15dca5-7e33-45e1-b7c5-bc690e569531", "local_bgp_asn": 1, "local_gateway_ip": "10.242.63.12", "local_tunnel_ip": "192.168.100.20", "mtu": 9000, "name": "gre1", "network_account_id": "network_account_id", "network_id": "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b", "remote_bgp_asn": 65010, "remote_gateway_ip": "10.242.33.22", "remote_tunnel_ip": "192.168.129.1", "status": "attached", "updated_at": "2019-01-01T12:00:00.000Z", "zone": {"name": "us-south-1"}}], "updated_at": "2019-01-01T12:00:00.000Z", "zone": {"name": "us-south-1"}}' responses.add( responses.PATCH, url, @@ -1583,7 +1604,7 @@ def test_update_transit_gateway_connection_value_error(self): """ # Set up mock url = preprocess_url('/transit_gateways/testString/connections/testString') - mock_response = '{"base_connection_id": "975f58c1-afe7-469a-9727-7f3d720f2d32", "base_network_type": "classic", "cidr": "192.168.0.0/24", "created_at": "2019-01-01T12:00:00.000Z", "id": "1a15dca5-7e33-45e1-b7c5-bc690e569531", "local_bgp_asn": 64490, "local_gateway_ip": "192.168.100.1", "local_tunnel_ip": "192.168.129.2", "mtu": 9000, "name": "Transit_Service_BWTN_SJ_DL", "network_account_id": "network_account_id", "network_id": "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b", "network_type": "vpc", "prefix_filters": [{"action": "permit", "before": "1a15dcab-7e40-45e1-b7c5-bc690eaa9782", "created_at": "2019-01-01T12:00:00.000Z", "ge": 0, "id": "1a15dcab-7e30-45e1-b7c5-bc690eaa9865", "le": 32, "prefix": "192.168.100.0/24", "updated_at": "2019-01-01T12:00:00.000Z"}], "prefix_filters_default": "permit", "remote_bgp_asn": 65010, "remote_gateway_ip": "10.242.63.12", "remote_tunnel_ip": "192.168.129.1", "request_status": "pending", "status": "attached", "tunnels": [{"base_network_type": "classic", "created_at": "2019-01-01T12:00:00.000Z", "id": "1a15dca5-7e33-45e1-b7c5-bc690e569531", "local_bgp_asn": 13, "local_gateway_ip": "10.242.63.12", "local_tunnel_ip": "192.168.100.20", "mtu": 9000, "name": "gre1", "network_account_id": "network_account_id", "network_id": "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b", "remote_bgp_asn": 65010, "remote_gateway_ip": "10.242.33.22", "remote_tunnel_ip": "192.168.129.1", "status": "attached", "updated_at": "2019-01-01T12:00:00.000Z", "zone": {"name": "us-south-1"}}], "updated_at": "2019-01-01T12:00:00.000Z", "zone": {"name": "us-south-1"}}' + mock_response = '{"base_connection_id": "975f58c1-afe7-469a-9727-7f3d720f2d32", "base_network_type": "classic", "cidr": "198.19.174.0/23", "created_at": "2019-01-01T12:00:00.000Z", "id": "1a15dca5-7e33-45e1-b7c5-bc690e569531", "local_bgp_asn": 64490, "local_gateway_ip": "192.168.100.1", "local_tunnel_ip": "192.168.129.2", "mtu": 9000, "name": "Transit_Service_BWTN_SJ_DL", "network_account_id": "network_account_id", "network_id": "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b", "network_type": "vpc", "prefix_filters": [{"action": "permit", "before": "1a15dcab-7e40-45e1-b7c5-bc690eaa9782", "created_at": "2019-01-01T12:00:00.000Z", "ge": 0, "id": "1a15dcab-7e30-45e1-b7c5-bc690eaa9865", "le": 32, "prefix": "192.168.100.0/24", "updated_at": "2019-01-01T12:00:00.000Z"}], "prefix_filters_default": "permit", "remote_bgp_asn": 65010, "remote_gateway_ip": "10.242.63.12", "remote_tunnel_ip": "192.168.129.1", "request_status": "pending", "status": "attached", "tunnels": [{"base_network_type": "classic", "created_at": "2019-01-01T12:00:00.000Z", "id": "1a15dca5-7e33-45e1-b7c5-bc690e569531", "local_bgp_asn": 1, "local_gateway_ip": "10.242.63.12", "local_tunnel_ip": "192.168.100.20", "mtu": 9000, "name": "gre1", "network_account_id": "network_account_id", "network_id": "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b", "remote_bgp_asn": 65010, "remote_gateway_ip": "10.242.33.22", "remote_tunnel_ip": "192.168.129.1", "status": "attached", "updated_at": "2019-01-01T12:00:00.000Z", "zone": {"name": "us-south-1"}}], "updated_at": "2019-01-01T12:00:00.000Z", "zone": {"name": "us-south-1"}}' responses.add( responses.PATCH, url, @@ -1716,7 +1737,7 @@ def test_list_transit_gateway_gre_tunnel_all_params(self): """ # Set up mock url = preprocess_url('/transit_gateways/testString/connections/testString/tunnels') - mock_response = '{"tunnels": [{"base_network_type": "classic", "created_at": "2019-01-01T12:00:00.000Z", "id": "1a15dca5-7e33-45e1-b7c5-bc690e569531", "local_bgp_asn": 13, "local_gateway_ip": "10.242.63.12", "local_tunnel_ip": "192.168.100.20", "mtu": 9000, "name": "gre1", "network_account_id": "network_account_id", "network_id": "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b", "remote_bgp_asn": 65010, "remote_gateway_ip": "10.242.33.22", "remote_tunnel_ip": "192.168.129.1", "status": "attached", "updated_at": "2019-01-01T12:00:00.000Z", "zone": {"name": "us-south-1"}}]}' + mock_response = '{"tunnels": [{"base_network_type": "classic", "created_at": "2019-01-01T12:00:00.000Z", "id": "1a15dca5-7e33-45e1-b7c5-bc690e569531", "local_bgp_asn": 1, "local_gateway_ip": "10.242.63.12", "local_tunnel_ip": "192.168.100.20", "mtu": 9000, "name": "gre1", "network_account_id": "network_account_id", "network_id": "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b", "remote_bgp_asn": 65010, "remote_gateway_ip": "10.242.33.22", "remote_tunnel_ip": "192.168.129.1", "status": "attached", "updated_at": "2019-01-01T12:00:00.000Z", "zone": {"name": "us-south-1"}}]}' responses.add( responses.GET, url, @@ -1756,7 +1777,7 @@ def test_list_transit_gateway_gre_tunnel_value_error(self): """ # Set up mock url = preprocess_url('/transit_gateways/testString/connections/testString/tunnels') - mock_response = '{"tunnels": [{"base_network_type": "classic", "created_at": "2019-01-01T12:00:00.000Z", "id": "1a15dca5-7e33-45e1-b7c5-bc690e569531", "local_bgp_asn": 13, "local_gateway_ip": "10.242.63.12", "local_tunnel_ip": "192.168.100.20", "mtu": 9000, "name": "gre1", "network_account_id": "network_account_id", "network_id": "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b", "remote_bgp_asn": 65010, "remote_gateway_ip": "10.242.33.22", "remote_tunnel_ip": "192.168.129.1", "status": "attached", "updated_at": "2019-01-01T12:00:00.000Z", "zone": {"name": "us-south-1"}}]}' + mock_response = '{"tunnels": [{"base_network_type": "classic", "created_at": "2019-01-01T12:00:00.000Z", "id": "1a15dca5-7e33-45e1-b7c5-bc690e569531", "local_bgp_asn": 1, "local_gateway_ip": "10.242.63.12", "local_tunnel_ip": "192.168.100.20", "mtu": 9000, "name": "gre1", "network_account_id": "network_account_id", "network_id": "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b", "remote_bgp_asn": 65010, "remote_gateway_ip": "10.242.33.22", "remote_tunnel_ip": "192.168.129.1", "status": "attached", "updated_at": "2019-01-01T12:00:00.000Z", "zone": {"name": "us-south-1"}}]}' responses.add( responses.GET, url, @@ -1801,7 +1822,7 @@ def test_create_transit_gateway_gre_tunnel_all_params(self): """ # Set up mock url = preprocess_url('/transit_gateways/testString/connections/testString/tunnels') - mock_response = '{"base_network_type": "classic", "created_at": "2019-01-01T12:00:00.000Z", "id": "1a15dca5-7e33-45e1-b7c5-bc690e569531", "local_bgp_asn": 13, "local_gateway_ip": "10.242.63.12", "local_tunnel_ip": "192.168.100.20", "mtu": 9000, "name": "gre1", "network_account_id": "network_account_id", "network_id": "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b", "remote_bgp_asn": 65010, "remote_gateway_ip": "10.242.33.22", "remote_tunnel_ip": "192.168.129.1", "status": "attached", "updated_at": "2019-01-01T12:00:00.000Z", "zone": {"name": "us-south-1"}}' + mock_response = '{"base_network_type": "classic", "created_at": "2019-01-01T12:00:00.000Z", "id": "1a15dca5-7e33-45e1-b7c5-bc690e569531", "local_bgp_asn": 1, "local_gateway_ip": "10.242.63.12", "local_tunnel_ip": "192.168.100.20", "mtu": 9000, "name": "gre1", "network_account_id": "network_account_id", "network_id": "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b", "remote_bgp_asn": 65010, "remote_gateway_ip": "10.242.33.22", "remote_tunnel_ip": "192.168.129.1", "status": "attached", "updated_at": "2019-01-01T12:00:00.000Z", "zone": {"name": "us-south-1"}}' responses.add( responses.POST, url, @@ -1868,7 +1889,7 @@ def test_create_transit_gateway_gre_tunnel_value_error(self): """ # Set up mock url = preprocess_url('/transit_gateways/testString/connections/testString/tunnels') - mock_response = '{"base_network_type": "classic", "created_at": "2019-01-01T12:00:00.000Z", "id": "1a15dca5-7e33-45e1-b7c5-bc690e569531", "local_bgp_asn": 13, "local_gateway_ip": "10.242.63.12", "local_tunnel_ip": "192.168.100.20", "mtu": 9000, "name": "gre1", "network_account_id": "network_account_id", "network_id": "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b", "remote_bgp_asn": 65010, "remote_gateway_ip": "10.242.33.22", "remote_tunnel_ip": "192.168.129.1", "status": "attached", "updated_at": "2019-01-01T12:00:00.000Z", "zone": {"name": "us-south-1"}}' + mock_response = '{"base_network_type": "classic", "created_at": "2019-01-01T12:00:00.000Z", "id": "1a15dca5-7e33-45e1-b7c5-bc690e569531", "local_bgp_asn": 1, "local_gateway_ip": "10.242.63.12", "local_tunnel_ip": "192.168.100.20", "mtu": 9000, "name": "gre1", "network_account_id": "network_account_id", "network_id": "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b", "remote_bgp_asn": 65010, "remote_gateway_ip": "10.242.33.22", "remote_tunnel_ip": "192.168.129.1", "status": "attached", "updated_at": "2019-01-01T12:00:00.000Z", "zone": {"name": "us-south-1"}}' responses.add( responses.POST, url, @@ -2013,7 +2034,7 @@ def test_get_transit_gateway_connection_tunnels_all_params(self): """ # Set up mock url = preprocess_url('/transit_gateways/testString/connections/testString/tunnels/testString') - mock_response = '{"base_network_type": "classic", "created_at": "2019-01-01T12:00:00.000Z", "id": "1a15dca5-7e33-45e1-b7c5-bc690e569531", "local_bgp_asn": 13, "local_gateway_ip": "10.242.63.12", "local_tunnel_ip": "192.168.100.20", "mtu": 9000, "name": "gre1", "network_account_id": "network_account_id", "network_id": "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b", "remote_bgp_asn": 65010, "remote_gateway_ip": "10.242.33.22", "remote_tunnel_ip": "192.168.129.1", "status": "attached", "updated_at": "2019-01-01T12:00:00.000Z", "zone": {"name": "us-south-1"}}' + mock_response = '{"base_network_type": "classic", "created_at": "2019-01-01T12:00:00.000Z", "id": "1a15dca5-7e33-45e1-b7c5-bc690e569531", "local_bgp_asn": 1, "local_gateway_ip": "10.242.63.12", "local_tunnel_ip": "192.168.100.20", "mtu": 9000, "name": "gre1", "network_account_id": "network_account_id", "network_id": "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b", "remote_bgp_asn": 65010, "remote_gateway_ip": "10.242.33.22", "remote_tunnel_ip": "192.168.129.1", "status": "attached", "updated_at": "2019-01-01T12:00:00.000Z", "zone": {"name": "us-south-1"}}' responses.add( responses.GET, url, @@ -2055,7 +2076,7 @@ def test_get_transit_gateway_connection_tunnels_value_error(self): """ # Set up mock url = preprocess_url('/transit_gateways/testString/connections/testString/tunnels/testString') - mock_response = '{"base_network_type": "classic", "created_at": "2019-01-01T12:00:00.000Z", "id": "1a15dca5-7e33-45e1-b7c5-bc690e569531", "local_bgp_asn": 13, "local_gateway_ip": "10.242.63.12", "local_tunnel_ip": "192.168.100.20", "mtu": 9000, "name": "gre1", "network_account_id": "network_account_id", "network_id": "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b", "remote_bgp_asn": 65010, "remote_gateway_ip": "10.242.33.22", "remote_tunnel_ip": "192.168.129.1", "status": "attached", "updated_at": "2019-01-01T12:00:00.000Z", "zone": {"name": "us-south-1"}}' + mock_response = '{"base_network_type": "classic", "created_at": "2019-01-01T12:00:00.000Z", "id": "1a15dca5-7e33-45e1-b7c5-bc690e569531", "local_bgp_asn": 1, "local_gateway_ip": "10.242.63.12", "local_tunnel_ip": "192.168.100.20", "mtu": 9000, "name": "gre1", "network_account_id": "network_account_id", "network_id": "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b", "remote_bgp_asn": 65010, "remote_gateway_ip": "10.242.33.22", "remote_tunnel_ip": "192.168.129.1", "status": "attached", "updated_at": "2019-01-01T12:00:00.000Z", "zone": {"name": "us-south-1"}}' responses.add( responses.GET, url, @@ -2102,7 +2123,7 @@ def test_update_transit_gateway_connection_tunnels_all_params(self): """ # Set up mock url = preprocess_url('/transit_gateways/testString/connections/testString/tunnels/testString') - mock_response = '{"base_network_type": "classic", "created_at": "2019-01-01T12:00:00.000Z", "id": "1a15dca5-7e33-45e1-b7c5-bc690e569531", "local_bgp_asn": 13, "local_gateway_ip": "10.242.63.12", "local_tunnel_ip": "192.168.100.20", "mtu": 9000, "name": "gre1", "network_account_id": "network_account_id", "network_id": "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b", "remote_bgp_asn": 65010, "remote_gateway_ip": "10.242.33.22", "remote_tunnel_ip": "192.168.129.1", "status": "attached", "updated_at": "2019-01-01T12:00:00.000Z", "zone": {"name": "us-south-1"}}' + mock_response = '{"base_network_type": "classic", "created_at": "2019-01-01T12:00:00.000Z", "id": "1a15dca5-7e33-45e1-b7c5-bc690e569531", "local_bgp_asn": 1, "local_gateway_ip": "10.242.63.12", "local_tunnel_ip": "192.168.100.20", "mtu": 9000, "name": "gre1", "network_account_id": "network_account_id", "network_id": "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b", "remote_bgp_asn": 65010, "remote_gateway_ip": "10.242.33.22", "remote_tunnel_ip": "192.168.129.1", "status": "attached", "updated_at": "2019-01-01T12:00:00.000Z", "zone": {"name": "us-south-1"}}' responses.add( responses.PATCH, url, @@ -2153,7 +2174,7 @@ def test_update_transit_gateway_connection_tunnels_value_error(self): """ # Set up mock url = preprocess_url('/transit_gateways/testString/connections/testString/tunnels/testString') - mock_response = '{"base_network_type": "classic", "created_at": "2019-01-01T12:00:00.000Z", "id": "1a15dca5-7e33-45e1-b7c5-bc690e569531", "local_bgp_asn": 13, "local_gateway_ip": "10.242.63.12", "local_tunnel_ip": "192.168.100.20", "mtu": 9000, "name": "gre1", "network_account_id": "network_account_id", "network_id": "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b", "remote_bgp_asn": 65010, "remote_gateway_ip": "10.242.33.22", "remote_tunnel_ip": "192.168.129.1", "status": "attached", "updated_at": "2019-01-01T12:00:00.000Z", "zone": {"name": "us-south-1"}}' + mock_response = '{"base_network_type": "classic", "created_at": "2019-01-01T12:00:00.000Z", "id": "1a15dca5-7e33-45e1-b7c5-bc690e569531", "local_bgp_asn": 1, "local_gateway_ip": "10.242.63.12", "local_tunnel_ip": "192.168.100.20", "mtu": 9000, "name": "gre1", "network_account_id": "network_account_id", "network_id": "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b", "remote_bgp_asn": 65010, "remote_gateway_ip": "10.242.33.22", "remote_tunnel_ip": "192.168.129.1", "status": "attached", "updated_at": "2019-01-01T12:00:00.000Z", "zone": {"name": "us-south-1"}}' responses.add( responses.PATCH, url, @@ -3325,6 +3346,353 @@ def test_get_transit_gateway_route_report_value_error_with_retries(self): # End of Service: TransitGatewayRouteReports ############################################################################## +############################################################################## +# Start of Service: RedundancyGroups +############################################################################## +# region + + +class TestNewInstance: + """ + Test Class for new_instance + """ + + def test_new_instance(self): + """ + new_instance() + """ + os.environ['TEST_SERVICE_AUTH_TYPE'] = 'noAuth' + + service = TransitGatewayApisV1.new_instance( + version=version, + service_name='TEST_SERVICE', + ) + + assert service is not None + assert isinstance(service, TransitGatewayApisV1) + + def test_new_instance_without_authenticator(self): + """ + new_instance_without_authenticator() + """ + with pytest.raises(ValueError, match='authenticator must be provided'): + service = TransitGatewayApisV1.new_instance( + version=version, + service_name='TEST_SERVICE_NOT_FOUND', + ) + + def test_new_instance_without_required_params(self): + """ + new_instance_without_required_params() + """ + with pytest.raises(TypeError, match='new_instance\\(\\) missing \\d required positional arguments?: \'.*\''): + service = TransitGatewayApisV1.new_instance() + + def test_new_instance_required_param_none(self): + """ + new_instance_required_param_none() + """ + with pytest.raises(ValueError, match='version must be provided'): + service = TransitGatewayApisV1.new_instance( + version=None, + ) + + +class TestListRedundancyGroups: + """ + Test Class for list_redundancy_groups + """ + + @responses.activate + def test_list_redundancy_groups_all_params(self): + """ + list_redundancy_groups() + """ + # Set up mock + url = preprocess_url('/redundancy_groups') + mock_response = '{"redundancy_groups": [{"created_at": "2019-01-01T12:00:00.000Z", "id": "bf3f5f91-1234-41c7-9e11-9cd99e65c1f4", "name": "rg-1", "updated_at": "2019-01-01T12:00:00.000Z"}]}' + responses.add( + responses.GET, + url, + body=mock_response, + content_type='application/json', + status=200, + ) + + # Set up parameter values + name = 'testString' + + # Invoke method + response = _service.list_redundancy_groups( + name=name, + headers={}, + ) + + # Check for correct operation + assert len(responses.calls) == 1 + assert response.status_code == 200 + # Validate query params + query_string = responses.calls[0].request.url.split('?', 1)[1] + query_string = urllib.parse.unquote_plus(query_string) + assert 'name={}'.format(name) in query_string + + def test_list_redundancy_groups_all_params_with_retries(self): + # Enable retries and run test_list_redundancy_groups_all_params. + _service.enable_retries() + self.test_list_redundancy_groups_all_params() + + # Disable retries and run test_list_redundancy_groups_all_params. + _service.disable_retries() + self.test_list_redundancy_groups_all_params() + + @responses.activate + def test_list_redundancy_groups_required_params(self): + """ + test_list_redundancy_groups_required_params() + """ + # Set up mock + url = preprocess_url('/redundancy_groups') + mock_response = '{"redundancy_groups": [{"created_at": "2019-01-01T12:00:00.000Z", "id": "bf3f5f91-1234-41c7-9e11-9cd99e65c1f4", "name": "rg-1", "updated_at": "2019-01-01T12:00:00.000Z"}]}' + responses.add( + responses.GET, + url, + body=mock_response, + content_type='application/json', + status=200, + ) + + # Invoke method + response = _service.list_redundancy_groups() + + # Check for correct operation + assert len(responses.calls) == 1 + assert response.status_code == 200 + + def test_list_redundancy_groups_required_params_with_retries(self): + # Enable retries and run test_list_redundancy_groups_required_params. + _service.enable_retries() + self.test_list_redundancy_groups_required_params() + + # Disable retries and run test_list_redundancy_groups_required_params. + _service.disable_retries() + self.test_list_redundancy_groups_required_params() + + @responses.activate + def test_list_redundancy_groups_value_error(self): + """ + test_list_redundancy_groups_value_error() + """ + # Set up mock + url = preprocess_url('/redundancy_groups') + mock_response = '{"redundancy_groups": [{"created_at": "2019-01-01T12:00:00.000Z", "id": "bf3f5f91-1234-41c7-9e11-9cd99e65c1f4", "name": "rg-1", "updated_at": "2019-01-01T12:00:00.000Z"}]}' + responses.add( + responses.GET, + url, + body=mock_response, + content_type='application/json', + status=200, + ) + + # Pass in all but one required param and check for a ValueError + req_param_dict = { + } + for param in req_param_dict.keys(): + req_copy = {key: val if key is not param else None for (key, val) in req_param_dict.items()} + with pytest.raises(ValueError): + _service.list_redundancy_groups(**req_copy) + + def test_list_redundancy_groups_value_error_with_retries(self): + # Enable retries and run test_list_redundancy_groups_value_error. + _service.enable_retries() + self.test_list_redundancy_groups_value_error() + + # Disable retries and run test_list_redundancy_groups_value_error. + _service.disable_retries() + self.test_list_redundancy_groups_value_error() + + +class TestGetRedundancyGroup: + """ + Test Class for get_redundancy_group + """ + + @responses.activate + def test_get_redundancy_group_all_params(self): + """ + get_redundancy_group() + """ + # Set up mock + url = preprocess_url('/redundancy_groups/testString') + mock_response = '{"created_at": "2019-01-01T12:00:00.000Z", "id": "bf3f5f91-1234-41c7-9e11-9cd99e65c1f4", "name": "rg-1", "updated_at": "2019-01-01T12:00:00.000Z"}' + responses.add( + responses.GET, + url, + body=mock_response, + content_type='application/json', + status=200, + ) + + # Set up parameter values + id = 'testString' + + # Invoke method + response = _service.get_redundancy_group( + id, + headers={}, + ) + + # Check for correct operation + assert len(responses.calls) == 1 + assert response.status_code == 200 + + def test_get_redundancy_group_all_params_with_retries(self): + # Enable retries and run test_get_redundancy_group_all_params. + _service.enable_retries() + self.test_get_redundancy_group_all_params() + + # Disable retries and run test_get_redundancy_group_all_params. + _service.disable_retries() + self.test_get_redundancy_group_all_params() + + @responses.activate + def test_get_redundancy_group_value_error(self): + """ + test_get_redundancy_group_value_error() + """ + # Set up mock + url = preprocess_url('/redundancy_groups/testString') + mock_response = '{"created_at": "2019-01-01T12:00:00.000Z", "id": "bf3f5f91-1234-41c7-9e11-9cd99e65c1f4", "name": "rg-1", "updated_at": "2019-01-01T12:00:00.000Z"}' + responses.add( + responses.GET, + url, + body=mock_response, + content_type='application/json', + status=200, + ) + + # Set up parameter values + id = 'testString' + + # Pass in all but one required param and check for a ValueError + req_param_dict = { + "id": id, + } + for param in req_param_dict.keys(): + req_copy = {key: val if key is not param else None for (key, val) in req_param_dict.items()} + with pytest.raises(ValueError): + _service.get_redundancy_group(**req_copy) + + def test_get_redundancy_group_value_error_with_retries(self): + # Enable retries and run test_get_redundancy_group_value_error. + _service.enable_retries() + self.test_get_redundancy_group_value_error() + + # Disable retries and run test_get_redundancy_group_value_error. + _service.disable_retries() + self.test_get_redundancy_group_value_error() + + +class TestUpdateRedundancyGroup: + """ + Test Class for update_redundancy_group + """ + + @responses.activate + def test_update_redundancy_group_all_params(self): + """ + update_redundancy_group() + """ + # Set up mock + url = preprocess_url('/redundancy_groups/testString') + mock_response = '{"created_at": "2019-01-01T12:00:00.000Z", "id": "bf3f5f91-1234-41c7-9e11-9cd99e65c1f4", "name": "rg-1", "updated_at": "2019-01-01T12:00:00.000Z"}' + responses.add( + responses.PATCH, + url, + body=mock_response, + content_type='application/json', + status=200, + ) + + # Construct a dict representation of a RedundancyGroupPatch model + redundancy_group_patch_model = {} + redundancy_group_patch_model['name'] = 'new-rg-name' + + # Set up parameter values + id = 'testString' + redundancy_group_patch = redundancy_group_patch_model + + # Invoke method + response = _service.update_redundancy_group( + id, + redundancy_group_patch, + headers={}, + ) + + # Check for correct operation + assert len(responses.calls) == 1 + assert response.status_code == 200 + # Validate body params + req_body = json.loads(str(responses.calls[0].request.body, 'utf-8')) + assert req_body == redundancy_group_patch + + def test_update_redundancy_group_all_params_with_retries(self): + # Enable retries and run test_update_redundancy_group_all_params. + _service.enable_retries() + self.test_update_redundancy_group_all_params() + + # Disable retries and run test_update_redundancy_group_all_params. + _service.disable_retries() + self.test_update_redundancy_group_all_params() + + @responses.activate + def test_update_redundancy_group_value_error(self): + """ + test_update_redundancy_group_value_error() + """ + # Set up mock + url = preprocess_url('/redundancy_groups/testString') + mock_response = '{"created_at": "2019-01-01T12:00:00.000Z", "id": "bf3f5f91-1234-41c7-9e11-9cd99e65c1f4", "name": "rg-1", "updated_at": "2019-01-01T12:00:00.000Z"}' + responses.add( + responses.PATCH, + url, + body=mock_response, + content_type='application/json', + status=200, + ) + + # Construct a dict representation of a RedundancyGroupPatch model + redundancy_group_patch_model = {} + redundancy_group_patch_model['name'] = 'new-rg-name' + + # Set up parameter values + id = 'testString' + redundancy_group_patch = redundancy_group_patch_model + + # Pass in all but one required param and check for a ValueError + req_param_dict = { + "id": id, + "redundancy_group_patch": redundancy_group_patch, + } + for param in req_param_dict.keys(): + req_copy = {key: val if key is not param else None for (key, val) in req_param_dict.items()} + with pytest.raises(ValueError): + _service.update_redundancy_group(**req_copy) + + def test_update_redundancy_group_value_error_with_retries(self): + # Enable retries and run test_update_redundancy_group_value_error. + _service.enable_retries() + self.test_update_redundancy_group_value_error() + + # Disable retries and run test_update_redundancy_group_value_error. + _service.disable_retries() + self.test_update_redundancy_group_value_error() + + +# endregion +############################################################################## +# End of Service: RedundancyGroups +############################################################################## + ############################################################################## # Start of Model Tests @@ -3594,6 +3962,107 @@ def test_prefix_filter_cust_serialization(self): assert prefix_filter_cust_model_json2 == prefix_filter_cust_model_json +class TestModel_RedundancyGroup: + """ + Test Class for RedundancyGroup + """ + + def test_redundancy_group_serialization(self): + """ + Test serialization/deserialization for RedundancyGroup + """ + + # Construct a json representation of a RedundancyGroup model + redundancy_group_model_json = {} + redundancy_group_model_json['created_at'] = '2019-01-01T12:00:00Z' + redundancy_group_model_json['id'] = 'bf3f5f91-1234-41c7-9e11-9cd99e65c1f4' + redundancy_group_model_json['name'] = 'rg-1' + redundancy_group_model_json['updated_at'] = '2019-01-01T12:00:00Z' + + # Construct a model instance of RedundancyGroup by calling from_dict on the json representation + redundancy_group_model = RedundancyGroup.from_dict(redundancy_group_model_json) + assert redundancy_group_model != False + + # Construct a model instance of RedundancyGroup by calling from_dict on the json representation + redundancy_group_model_dict = RedundancyGroup.from_dict(redundancy_group_model_json).__dict__ + redundancy_group_model2 = RedundancyGroup(**redundancy_group_model_dict) + + # Verify the model instances are equivalent + assert redundancy_group_model == redundancy_group_model2 + + # Convert model instance back to dict and verify no loss of data + redundancy_group_model_json2 = redundancy_group_model.to_dict() + assert redundancy_group_model_json2 == redundancy_group_model_json + + +class TestModel_RedundancyGroupCollection: + """ + Test Class for RedundancyGroupCollection + """ + + def test_redundancy_group_collection_serialization(self): + """ + Test serialization/deserialization for RedundancyGroupCollection + """ + + # Construct dict forms of any model objects needed in order to build this model. + + redundancy_group_model = {} # RedundancyGroup + redundancy_group_model['created_at'] = '2019-01-01T12:00:00Z' + redundancy_group_model['id'] = 'bf3f5f91-1234-41c7-9e11-9cd99e65c1f4' + redundancy_group_model['name'] = 'rg-1' + redundancy_group_model['updated_at'] = '2019-01-01T12:00:00Z' + + # Construct a json representation of a RedundancyGroupCollection model + redundancy_group_collection_model_json = {} + redundancy_group_collection_model_json['redundancy_groups'] = [redundancy_group_model] + + # Construct a model instance of RedundancyGroupCollection by calling from_dict on the json representation + redundancy_group_collection_model = RedundancyGroupCollection.from_dict(redundancy_group_collection_model_json) + assert redundancy_group_collection_model != False + + # Construct a model instance of RedundancyGroupCollection by calling from_dict on the json representation + redundancy_group_collection_model_dict = RedundancyGroupCollection.from_dict(redundancy_group_collection_model_json).__dict__ + redundancy_group_collection_model2 = RedundancyGroupCollection(**redundancy_group_collection_model_dict) + + # Verify the model instances are equivalent + assert redundancy_group_collection_model == redundancy_group_collection_model2 + + # Convert model instance back to dict and verify no loss of data + redundancy_group_collection_model_json2 = redundancy_group_collection_model.to_dict() + assert redundancy_group_collection_model_json2 == redundancy_group_collection_model_json + + +class TestModel_RedundancyGroupPatch: + """ + Test Class for RedundancyGroupPatch + """ + + def test_redundancy_group_patch_serialization(self): + """ + Test serialization/deserialization for RedundancyGroupPatch + """ + + # Construct a json representation of a RedundancyGroupPatch model + redundancy_group_patch_model_json = {} + redundancy_group_patch_model_json['name'] = 'new-rg-name' + + # Construct a model instance of RedundancyGroupPatch by calling from_dict on the json representation + redundancy_group_patch_model = RedundancyGroupPatch.from_dict(redundancy_group_patch_model_json) + assert redundancy_group_patch_model != False + + # Construct a model instance of RedundancyGroupPatch by calling from_dict on the json representation + redundancy_group_patch_model_dict = RedundancyGroupPatch.from_dict(redundancy_group_patch_model_json).__dict__ + redundancy_group_patch_model2 = RedundancyGroupPatch(**redundancy_group_patch_model_dict) + + # Verify the model instances are equivalent + assert redundancy_group_patch_model == redundancy_group_patch_model2 + + # Convert model instance back to dict and verify no loss of data + redundancy_group_patch_model_json2 = redundancy_group_patch_model.to_dict() + assert redundancy_group_patch_model_json2 == redundancy_group_patch_model_json + + class TestModel_ResourceGroupIdentity: """ Test Class for ResourceGroupIdentity @@ -4004,7 +4473,7 @@ def test_ts_local_location_serialization(self): ts_local_location_model_json = {} ts_local_location_model_json['display_name'] = 'Dallas' ts_local_location_model_json['name'] = 'us-south' - ts_local_location_model_json['supported_connection_types'] = ['classic', 'vpc', 'directlink', 'gre_tunnel', 'power_virtual_server', 'unbound_gre_tunnel'] + ts_local_location_model_json['supported_connection_types'] = ['classic', 'vpc', 'directlink', 'gre_tunnel', 'power_virtual_server', 'unbound_gre_tunnel', 'redundant_gre', 'vpn_gateway'] ts_local_location_model_json['type'] = 'region' # Construct a model instance of TSLocalLocation by calling from_dict on the json representation @@ -4038,7 +4507,7 @@ def test_ts_location_serialization(self): ts_local_location_model = {} # TSLocalLocation ts_local_location_model['display_name'] = 'Dallas' ts_local_location_model['name'] = 'us-south' - ts_local_location_model['supported_connection_types'] = ['classic', 'vpc', 'directlink', 'gre_tunnel', 'power_virtual_server', 'unbound_gre_tunnel'] + ts_local_location_model['supported_connection_types'] = ['classic', 'vpc', 'directlink', 'gre_tunnel', 'power_virtual_server', 'unbound_gre_tunnel', 'redundant_gre', 'vpn_gateway'] ts_local_location_model['type'] = 'region' zone_reference_model = {} # ZoneReference @@ -4134,7 +4603,7 @@ def test_transit_connection_serialization(self): transit_gateway_tunnel_model['base_network_type'] = 'classic' transit_gateway_tunnel_model['created_at'] = '2019-01-01T12:00:00Z' transit_gateway_tunnel_model['id'] = '1a15dca5-7e33-45e1-b7c5-bc690e569531' - transit_gateway_tunnel_model['local_bgp_asn'] = 38 + transit_gateway_tunnel_model['local_bgp_asn'] = 1 transit_gateway_tunnel_model['local_gateway_ip'] = '10.242.63.12' transit_gateway_tunnel_model['local_tunnel_ip'] = '192.168.100.20' transit_gateway_tunnel_model['mtu'] = 9000 @@ -4156,6 +4625,7 @@ def test_transit_connection_serialization(self): transit_connection_model_json['network_type'] = 'vpc' transit_connection_model_json['id'] = '1a15dca5-7e33-45e1-b7c5-bc690e569531' transit_connection_model_json['base_connection_id'] = '975f58c1-afe7-469a-9727-7f3d720f2d32' + transit_connection_model_json['cidr'] = '198.19.174.0/23' transit_connection_model_json['created_at'] = '2019-01-01T12:00:00Z' transit_connection_model_json['local_bgp_asn'] = 64490 transit_connection_model_json['local_gateway_ip'] = '192.168.100.1' @@ -4224,7 +4694,7 @@ def test_transit_connection_collection_serialization(self): transit_gateway_tunnel_model['base_network_type'] = 'classic' transit_gateway_tunnel_model['created_at'] = '2019-01-01T12:00:00Z' transit_gateway_tunnel_model['id'] = '1a15dca5-7e33-45e1-b7c5-bc690e569531' - transit_gateway_tunnel_model['local_bgp_asn'] = 38 + transit_gateway_tunnel_model['local_bgp_asn'] = 1 transit_gateway_tunnel_model['local_gateway_ip'] = '10.242.63.12' transit_gateway_tunnel_model['local_tunnel_ip'] = '192.168.100.20' transit_gateway_tunnel_model['mtu'] = 9000 @@ -4245,6 +4715,7 @@ def test_transit_connection_collection_serialization(self): transit_connection_model['network_type'] = 'vpc' transit_connection_model['id'] = '1a15dca5-7e33-45e1-b7c5-bc690e569531' transit_connection_model['base_connection_id'] = '975f58c1-afe7-469a-9727-7f3d720f2d32' + transit_connection_model['cidr'] = '198.19.174.0/23' transit_connection_model['created_at'] = '2019-01-01T12:00:00Z' transit_connection_model['local_bgp_asn'] = 64490 transit_connection_model['local_gateway_ip'] = '192.168.100.1' @@ -4320,6 +4791,8 @@ def test_transit_gateway_serialization(self): transit_gateway_model_json['id'] = '0a06fb9b-820f-4c44-8a31-77f1f0806d28' transit_gateway_model_json['location'] = 'us-south' transit_gateway_model_json['name'] = 'my-transit-gateway-in-TransitGateway' + transit_gateway_model_json['redundancy_group'] = 'rg-1' + transit_gateway_model_json['redundancy_group_id'] = 'ef4dcb1a-fee4-41c7-9e11-9cd99e65c1f4' transit_gateway_model_json['resource_group'] = resource_group_reference_model transit_gateway_model_json['status'] = 'available' transit_gateway_model_json['updated_at'] = '2019-01-01T12:00:00Z' @@ -4373,6 +4846,8 @@ def test_transit_gateway_collection_serialization(self): transit_gateway_model['id'] = '0a06fb9b-820f-4c44-8a31-77f1f0806d28' transit_gateway_model['location'] = 'us-south' transit_gateway_model['name'] = 'my-transit-gateway-in-TransitGateway' + transit_gateway_model['redundancy_group'] = 'rg-1' + transit_gateway_model['redundancy_group_id'] = 'ef4dcb1a-fee4-41c7-9e11-9cd99e65c1f4' transit_gateway_model['resource_group'] = resource_group_reference_model transit_gateway_model['status'] = 'available' transit_gateway_model['updated_at'] = '2019-01-01T12:00:00Z' @@ -4429,7 +4904,7 @@ def test_transit_gateway_connection_collection_serialization(self): transit_gateway_tunnel_model['base_network_type'] = 'classic' transit_gateway_tunnel_model['created_at'] = '2019-01-01T12:00:00Z' transit_gateway_tunnel_model['id'] = '1a15dca5-7e33-45e1-b7c5-bc690e569531' - transit_gateway_tunnel_model['local_bgp_asn'] = 38 + transit_gateway_tunnel_model['local_bgp_asn'] = 1 transit_gateway_tunnel_model['local_gateway_ip'] = '10.242.63.12' transit_gateway_tunnel_model['local_tunnel_ip'] = '192.168.100.20' transit_gateway_tunnel_model['mtu'] = 9000 @@ -4446,7 +4921,7 @@ def test_transit_gateway_connection_collection_serialization(self): transit_gateway_connection_cust_model = {} # TransitGatewayConnectionCust transit_gateway_connection_cust_model['base_connection_id'] = '975f58c1-afe7-469a-9727-7f3d720f2d32' transit_gateway_connection_cust_model['base_network_type'] = 'classic' - transit_gateway_connection_cust_model['cidr'] = '192.168.0.0/24' + transit_gateway_connection_cust_model['cidr'] = '198.19.174.0/23' transit_gateway_connection_cust_model['created_at'] = '2019-01-01T12:00:00Z' transit_gateway_connection_cust_model['id'] = '1a15dca5-7e33-45e1-b7c5-bc690e569531' transit_gateway_connection_cust_model['local_bgp_asn'] = 64490 @@ -4528,7 +5003,7 @@ def test_transit_gateway_connection_cust_serialization(self): transit_gateway_tunnel_model['base_network_type'] = 'classic' transit_gateway_tunnel_model['created_at'] = '2019-01-01T12:00:00Z' transit_gateway_tunnel_model['id'] = '1a15dca5-7e33-45e1-b7c5-bc690e569531' - transit_gateway_tunnel_model['local_bgp_asn'] = 38 + transit_gateway_tunnel_model['local_bgp_asn'] = 1 transit_gateway_tunnel_model['local_gateway_ip'] = '10.242.63.12' transit_gateway_tunnel_model['local_tunnel_ip'] = '192.168.100.20' transit_gateway_tunnel_model['mtu'] = 9000 @@ -4546,7 +5021,7 @@ def test_transit_gateway_connection_cust_serialization(self): transit_gateway_connection_cust_model_json = {} transit_gateway_connection_cust_model_json['base_connection_id'] = '975f58c1-afe7-469a-9727-7f3d720f2d32' transit_gateway_connection_cust_model_json['base_network_type'] = 'classic' - transit_gateway_connection_cust_model_json['cidr'] = '192.168.0.0/24' + transit_gateway_connection_cust_model_json['cidr'] = '198.19.174.0/23' transit_gateway_connection_cust_model_json['created_at'] = '2019-01-01T12:00:00Z' transit_gateway_connection_cust_model_json['id'] = '1a15dca5-7e33-45e1-b7c5-bc690e569531' transit_gateway_connection_cust_model_json['local_bgp_asn'] = 64490 @@ -4706,7 +5181,7 @@ def test_transit_gateway_tunnel_serialization(self): transit_gateway_tunnel_model_json['base_network_type'] = 'classic' transit_gateway_tunnel_model_json['created_at'] = '2019-01-01T12:00:00Z' transit_gateway_tunnel_model_json['id'] = '1a15dca5-7e33-45e1-b7c5-bc690e569531' - transit_gateway_tunnel_model_json['local_bgp_asn'] = 38 + transit_gateway_tunnel_model_json['local_bgp_asn'] = 1 transit_gateway_tunnel_model_json['local_gateway_ip'] = '10.242.63.12' transit_gateway_tunnel_model_json['local_tunnel_ip'] = '192.168.100.20' transit_gateway_tunnel_model_json['mtu'] = 9000 @@ -4755,7 +5230,7 @@ def test_transit_gateway_tunnel_collection_serialization(self): transit_gateway_tunnel_model['base_network_type'] = 'classic' transit_gateway_tunnel_model['created_at'] = '2019-01-01T12:00:00Z' transit_gateway_tunnel_model['id'] = '1a15dca5-7e33-45e1-b7c5-bc690e569531' - transit_gateway_tunnel_model['local_bgp_asn'] = 38 + transit_gateway_tunnel_model['local_bgp_asn'] = 1 transit_gateway_tunnel_model['local_gateway_ip'] = '10.242.63.12' transit_gateway_tunnel_model['local_tunnel_ip'] = '192.168.100.20' transit_gateway_tunnel_model['mtu'] = 9000 From 18c7e27c080a48febee385437b43080debe3a717 Mon Sep 17 00:00:00 2001 From: Joseph Kalandarishvili Date: Thu, 13 Aug 2026 13:17:46 -0500 Subject: [PATCH 2/4] feat: Added Redundant Global TGW related changes dependency: none Signed-off-by: Joseph Kalandarishvili --- .../transit_gateway_apis_v1.py | 1334 +++++++++-------- test/unit/test_transit_gateway_apis_v1.py | 14 +- 2 files changed, 671 insertions(+), 677 deletions(-) diff --git a/ibm_cloud_networking_services/transit_gateway_apis_v1.py b/ibm_cloud_networking_services/transit_gateway_apis_v1.py index c5ba9f5..4e02102 100644 --- a/ibm_cloud_networking_services/transit_gateway_apis_v1.py +++ b/ibm_cloud_networking_services/transit_gateway_apis_v1.py @@ -14,7 +14,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -# IBM OpenAPI SDK Code Generator Version: 3.73.0-eeee85a9-20230607-165104 +# IBM OpenAPI SDK Code Generator Version: 3.107.1-41b0fbd0-20250825-080732 """ No description provided (generated by Openapi Generator @@ -25,7 +25,7 @@ from datetime import datetime from enum import Enum -from typing import Dict, List +from typing import Dict, List, Optional import json from ibm_cloud_sdk_core import BaseService, DetailedResponse @@ -100,9 +100,9 @@ def __init__( def list_transit_gateways( self, *, - limit: int = None, - start: str = None, - redundancy_group: str = None, + limit: Optional[int] = None, + start: Optional[str] = None, + redundancy_group: Optional[str] = None, **kwargs, ) -> DetailedResponse: """ @@ -164,10 +164,10 @@ def create_transit_gateway( location: str, name: str, *, - global_: bool = None, - gre_enhanced_route_propagation: bool = None, - redundancy_group: str = None, - resource_group: 'ResourceGroupIdentity' = None, + global_: Optional[bool] = None, + gre_enhanced_route_propagation: Optional[bool] = None, + redundancy_group: Optional[str] = None, + resource_group: Optional['ResourceGroupIdentity'] = None, **kwargs, ) -> DetailedResponse: """ @@ -359,10 +359,10 @@ def update_transit_gateway( self, id: str, *, - global_: bool = None, - gre_enhanced_route_propagation: bool = None, - name: str = None, - redundancy_group: str = None, + global_: Optional[bool] = None, + gre_enhanced_route_propagation: Optional[bool] = None, + name: Optional[str] = None, + redundancy_group: Optional[str] = None, **kwargs, ) -> DetailedResponse: """ @@ -444,10 +444,10 @@ def update_transit_gateway( def list_connections( self, *, - limit: int = None, - start: str = None, - network_id: str = None, - network_type: str = None, + limit: Optional[int] = None, + start: Optional[str] = None, + network_id: Optional[str] = None, + network_type: Optional[str] = None, **kwargs, ) -> DetailedResponse: """ @@ -514,9 +514,9 @@ def list_transit_gateway_connections( self, transit_gateway_id: str, *, - start: str = None, - limit: int = None, - name: str = None, + start: Optional[str] = None, + limit: Optional[int] = None, + name: Optional[str] = None, **kwargs, ) -> DetailedResponse: """ @@ -576,21 +576,21 @@ def create_transit_gateway_connection( transit_gateway_id: str, network_type: str, *, - base_connection_id: str = None, - base_network_type: str = None, - cidr: str = None, - local_gateway_ip: str = None, - local_tunnel_ip: str = None, - name: str = None, - network_account_id: str = None, - network_id: str = None, - prefix_filters: List['TransitGatewayConnectionPrefixFilter'] = None, - prefix_filters_default: str = None, - remote_bgp_asn: int = None, - remote_gateway_ip: str = None, - remote_tunnel_ip: str = None, - tunnels: List['TransitGatewayTunnelTemplate'] = None, - zone: 'ZoneIdentity' = None, + 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: """ @@ -895,8 +895,8 @@ def update_transit_gateway_connection( transit_gateway_id: str, id: str, *, - name: str = None, - prefix_filters_default: str = None, + name: Optional[str] = None, + prefix_filters_default: Optional[str] = None, **kwargs, ) -> DetailedResponse: """ @@ -1090,7 +1090,7 @@ def create_transit_gateway_gre_tunnel( remote_tunnel_ip: str, zone: 'ZoneIdentity', *, - remote_bgp_asn: int = None, + remote_bgp_asn: Optional[int] = None, **kwargs, ) -> DetailedResponse: """ @@ -1524,9 +1524,9 @@ def create_transit_gateway_connection_prefix_filter( action: str, prefix: str, *, - before: str = None, - ge: int = None, - le: int = None, + before: Optional[str] = None, + ge: Optional[int] = None, + le: Optional[int] = None, **kwargs, ) -> DetailedResponse: """ @@ -1746,11 +1746,11 @@ def update_transit_gateway_connection_prefix_filter( id: str, filter_id: str, *, - action: str = None, - before: str = None, - ge: int = None, - le: int = None, - prefix: str = None, + action: Optional[str] = None, + before: Optional[str] = None, + ge: Optional[int] = None, + le: Optional[int] = None, + prefix: Optional[str] = None, **kwargs, ) -> DetailedResponse: """ @@ -2060,7 +2060,7 @@ def get_transit_gateway_route_report( def list_redundancy_groups( self, *, - name: str = None, + name: Optional[str] = None, **kwargs, ) -> DetailedResponse: """ @@ -2222,7 +2222,7 @@ class PaginationFirstConnection: """ A reference to the first page of resources. - :attr str href: url. + :param str href: url. """ def __init__( @@ -2240,8 +2240,8 @@ def __init__( def from_dict(cls, _dict: Dict) -> 'PaginationFirstConnection': """Initialize a PaginationFirstConnection object from a json dictionary.""" args = {} - if 'href' in _dict: - args['href'] = _dict.get('href') + if (href := _dict.get('href')) is not None: + args['href'] = href else: raise ValueError('Required property \'href\' not present in PaginationFirstConnection JSON') return cls(**args) @@ -2281,7 +2281,7 @@ class PaginationFirstTG: """ A reference to the first page of resources. - :attr str href: url. + :param str href: url. """ def __init__( @@ -2299,8 +2299,8 @@ def __init__( def from_dict(cls, _dict: Dict) -> 'PaginationFirstTG': """Initialize a PaginationFirstTG object from a json dictionary.""" args = {} - if 'href' in _dict: - args['href'] = _dict.get('href') + if (href := _dict.get('href')) is not None: + args['href'] = href else: raise ValueError('Required property \'href\' not present in PaginationFirstTG JSON') return cls(**args) @@ -2341,7 +2341,7 @@ class PaginationFirstTGWConnection: A reference to the first page of resources. This will be returned when number of connections in response are greater than max page limit. - :attr str href: url. + :param str href: url. """ def __init__( @@ -2359,8 +2359,8 @@ def __init__( def from_dict(cls, _dict: Dict) -> 'PaginationFirstTGWConnection': """Initialize a PaginationFirstTGWConnection object from a json dictionary.""" args = {} - if 'href' in _dict: - args['href'] = _dict.get('href') + if (href := _dict.get('href')) is not None: + args['href'] = href else: raise ValueError('Required property \'href\' not present in PaginationFirstTGWConnection JSON') return cls(**args) @@ -2401,8 +2401,8 @@ class PaginationNextConnection: A reference to the next page of resources; this reference is included for all pages except the last page. - :attr str href: url. - :attr str start: server generated start token for next page of resources. + :param str href: url. + :param str start: server generated start token for next page of resources. """ def __init__( @@ -2423,12 +2423,12 @@ def __init__( def from_dict(cls, _dict: Dict) -> 'PaginationNextConnection': """Initialize a PaginationNextConnection object from a json dictionary.""" args = {} - if 'href' in _dict: - args['href'] = _dict.get('href') + if (href := _dict.get('href')) is not None: + args['href'] = href else: raise ValueError('Required property \'href\' not present in PaginationNextConnection JSON') - if 'start' in _dict: - args['start'] = _dict.get('start') + if (start := _dict.get('start')) is not None: + args['start'] = start else: raise ValueError('Required property \'start\' not present in PaginationNextConnection JSON') return cls(**args) @@ -2471,8 +2471,8 @@ class PaginationNextTG: A reference to the next page of resources; this reference is included for all pages except the last page. - :attr str href: url. - :attr str start: server generated start token for next page of resources. + :param str href: url. + :param str start: server generated start token for next page of resources. """ def __init__( @@ -2493,12 +2493,12 @@ def __init__( def from_dict(cls, _dict: Dict) -> 'PaginationNextTG': """Initialize a PaginationNextTG object from a json dictionary.""" args = {} - if 'href' in _dict: - args['href'] = _dict.get('href') + if (href := _dict.get('href')) is not None: + args['href'] = href else: raise ValueError('Required property \'href\' not present in PaginationNextTG JSON') - if 'start' in _dict: - args['start'] = _dict.get('start') + if (start := _dict.get('start')) is not None: + args['start'] = start else: raise ValueError('Required property \'start\' not present in PaginationNextTG JSON') return cls(**args) @@ -2541,8 +2541,8 @@ class PaginationNextTGWConnection: A reference to the next page of resources; this reference is included for all pages except the last page. - :attr str href: url. - :attr str start: server generated start token for next page of resources. + :param str href: url. + :param str start: server generated start token for next page of resources. """ def __init__( @@ -2563,12 +2563,12 @@ def __init__( def from_dict(cls, _dict: Dict) -> 'PaginationNextTGWConnection': """Initialize a PaginationNextTGWConnection object from a json dictionary.""" args = {} - if 'href' in _dict: - args['href'] = _dict.get('href') + if (href := _dict.get('href')) is not None: + args['href'] = href else: raise ValueError('Required property \'href\' not present in PaginationNextTGWConnection JSON') - if 'start' in _dict: - args['start'] = _dict.get('start') + if (start := _dict.get('start')) is not None: + args['start'] = start else: raise ValueError('Required property \'start\' not present in PaginationNextTGWConnection JSON') return cls(**args) @@ -2610,7 +2610,7 @@ class PrefixFilterCollection: """ prefix filters. - :attr List[PrefixFilterCust] prefix_filters: Array of prefix filters. + :param List[PrefixFilterCust] prefix_filters: Array of prefix filters. """ def __init__( @@ -2628,8 +2628,8 @@ def __init__( def from_dict(cls, _dict: Dict) -> 'PrefixFilterCollection': """Initialize a PrefixFilterCollection object from a json dictionary.""" args = {} - if 'prefix_filters' in _dict: - args['prefix_filters'] = [PrefixFilterCust.from_dict(v) for v in _dict.get('prefix_filters')] + if (prefix_filters := _dict.get('prefix_filters')) is not None: + args['prefix_filters'] = [PrefixFilterCust.from_dict(v) for v in prefix_filters] else: raise ValueError('Required property \'prefix_filters\' not present in PrefixFilterCollection JSON') return cls(**args) @@ -2675,18 +2675,18 @@ class PrefixFilterCust: """ prefix filter. - :attr str action: Whether or not this prefix filter should allow or deny + :param str action: Whether or not this prefix filter should allow or deny prefixes matching this filter's prefix definition. - :attr str before: (optional) A reference to the prefix filter that will be the + :param str before: (optional) A reference to the prefix filter that will be the next filter applied to the Transit Gateway connection. If this field is blank, this prefix filter will be the last rule applied before the connection's default rule. When a prefix filter is created with the same before field as an existing prefix filter, the existing filter will be applied before the new filter, and the existing filter's before field will be updated accordingly. - :attr datetime created_at: The date and time that this prefix filter was + :param datetime created_at: The date and time that this prefix filter was created. - :attr int ge: (optional) Defines the minimum matched prefix precision. If this + :param int ge: (optional) Defines the minimum matched prefix precision. If this field is non-zero then the filter will match all routes within the `prefix` that have a prefix length greater or equal to this value. This value can be zero, or a non-negative number greater than or equal to the @@ -2694,8 +2694,8 @@ class PrefixFilterCust: is set to zero, the filter will not use the `ge` route matching behavior. If the `le` value is non-zero the the `ge` value must between the prefix length and the `le` value, inclusive. - :attr str id: Prefix Filter identifier. - :attr int le: (optional) Defines the maximum matched prefix precision. If this + :param str id: Prefix Filter identifier. + :param int le: (optional) Defines the maximum matched prefix precision. If this field is non-zero then the filter will match all routes within the `prefix` that have a prefix length less than or equal to this value. This value can be zero, or a non-negative number greater than or equal to the @@ -2703,12 +2703,12 @@ class PrefixFilterCust: is set to zero, the filter will not use the `le` route matching behavior. If the `ge` value is non-zero the the `le` value must between the `ge` value and 32, inclusive. - :attr str prefix: The IPv4 Prefix to be matched by this filter. If both the `le` - and `ge` are zero, then this filter will only apply to routes that exactly match - this prefix, while a non-zero value for either `le` or `ge`, this filter can - apply to multiple routes with different prefix lengths, but will still only + :param str prefix: The IPv4 Prefix to be matched by this filter. If both the + `le` and `ge` are zero, then this filter will only apply to routes that exactly + match this prefix, while a non-zero value for either `le` or `ge`, this filter + can apply to multiple routes with different prefix lengths, but will still only apply to prefixes contained in the address space defined by `prefix`. - :attr datetime updated_at: (optional) The date and time that this prefix filter + :param datetime updated_at: (optional) The date and time that this prefix filter was last updated. """ @@ -2719,10 +2719,10 @@ def __init__( id: str, prefix: str, *, - before: str = None, - ge: int = None, - le: int = None, - updated_at: datetime = None, + before: Optional[str] = None, + ge: Optional[int] = None, + le: Optional[int] = None, + updated_at: Optional[datetime] = None, ) -> None: """ Initialize a PrefixFilterCust object. @@ -2778,30 +2778,30 @@ def __init__( def from_dict(cls, _dict: Dict) -> 'PrefixFilterCust': """Initialize a PrefixFilterCust object from a json dictionary.""" args = {} - if 'action' in _dict: - args['action'] = _dict.get('action') + if (action := _dict.get('action')) is not None: + args['action'] = action else: raise ValueError('Required property \'action\' not present in PrefixFilterCust JSON') - if 'before' in _dict: - args['before'] = _dict.get('before') - if 'created_at' in _dict: - args['created_at'] = string_to_datetime(_dict.get('created_at')) + if (before := _dict.get('before')) is not None: + args['before'] = before + if (created_at := _dict.get('created_at')) is not None: + args['created_at'] = string_to_datetime(created_at) else: raise ValueError('Required property \'created_at\' not present in PrefixFilterCust JSON') - if 'ge' in _dict: - args['ge'] = _dict.get('ge') - if 'id' in _dict: - args['id'] = _dict.get('id') + if (ge := _dict.get('ge')) is not None: + args['ge'] = ge + if (id := _dict.get('id')) is not None: + args['id'] = id else: raise ValueError('Required property \'id\' not present in PrefixFilterCust JSON') - if 'le' in _dict: - args['le'] = _dict.get('le') - if 'prefix' in _dict: - args['prefix'] = _dict.get('prefix') + if (le := _dict.get('le')) is not None: + args['le'] = le + if (prefix := _dict.get('prefix')) is not None: + args['prefix'] = prefix else: raise ValueError('Required property \'prefix\' not present in PrefixFilterCust JSON') - if 'updated_at' in _dict: - args['updated_at'] = string_to_datetime(_dict.get('updated_at')) + if (updated_at := _dict.get('updated_at')) is not None: + args['updated_at'] = string_to_datetime(updated_at) return cls(**args) @classmethod @@ -2863,11 +2863,11 @@ class RedundancyGroup: """ A redundancy group. - :attr datetime created_at: The date and time that this redundancy group was + :param datetime created_at: The date and time that this redundancy group was created. - :attr str id: The unique identifier for this redundancy group. - :attr str name: The redundancy group name. - :attr datetime updated_at: (optional) The date and time that this redundancy + :param str id: The unique identifier for this redundancy group. + :param str name: The redundancy group name. + :param datetime updated_at: (optional) The date and time that this redundancy group was last updated. """ @@ -2877,7 +2877,7 @@ def __init__( id: str, name: str, *, - updated_at: datetime = None, + updated_at: Optional[datetime] = None, ) -> None: """ Initialize a RedundancyGroup object. @@ -2898,20 +2898,20 @@ def __init__( def from_dict(cls, _dict: Dict) -> 'RedundancyGroup': """Initialize a RedundancyGroup object from a json dictionary.""" args = {} - if 'created_at' in _dict: - args['created_at'] = string_to_datetime(_dict.get('created_at')) + if (created_at := _dict.get('created_at')) is not None: + args['created_at'] = string_to_datetime(created_at) else: raise ValueError('Required property \'created_at\' not present in RedundancyGroup JSON') - if 'id' in _dict: - args['id'] = _dict.get('id') + if (id := _dict.get('id')) is not None: + args['id'] = id else: raise ValueError('Required property \'id\' not present in RedundancyGroup JSON') - if 'name' in _dict: - args['name'] = _dict.get('name') + if (name := _dict.get('name')) is not None: + args['name'] = name else: raise ValueError('Required property \'name\' not present in RedundancyGroup JSON') - if 'updated_at' in _dict: - args['updated_at'] = string_to_datetime(_dict.get('updated_at')) + if (updated_at := _dict.get('updated_at')) is not None: + args['updated_at'] = string_to_datetime(updated_at) return cls(**args) @classmethod @@ -2955,7 +2955,7 @@ class RedundancyGroupCollection: """ A list of redundancy groups. - :attr List[RedundancyGroup] redundancy_groups: Collection of redundancy groups. + :param List[RedundancyGroup] redundancy_groups: Collection of redundancy groups. """ def __init__( @@ -2974,8 +2974,8 @@ def __init__( def from_dict(cls, _dict: Dict) -> 'RedundancyGroupCollection': """Initialize a RedundancyGroupCollection object from a json dictionary.""" args = {} - if 'redundancy_groups' in _dict: - args['redundancy_groups'] = [RedundancyGroup.from_dict(v) for v in _dict.get('redundancy_groups')] + if (redundancy_groups := _dict.get('redundancy_groups')) is not None: + args['redundancy_groups'] = [RedundancyGroup.from_dict(v) for v in redundancy_groups] else: raise ValueError('Required property \'redundancy_groups\' not present in RedundancyGroupCollection JSON') return cls(**args) @@ -3021,13 +3021,13 @@ class RedundancyGroupPatch: """ An update template for a redundancy group. - :attr str name: (optional) The new name for the redundancy group. + :param str name: (optional) The new name for the redundancy group. """ def __init__( self, *, - name: str = None, + name: Optional[str] = None, ) -> None: """ Initialize a RedundancyGroupPatch object. @@ -3040,8 +3040,8 @@ def __init__( def from_dict(cls, _dict: Dict) -> 'RedundancyGroupPatch': """Initialize a RedundancyGroupPatch object from a json dictionary.""" args = {} - if 'name' in _dict: - args['name'] = _dict.get('name') + if (name := _dict.get('name')) is not None: + args['name'] = name return cls(**args) @classmethod @@ -3080,7 +3080,7 @@ class ResourceGroupIdentity: The resource group to use. If unspecified, the account's [default resource group](https://console.bluemix.net/apidocs/resource-manager#introduction) is used. - :attr str id: The unique identifier for this resource group. + :param str id: The unique identifier for this resource group. """ def __init__( @@ -3098,8 +3098,8 @@ def __init__( def from_dict(cls, _dict: Dict) -> 'ResourceGroupIdentity': """Initialize a ResourceGroupIdentity object from a json dictionary.""" args = {} - if 'id' in _dict: - args['id'] = _dict.get('id') + if (id := _dict.get('id')) is not None: + args['id'] = id else: raise ValueError('Required property \'id\' not present in ResourceGroupIdentity JSON') return cls(**args) @@ -3140,8 +3140,8 @@ class ResourceGroupReference: The resource group to use. If unspecified, the account's [default resource group](https://console.bluemix.net/apidocs/resource-manager#introduction) is used. - :attr str href: The URL for this resource group. - :attr str id: The unique identifier for this resource group. + :param str href: The URL for this resource group. + :param str id: The unique identifier for this resource group. """ def __init__( @@ -3162,12 +3162,12 @@ def __init__( def from_dict(cls, _dict: Dict) -> 'ResourceGroupReference': """Initialize a ResourceGroupReference object from a json dictionary.""" args = {} - if 'href' in _dict: - args['href'] = _dict.get('href') + if (href := _dict.get('href')) is not None: + args['href'] = href else: raise ValueError('Required property \'href\' not present in ResourceGroupReference JSON') - if 'id' in _dict: - args['id'] = _dict.get('id') + if (id := _dict.get('id')) is not None: + args['id'] = id else: raise ValueError('Required property \'id\' not present in ResourceGroupReference JSON') return cls(**args) @@ -3209,16 +3209,16 @@ class RouteReport: """ route report. - :attr List[RouteReportConnection] connections: Array of connections with their + :param List[RouteReportConnection] connections: Array of connections with their routes. - :attr datetime created_at: Date and time route report was requested. - :attr str id: Report identifier. - :attr List[RouteReportOverlappingRouteGroup] overlapping_routes: Array of + :param datetime created_at: Date and time route report was requested. + :param str id: Report identifier. + :param List[RouteReportOverlappingRouteGroup] overlapping_routes: Array of overlapping routes. - :attr str status: Route report status. The list of enumerated values for this + :param str status: Route report status. The list of enumerated values for this property may expand in the future. Code and processes using this field must tolerate unexpected values. - :attr datetime updated_at: (optional) Date and time route report was last + :param datetime updated_at: (optional) Date and time route report was last modified. """ @@ -3230,7 +3230,7 @@ def __init__( overlapping_routes: List['RouteReportOverlappingRouteGroup'], status: str, *, - updated_at: datetime = None, + updated_at: Optional[datetime] = None, ) -> None: """ Initialize a RouteReport object. @@ -3258,28 +3258,28 @@ def __init__( def from_dict(cls, _dict: Dict) -> 'RouteReport': """Initialize a RouteReport object from a json dictionary.""" args = {} - if 'connections' in _dict: - args['connections'] = [RouteReportConnection.from_dict(v) for v in _dict.get('connections')] + if (connections := _dict.get('connections')) is not None: + args['connections'] = [RouteReportConnection.from_dict(v) for v in connections] else: raise ValueError('Required property \'connections\' not present in RouteReport JSON') - if 'created_at' in _dict: - args['created_at'] = string_to_datetime(_dict.get('created_at')) + if (created_at := _dict.get('created_at')) is not None: + args['created_at'] = string_to_datetime(created_at) else: raise ValueError('Required property \'created_at\' not present in RouteReport JSON') - if 'id' in _dict: - args['id'] = _dict.get('id') + if (id := _dict.get('id')) is not None: + args['id'] = id else: raise ValueError('Required property \'id\' not present in RouteReport JSON') - if 'overlapping_routes' in _dict: - args['overlapping_routes'] = [RouteReportOverlappingRouteGroup.from_dict(v) for v in _dict.get('overlapping_routes')] + if (overlapping_routes := _dict.get('overlapping_routes')) is not None: + args['overlapping_routes'] = [RouteReportOverlappingRouteGroup.from_dict(v) for v in overlapping_routes] else: raise ValueError('Required property \'overlapping_routes\' not present in RouteReport JSON') - if 'status' in _dict: - args['status'] = _dict.get('status') + if (status := _dict.get('status')) is not None: + args['status'] = status else: raise ValueError('Required property \'status\' not present in RouteReport JSON') - if 'updated_at' in _dict: - args['updated_at'] = string_to_datetime(_dict.get('updated_at')) + if (updated_at := _dict.get('updated_at')) is not None: + args['updated_at'] = string_to_datetime(updated_at) return cls(**args) @classmethod @@ -3350,7 +3350,7 @@ class RouteReportCollection: """ route reports. - :attr List[RouteReport] route_reports: Array of route reports. + :param List[RouteReport] route_reports: Array of route reports. """ def __init__( @@ -3368,8 +3368,8 @@ def __init__( def from_dict(cls, _dict: Dict) -> 'RouteReportCollection': """Initialize a RouteReportCollection object from a json dictionary.""" args = {} - if 'route_reports' in _dict: - args['route_reports'] = [RouteReport.from_dict(v) for v in _dict.get('route_reports')] + if (route_reports := _dict.get('route_reports')) is not None: + args['route_reports'] = [RouteReport.from_dict(v) for v in route_reports] else: raise ValueError('Required property \'route_reports\' not present in RouteReportCollection JSON') return cls(**args) @@ -3415,11 +3415,11 @@ class RouteReportConnection: """ route report connection. - :attr List[RouteReportConnectionBgp] bgps: Array of connection's bgps. - :attr str id: (optional) connection ID. - :attr str name: (optional) connection name. - :attr List[RouteReportConnectionRoute] routes: Array of connection's routes. - :attr str type: (optional) connection type. + :param List[RouteReportConnectionBgp] bgps: Array of connection's bgps. + :param str id: (optional) connection ID. + :param str name: (optional) connection name. + :param List[RouteReportConnectionRoute] routes: Array of connection's routes. + :param str type: (optional) connection type. """ def __init__( @@ -3427,9 +3427,9 @@ def __init__( bgps: List['RouteReportConnectionBgp'], routes: List['RouteReportConnectionRoute'], *, - id: str = None, - name: str = None, - type: str = None, + id: Optional[str] = None, + name: Optional[str] = None, + type: Optional[str] = None, ) -> None: """ Initialize a RouteReportConnection object. @@ -3451,20 +3451,20 @@ def __init__( def from_dict(cls, _dict: Dict) -> 'RouteReportConnection': """Initialize a RouteReportConnection object from a json dictionary.""" args = {} - if 'bgps' in _dict: - args['bgps'] = [RouteReportConnectionBgp.from_dict(v) for v in _dict.get('bgps')] + if (bgps := _dict.get('bgps')) is not None: + args['bgps'] = [RouteReportConnectionBgp.from_dict(v) for v in bgps] else: raise ValueError('Required property \'bgps\' not present in RouteReportConnection JSON') - if 'id' in _dict: - args['id'] = _dict.get('id') - if 'name' in _dict: - args['name'] = _dict.get('name') - if 'routes' in _dict: - args['routes'] = [RouteReportConnectionRoute.from_dict(v) for v in _dict.get('routes')] + if (id := _dict.get('id')) is not None: + args['id'] = id + if (name := _dict.get('name')) is not None: + args['name'] = name + if (routes := _dict.get('routes')) is not None: + args['routes'] = [RouteReportConnectionRoute.from_dict(v) for v in routes] else: raise ValueError('Required property \'routes\' not present in RouteReportConnection JSON') - if 'type' in _dict: - args['type'] = _dict.get('type') + if (type := _dict.get('type')) is not None: + args['type'] = type return cls(**args) @classmethod @@ -3522,19 +3522,19 @@ class RouteReportConnectionBgp: """ connection bgp details. - :attr str as_path: (optional) AS path. - :attr bool is_used: Indicates whether current route is used or not. - :attr str local_preference: (optional) local preference. - :attr str prefix: (optional) prefix. + :param str as_path: (optional) AS path. + :param bool is_used: Indicates whether current route is used or not. + :param str local_preference: (optional) local preference. + :param str prefix: (optional) prefix. """ def __init__( self, is_used: bool, *, - as_path: str = None, - local_preference: str = None, - prefix: str = None, + as_path: Optional[str] = None, + local_preference: Optional[str] = None, + prefix: Optional[str] = None, ) -> None: """ Initialize a RouteReportConnectionBgp object. @@ -3553,16 +3553,16 @@ def __init__( def from_dict(cls, _dict: Dict) -> 'RouteReportConnectionBgp': """Initialize a RouteReportConnectionBgp object from a json dictionary.""" args = {} - if 'as_path' in _dict: - args['as_path'] = _dict.get('as_path') - if 'is_used' in _dict: - args['is_used'] = _dict.get('is_used') + if (as_path := _dict.get('as_path')) is not None: + args['as_path'] = as_path + if (is_used := _dict.get('is_used')) is not None: + args['is_used'] = is_used else: raise ValueError('Required property \'is_used\' not present in RouteReportConnectionBgp JSON') - if 'local_preference' in _dict: - args['local_preference'] = _dict.get('local_preference') - if 'prefix' in _dict: - args['prefix'] = _dict.get('prefix') + if (local_preference := _dict.get('local_preference')) is not None: + args['local_preference'] = local_preference + if (prefix := _dict.get('prefix')) is not None: + args['prefix'] = prefix return cls(**args) @classmethod @@ -3606,13 +3606,13 @@ class RouteReportConnectionRoute: """ connection used route. - :attr str prefix: (optional) prefix. + :param str prefix: (optional) prefix. """ def __init__( self, *, - prefix: str = None, + prefix: Optional[str] = None, ) -> None: """ Initialize a RouteReportConnectionRoute object. @@ -3625,8 +3625,8 @@ def __init__( def from_dict(cls, _dict: Dict) -> 'RouteReportConnectionRoute': """Initialize a RouteReportConnectionRoute object from a json dictionary.""" args = {} - if 'prefix' in _dict: - args['prefix'] = _dict.get('prefix') + if (prefix := _dict.get('prefix')) is not None: + args['prefix'] = prefix return cls(**args) @classmethod @@ -3664,15 +3664,15 @@ class RouteReportOverlappingRoute: """ overlapping route details. - :attr str connection_id: (optional) connection ID. - :attr str prefix: (optional) overlapping prefix. + :param str connection_id: (optional) connection ID. + :param str prefix: (optional) overlapping prefix. """ def __init__( self, *, - connection_id: str = None, - prefix: str = None, + connection_id: Optional[str] = None, + prefix: Optional[str] = None, ) -> None: """ Initialize a RouteReportOverlappingRoute object. @@ -3687,10 +3687,10 @@ def __init__( def from_dict(cls, _dict: Dict) -> 'RouteReportOverlappingRoute': """Initialize a RouteReportOverlappingRoute object from a json dictionary.""" args = {} - if 'connection_id' in _dict: - args['connection_id'] = _dict.get('connection_id') - if 'prefix' in _dict: - args['prefix'] = _dict.get('prefix') + if (connection_id := _dict.get('connection_id')) is not None: + args['connection_id'] = connection_id + if (prefix := _dict.get('prefix')) is not None: + args['prefix'] = prefix return cls(**args) @classmethod @@ -3730,7 +3730,7 @@ class RouteReportOverlappingRouteGroup: """ Collection of overlapping route. - :attr List[RouteReportOverlappingRoute] routes: Array of overlapping + :param List[RouteReportOverlappingRoute] routes: Array of overlapping connection/prefix pairs. """ @@ -3750,8 +3750,8 @@ def __init__( def from_dict(cls, _dict: Dict) -> 'RouteReportOverlappingRouteGroup': """Initialize a RouteReportOverlappingRouteGroup object from a json dictionary.""" args = {} - if 'routes' in _dict: - args['routes'] = [RouteReportOverlappingRoute.from_dict(v) for v in _dict.get('routes')] + if (routes := _dict.get('routes')) is not None: + args['routes'] = [RouteReportOverlappingRoute.from_dict(v) for v in routes] else: raise ValueError('Required property \'routes\' not present in RouteReportOverlappingRouteGroup JSON') return cls(**args) @@ -3797,7 +3797,7 @@ class TSCollection: """ A list of Transit Gateway locations. - :attr List[TSLocationBasic] locations: Collection of Transit Gateway locations. + :param List[TSLocationBasic] locations: Collection of Transit Gateway locations. """ def __init__( @@ -3816,8 +3816,8 @@ def __init__( def from_dict(cls, _dict: Dict) -> 'TSCollection': """Initialize a TSCollection object from a json dictionary.""" args = {} - if 'locations' in _dict: - args['locations'] = [TSLocationBasic.from_dict(v) for v in _dict.get('locations')] + if (locations := _dict.get('locations')) is not None: + args['locations'] = [TSLocationBasic.from_dict(v) for v in locations] else: raise ValueError('Required property \'locations\' not present in TSCollection JSON') return cls(**args) @@ -3863,10 +3863,11 @@ class TSLocalLocation: """ Details of a local connection location. - :attr str display_name: A descriptive display name for the location. - :attr str name: The name of the location. - :attr List[str] supported_connection_types: Array of supported connection types. - :attr str type: The type of the location, determining is this a multi-zone + :param str display_name: A descriptive display name for the location. + :param str name: The name of the location. + :param List[str] supported_connection_types: Array of supported connection + types. + :param str type: The type of the location, determining is this a multi-zone region, a single data center, or a point of presence. The list of enumerated values for this property may expand in the future. Code and processes using this field must tolerate unexpected values. @@ -3900,20 +3901,20 @@ def __init__( def from_dict(cls, _dict: Dict) -> 'TSLocalLocation': """Initialize a TSLocalLocation object from a json dictionary.""" args = {} - if 'display_name' in _dict: - args['display_name'] = _dict.get('display_name') + if (display_name := _dict.get('display_name')) is not None: + args['display_name'] = display_name else: raise ValueError('Required property \'display_name\' not present in TSLocalLocation JSON') - if 'name' in _dict: - args['name'] = _dict.get('name') + if (name := _dict.get('name')) is not None: + args['name'] = name else: raise ValueError('Required property \'name\' not present in TSLocalLocation JSON') - if 'supported_connection_types' in _dict: - args['supported_connection_types'] = _dict.get('supported_connection_types') + if (supported_connection_types := _dict.get('supported_connection_types')) is not None: + args['supported_connection_types'] = supported_connection_types else: raise ValueError('Required property \'supported_connection_types\' not present in TSLocalLocation JSON') - if 'type' in _dict: - args['type'] = _dict.get('type') + if (type := _dict.get('type')) is not None: + args['type'] = type else: raise ValueError('Required property \'type\' not present in TSLocalLocation JSON') return cls(**args) @@ -3971,14 +3972,14 @@ class TSLocation: """ Details of a Transit Gateway location. - :attr str billing_location: The geographical location of this location, used for - billing purposes. - :attr str name: Name of the Location. - :attr str type: The type of the location, determining is this a multi-zone + :param str billing_location: The geographical location of this location, used + for billing purposes. + :param str name: Name of the Location. + :param str type: The type of the location, determining is this a multi-zone region, a single data center, or a point of presence. - :attr List[TSLocalLocation] local_connection_locations: The set of network + :param List[TSLocalLocation] local_connection_locations: The set of network locations that are considered local for this Transit Gateway location. - :attr List[ZoneReference] zones: List of valid zones for GRE tunnels. + :param List[ZoneReference] zones: List of valid zones for GRE tunnels. """ def __init__( @@ -4011,24 +4012,24 @@ def __init__( def from_dict(cls, _dict: Dict) -> 'TSLocation': """Initialize a TSLocation object from a json dictionary.""" args = {} - if 'billing_location' in _dict: - args['billing_location'] = _dict.get('billing_location') + if (billing_location := _dict.get('billing_location')) is not None: + args['billing_location'] = billing_location else: raise ValueError('Required property \'billing_location\' not present in TSLocation JSON') - if 'name' in _dict: - args['name'] = _dict.get('name') + if (name := _dict.get('name')) is not None: + args['name'] = name else: raise ValueError('Required property \'name\' not present in TSLocation JSON') - if 'type' in _dict: - args['type'] = _dict.get('type') + if (type := _dict.get('type')) is not None: + args['type'] = type else: raise ValueError('Required property \'type\' not present in TSLocation JSON') - if 'local_connection_locations' in _dict: - args['local_connection_locations'] = [TSLocalLocation.from_dict(v) for v in _dict.get('local_connection_locations')] + if (local_connection_locations := _dict.get('local_connection_locations')) is not None: + args['local_connection_locations'] = [TSLocalLocation.from_dict(v) for v in local_connection_locations] else: raise ValueError('Required property \'local_connection_locations\' not present in TSLocation JSON') - if 'zones' in _dict: - args['zones'] = [ZoneReference.from_dict(v) for v in _dict.get('zones')] + if (zones := _dict.get('zones')) is not None: + args['zones'] = [ZoneReference.from_dict(v) for v in zones] else: raise ValueError('Required property \'zones\' not present in TSLocation JSON') return cls(**args) @@ -4088,10 +4089,10 @@ class TSLocationBasic: """ Details of a Transit Gateway location. - :attr str billing_location: The geographical location of this location, used for - billing purposes. - :attr str name: Name of the Location. - :attr str type: The type of the location, determining is this a multi-zone + :param str billing_location: The geographical location of this location, used + for billing purposes. + :param str name: Name of the Location. + :param str type: The type of the location, determining is this a multi-zone region, a single data center, or a point of presence. """ @@ -4118,16 +4119,16 @@ def __init__( def from_dict(cls, _dict: Dict) -> 'TSLocationBasic': """Initialize a TSLocationBasic object from a json dictionary.""" args = {} - if 'billing_location' in _dict: - args['billing_location'] = _dict.get('billing_location') + if (billing_location := _dict.get('billing_location')) is not None: + args['billing_location'] = billing_location else: raise ValueError('Required property \'billing_location\' not present in TSLocationBasic JSON') - if 'name' in _dict: - args['name'] = _dict.get('name') + if (name := _dict.get('name')) is not None: + args['name'] = name else: raise ValueError('Required property \'name\' not present in TSLocationBasic JSON') - if 'type' in _dict: - args['type'] = _dict.get('type') + if (type := _dict.get('type')) is not None: + args['type'] = type else: raise ValueError('Required property \'type\' not present in TSLocationBasic JSON') return cls(**args) @@ -4171,68 +4172,68 @@ class TransitConnection: """ Connection included in transit gateway. - :attr str base_network_type: (optional) The type of network the GRE tunnel is + :param str base_network_type: (optional) The type of network the GRE tunnel is targeting. - :attr str name: The user-defined name for this transit gateway connection. - :attr str network_id: (optional) The ID of the network being connected via this + :param str name: The user-defined name for this transit gateway connection. + :param str network_id: (optional) The ID of the network being connected via this connection. This field is required for some types, such as `vpc`, `power_virtual_server`, `directlink`, `vpn_gateway`, `dynamic_route_server` and `redundant_gre`. For network types `vpc`, `vpn_gateway`, `dynamic_route_server`, `power_virtual_server` and `directlink` this is the CRN of the VPC / VPN / Dynamic Route Server / PowerVS / Direct Link gateway respectively. - :attr str network_type: Defines what type of network is connected via this + :param str network_type: Defines what type of network is connected via this connection. The list of enumerated values for this property may expand in the future. Code and processes using this field must tolerate unexpected values. - :attr str id: The unique identifier for this Transit Gateway connection. - :attr str base_connection_id: (optional) Deprecated: network_type `gre_tunnel` + :param str id: The unique identifier for this Transit Gateway connection. + :param str base_connection_id: (optional) Deprecated: network_type `gre_tunnel` connections use `base_connection_id` to specify the ID of a network_type `classic` connection the tunnel is configured over. The specified connection must reside in the same transit gateway and be in an active state. The `classic` connection cannot be deleted until any `gre_tunnel` connections using it are deleted. This field only applies to and is required for network type `gre_tunnel` connections. - :attr str cidr: (optional) network_type `vpn_gateway` and `dynamic_route_server` - connections use `cidr` to specify the CIDR to use for the `VPN gateway / Dynamic - route server` GRE tunnels. - :attr datetime created_at: The date and time that this connection was created. - :attr int local_bgp_asn: (optional) Local network BGP ASN. This field only + :param str cidr: (optional) network_type `vpn_gateway` and + `dynamic_route_server` connections use `cidr` to specify the CIDR to use for the + `VPN gateway / Dynamic route server` GRE tunnels. + :param datetime created_at: The date and time that this connection was created. + :param int local_bgp_asn: (optional) Local network BGP ASN. This field only applies to network type `gre_tunnel` and `unbound_gre_tunnel` connections. - :attr str local_gateway_ip: (optional) Local gateway IP address. This field + :param str local_gateway_ip: (optional) Local gateway IP address. This field only applies to network type `gre_tunnel` and `unbound_gre_tunnel` connections. - :attr str local_tunnel_ip: (optional) Local tunnel IP address. This field only + :param str local_tunnel_ip: (optional) Local tunnel IP address. This field only applies to network type `gre_tunnel` and `unbound_gre_tunnel` connections. - :attr int mtu: (optional) GRE tunnel MTU. This field only applies to network + :param int mtu: (optional) GRE tunnel MTU. This field only applies to network type `gre_tunnel` and `unbound_gre_tunnel` connections. - :attr str network_account_id: (optional) The ID of the account which owns the + :param str network_account_id: (optional) The ID of the account which owns the connected network. Generally only used if the network is in a different IBM Cloud account than the gateway. - :attr List[TransitGatewayConnectionPrefixFilterReference] prefix_filters: + :param List[TransitGatewayConnectionPrefixFilterReference] prefix_filters: (optional) Array of prefix route filters for a transit gateway connection. This is order dependent with those first in the array being applied first, and those at the end of the array is applied last, or just before the default. This field does not apply to the `redundant_gre` network types. - :attr str prefix_filters_default: (optional) Default setting of permit or deny + :param str prefix_filters_default: (optional) Default setting of permit or deny which applies to any routes that don't match a specified filter. This field does not apply to the `redundant_gre` network types. - :attr int remote_bgp_asn: (optional) Remote network BGP ASN. This field only + :param int remote_bgp_asn: (optional) Remote network BGP ASN. This field only applies to network type `gre_tunnel` and `unbound_gre_tunnel` connections. - :attr str remote_gateway_ip: (optional) Remote gateway IP address. This field + :param str remote_gateway_ip: (optional) Remote gateway IP address. This field only applies to network type `gre_tunnel` and `unbound_gre_tunnel` connections. - :attr str remote_tunnel_ip: (optional) Remote tunnel IP address. This field + :param str remote_tunnel_ip: (optional) Remote tunnel IP address. This field only applies to network type `gre_tunnel` and `unbound_gre_tunnel` connections. - :attr str request_status: Only visible for cross account connections, this field - represents the status of a connection request between IBM Cloud accounts. The - list of enumerated values for this property may expand in the future. Code and - processes using this field must tolerate unexpected values. - :attr str status: Connection's current configuration state. The list of + :param str request_status: Only visible for cross account connections, this + field represents the status of a connection request between IBM Cloud accounts. + The list of enumerated values for this property may expand in the future. Code + and processes using this field must tolerate unexpected values. + :param str status: Connection's current configuration state. The list of enumerated values for this property may expand in the future. Code and processes using this field must tolerate unexpected values. - :attr TransitGatewayReference transit_gateway: Transit gateway reference. - :attr List[TransitGatewayTunnel] tunnels: (optional) Collection of all tunnels + :param TransitGatewayReference transit_gateway: Transit gateway reference. + :param List[TransitGatewayTunnel] tunnels: (optional) Collection of all tunnels for `redundant_gre`, `vpn_gateway` and `dynamic_route_server` connections. - :attr datetime updated_at: The date and time that this connection was last + :param datetime updated_at: The date and time that this connection was last updated. - :attr ZoneReference zone: (optional) Availability zone reference. + :param ZoneReference zone: (optional) Availability zone reference. """ def __init__( @@ -4246,22 +4247,22 @@ def __init__( transit_gateway: 'TransitGatewayReference', updated_at: datetime, *, - base_network_type: str = None, - network_id: str = None, - base_connection_id: str = None, - cidr: str = None, - local_bgp_asn: int = None, - local_gateway_ip: str = None, - local_tunnel_ip: str = None, - mtu: int = None, - network_account_id: str = None, - prefix_filters: List['TransitGatewayConnectionPrefixFilterReference'] = None, - prefix_filters_default: str = None, - remote_bgp_asn: int = None, - remote_gateway_ip: str = None, - remote_tunnel_ip: str = None, - tunnels: List['TransitGatewayTunnel'] = None, - zone: 'ZoneReference' = None, + base_network_type: Optional[str] = None, + network_id: Optional[str] = None, + base_connection_id: Optional[str] = None, + cidr: Optional[str] = None, + local_bgp_asn: Optional[int] = None, + local_gateway_ip: Optional[str] = None, + local_tunnel_ip: Optional[str] = None, + mtu: Optional[int] = None, + network_account_id: Optional[str] = None, + prefix_filters: Optional[List['TransitGatewayConnectionPrefixFilterReference']] = 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['TransitGatewayTunnel']] = None, + zone: Optional['ZoneReference'] = None, ) -> None: """ Initialize a TransitConnection object. @@ -4370,70 +4371,70 @@ def __init__( def from_dict(cls, _dict: Dict) -> 'TransitConnection': """Initialize a TransitConnection object from a json dictionary.""" args = {} - if 'base_network_type' in _dict: - args['base_network_type'] = _dict.get('base_network_type') - if 'name' in _dict: - args['name'] = _dict.get('name') + if (base_network_type := _dict.get('base_network_type')) is not None: + args['base_network_type'] = base_network_type + if (name := _dict.get('name')) is not None: + args['name'] = name else: raise ValueError('Required property \'name\' not present in TransitConnection JSON') - if 'network_id' in _dict: - args['network_id'] = _dict.get('network_id') - if 'network_type' in _dict: - args['network_type'] = _dict.get('network_type') + if (network_id := _dict.get('network_id')) is not None: + args['network_id'] = network_id + if (network_type := _dict.get('network_type')) is not None: + args['network_type'] = network_type else: raise ValueError('Required property \'network_type\' not present in TransitConnection JSON') - if 'id' in _dict: - args['id'] = _dict.get('id') + if (id := _dict.get('id')) is not None: + args['id'] = id else: raise ValueError('Required property \'id\' not present in TransitConnection JSON') - if 'base_connection_id' in _dict: - args['base_connection_id'] = _dict.get('base_connection_id') - if 'cidr' in _dict: - args['cidr'] = _dict.get('cidr') - if 'created_at' in _dict: - args['created_at'] = string_to_datetime(_dict.get('created_at')) + if (base_connection_id := _dict.get('base_connection_id')) is not None: + args['base_connection_id'] = base_connection_id + if (cidr := _dict.get('cidr')) is not None: + args['cidr'] = cidr + if (created_at := _dict.get('created_at')) is not None: + args['created_at'] = string_to_datetime(created_at) else: raise ValueError('Required property \'created_at\' not present in TransitConnection JSON') - if 'local_bgp_asn' in _dict: - args['local_bgp_asn'] = _dict.get('local_bgp_asn') - if 'local_gateway_ip' in _dict: - args['local_gateway_ip'] = _dict.get('local_gateway_ip') - if 'local_tunnel_ip' in _dict: - args['local_tunnel_ip'] = _dict.get('local_tunnel_ip') - if 'mtu' in _dict: - args['mtu'] = _dict.get('mtu') - if 'network_account_id' in _dict: - args['network_account_id'] = _dict.get('network_account_id') - if 'prefix_filters' in _dict: - args['prefix_filters'] = [TransitGatewayConnectionPrefixFilterReference.from_dict(v) for v in _dict.get('prefix_filters')] - if 'prefix_filters_default' in _dict: - args['prefix_filters_default'] = _dict.get('prefix_filters_default') - if 'remote_bgp_asn' in _dict: - args['remote_bgp_asn'] = _dict.get('remote_bgp_asn') - if 'remote_gateway_ip' in _dict: - args['remote_gateway_ip'] = _dict.get('remote_gateway_ip') - if 'remote_tunnel_ip' in _dict: - args['remote_tunnel_ip'] = _dict.get('remote_tunnel_ip') - if 'request_status' in _dict: - args['request_status'] = _dict.get('request_status') + if (local_bgp_asn := _dict.get('local_bgp_asn')) is not None: + args['local_bgp_asn'] = local_bgp_asn + if (local_gateway_ip := _dict.get('local_gateway_ip')) is not None: + args['local_gateway_ip'] = local_gateway_ip + if (local_tunnel_ip := _dict.get('local_tunnel_ip')) is not None: + args['local_tunnel_ip'] = local_tunnel_ip + if (mtu := _dict.get('mtu')) is not None: + args['mtu'] = mtu + if (network_account_id := _dict.get('network_account_id')) is not None: + args['network_account_id'] = network_account_id + if (prefix_filters := _dict.get('prefix_filters')) is not None: + args['prefix_filters'] = [TransitGatewayConnectionPrefixFilterReference.from_dict(v) for v in prefix_filters] + if (prefix_filters_default := _dict.get('prefix_filters_default')) is not None: + args['prefix_filters_default'] = prefix_filters_default + if (remote_bgp_asn := _dict.get('remote_bgp_asn')) is not None: + args['remote_bgp_asn'] = remote_bgp_asn + if (remote_gateway_ip := _dict.get('remote_gateway_ip')) is not None: + args['remote_gateway_ip'] = remote_gateway_ip + if (remote_tunnel_ip := _dict.get('remote_tunnel_ip')) is not None: + args['remote_tunnel_ip'] = remote_tunnel_ip + if (request_status := _dict.get('request_status')) is not None: + args['request_status'] = request_status else: raise ValueError('Required property \'request_status\' not present in TransitConnection JSON') - if 'status' in _dict: - args['status'] = _dict.get('status') + if (status := _dict.get('status')) is not None: + args['status'] = status else: raise ValueError('Required property \'status\' not present in TransitConnection JSON') - if 'transit_gateway' in _dict: - args['transit_gateway'] = TransitGatewayReference.from_dict(_dict.get('transit_gateway')) + if (transit_gateway := _dict.get('transit_gateway')) is not None: + args['transit_gateway'] = TransitGatewayReference.from_dict(transit_gateway) else: raise ValueError('Required property \'transit_gateway\' not present in TransitConnection JSON') - if 'tunnels' in _dict: - args['tunnels'] = [TransitGatewayTunnel.from_dict(v) for v in _dict.get('tunnels')] - if 'updated_at' in _dict: - args['updated_at'] = string_to_datetime(_dict.get('updated_at')) + if (tunnels := _dict.get('tunnels')) is not None: + args['tunnels'] = [TransitGatewayTunnel.from_dict(v) for v in tunnels] + if (updated_at := _dict.get('updated_at')) is not None: + args['updated_at'] = string_to_datetime(updated_at) else: raise ValueError('Required property \'updated_at\' not present in TransitConnection JSON') - if 'zone' in _dict: - args['zone'] = ZoneReference.from_dict(_dict.get('zone')) + if (zone := _dict.get('zone')) is not None: + args['zone'] = ZoneReference.from_dict(zone) return cls(**args) @classmethod @@ -4606,11 +4607,12 @@ class TransitConnectionCollection: """ Transit gateway connections. - :attr List[TransitConnection] connections: Array of transit gateway connections. - :attr PaginationFirstConnection first: A reference to the first page of + :param List[TransitConnection] connections: Array of transit gateway + connections. + :param PaginationFirstConnection first: A reference to the first page of resources. - :attr int limit: The maximum number of connections returned on one request. - :attr PaginationNextConnection next: (optional) A reference to the next page of + :param int limit: The maximum number of connections returned on one request. + :param PaginationNextConnection next: (optional) A reference to the next page of resources; this reference is included for all pages except the last page. """ @@ -4620,7 +4622,7 @@ def __init__( first: 'PaginationFirstConnection', limit: int, *, - next: 'PaginationNextConnection' = None, + next: Optional['PaginationNextConnection'] = None, ) -> None: """ Initialize a TransitConnectionCollection object. @@ -4644,20 +4646,20 @@ def __init__( def from_dict(cls, _dict: Dict) -> 'TransitConnectionCollection': """Initialize a TransitConnectionCollection object from a json dictionary.""" args = {} - if 'connections' in _dict: - args['connections'] = [TransitConnection.from_dict(v) for v in _dict.get('connections')] + if (connections := _dict.get('connections')) is not None: + args['connections'] = [TransitConnection.from_dict(v) for v in connections] else: raise ValueError('Required property \'connections\' not present in TransitConnectionCollection JSON') - if 'first' in _dict: - args['first'] = PaginationFirstConnection.from_dict(_dict.get('first')) + if (first := _dict.get('first')) is not None: + args['first'] = PaginationFirstConnection.from_dict(first) else: raise ValueError('Required property \'first\' not present in TransitConnectionCollection JSON') - if 'limit' in _dict: - args['limit'] = _dict.get('limit') + if (limit := _dict.get('limit')) is not None: + args['limit'] = limit else: raise ValueError('Required property \'limit\' not present in TransitConnectionCollection JSON') - if 'next' in _dict: - args['next'] = PaginationNextConnection.from_dict(_dict.get('next')) + if (next := _dict.get('next')) is not None: + args['next'] = PaginationNextConnection.from_dict(next) return cls(**args) @classmethod @@ -4713,32 +4715,32 @@ class TransitGateway: """ Details of a Transit Gateway. - :attr int connection_count: (optional) The number of connections associated with - this Transit Gateway. - :attr bool connection_needs_attention: Indicates if this Transit Gateway has a + :param int connection_count: (optional) The number of connections associated + with this Transit Gateway. + :param bool connection_needs_attention: Indicates if this Transit Gateway has a connection that needs attention (Such as cross account approval). - :attr datetime created_at: The date and time that this gateway was created. - :attr str crn: (optional) Cloud Resource Name of a transit gateway. - :attr bool global_: Allow global routing for a Transit Gateway. - :attr bool gre_enhanced_route_propagation: Allow route propagation across all + :param datetime created_at: The date and time that this gateway was created. + :param str crn: (optional) Cloud Resource Name of a transit gateway. + :param bool global_: Allow global routing for a Transit Gateway. + :param bool gre_enhanced_route_propagation: 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`. - :attr str id: A unique identifier for this transit gateway. - :attr str location: Location of Transit Gateway Services. - :attr str name: A human readable name for the transit gateway. - :attr str redundancy_group: (optional) The redundancy group for this global + :param str id: A unique identifier for this transit gateway. + :param str location: Location of Transit Gateway Services. + :param str name: A human readable name for the transit gateway. + :param str redundancy_group: (optional) The redundancy group for this global transit gateway. The global transit gateways in this redundancy group will be redundant to each other. - :attr str redundancy_group_id: (optional) The unique identifier of the + :param str redundancy_group_id: (optional) The unique identifier of the redundancy group for this global transit gateway. - :attr ResourceGroupReference resource_group: (optional) The resource group to + :param ResourceGroupReference resource_group: (optional) The resource group to use. If unspecified, the account's [default resource group](https://console.bluemix.net/apidocs/resource-manager#introduction) is used. - :attr str status: The status of the Transit Gateway. The list of enumerated + :param str status: The status of the Transit Gateway. The list of enumerated values for this property may expand in the future. Code and processes using this field must tolerate unexpected values. - :attr datetime updated_at: (optional) The date and time that this gateway was + :param datetime updated_at: (optional) The date and time that this gateway was last updated. """ @@ -4753,12 +4755,12 @@ def __init__( name: str, status: str, *, - connection_count: int = None, - crn: str = None, - redundancy_group: str = None, - redundancy_group_id: str = None, - resource_group: 'ResourceGroupReference' = None, - updated_at: datetime = None, + connection_count: Optional[int] = None, + crn: Optional[str] = None, + redundancy_group: Optional[str] = None, + redundancy_group_id: Optional[str] = None, + resource_group: Optional['ResourceGroupReference'] = None, + updated_at: Optional[datetime] = None, ) -> None: """ Initialize a TransitGateway object. @@ -4811,50 +4813,50 @@ def __init__( def from_dict(cls, _dict: Dict) -> 'TransitGateway': """Initialize a TransitGateway object from a json dictionary.""" args = {} - if 'connection_count' in _dict: - args['connection_count'] = _dict.get('connection_count') - if 'connection_needs_attention' in _dict: - args['connection_needs_attention'] = _dict.get('connection_needs_attention') + if (connection_count := _dict.get('connection_count')) is not None: + args['connection_count'] = connection_count + if (connection_needs_attention := _dict.get('connection_needs_attention')) is not None: + args['connection_needs_attention'] = connection_needs_attention else: raise ValueError('Required property \'connection_needs_attention\' not present in TransitGateway JSON') - if 'created_at' in _dict: - args['created_at'] = string_to_datetime(_dict.get('created_at')) + if (created_at := _dict.get('created_at')) is not None: + args['created_at'] = string_to_datetime(created_at) else: raise ValueError('Required property \'created_at\' not present in TransitGateway JSON') - if 'crn' in _dict: - args['crn'] = _dict.get('crn') - if 'global' in _dict: - args['global_'] = _dict.get('global') + if (crn := _dict.get('crn')) is not None: + args['crn'] = crn + if (global_ := _dict.get('global')) is not None: + args['global_'] = global_ else: raise ValueError('Required property \'global\' not present in TransitGateway JSON') - if 'gre_enhanced_route_propagation' in _dict: - args['gre_enhanced_route_propagation'] = _dict.get('gre_enhanced_route_propagation') + if (gre_enhanced_route_propagation := _dict.get('gre_enhanced_route_propagation')) is not None: + args['gre_enhanced_route_propagation'] = gre_enhanced_route_propagation else: raise ValueError('Required property \'gre_enhanced_route_propagation\' not present in TransitGateway JSON') - if 'id' in _dict: - args['id'] = _dict.get('id') + if (id := _dict.get('id')) is not None: + args['id'] = id else: raise ValueError('Required property \'id\' not present in TransitGateway JSON') - if 'location' in _dict: - args['location'] = _dict.get('location') + if (location := _dict.get('location')) is not None: + args['location'] = location else: raise ValueError('Required property \'location\' not present in TransitGateway JSON') - if 'name' in _dict: - args['name'] = _dict.get('name') + if (name := _dict.get('name')) is not None: + args['name'] = name else: raise ValueError('Required property \'name\' not present in TransitGateway JSON') - if 'redundancy_group' in _dict: - args['redundancy_group'] = _dict.get('redundancy_group') - if 'redundancy_group_id' in _dict: - args['redundancy_group_id'] = _dict.get('redundancy_group_id') - if 'resource_group' in _dict: - args['resource_group'] = ResourceGroupReference.from_dict(_dict.get('resource_group')) - if 'status' in _dict: - args['status'] = _dict.get('status') + if (redundancy_group := _dict.get('redundancy_group')) is not None: + args['redundancy_group'] = redundancy_group + if (redundancy_group_id := _dict.get('redundancy_group_id')) is not None: + args['redundancy_group_id'] = redundancy_group_id + if (resource_group := _dict.get('resource_group')) is not None: + args['resource_group'] = ResourceGroupReference.from_dict(resource_group) + if (status := _dict.get('status')) is not None: + args['status'] = status else: raise ValueError('Required property \'status\' not present in TransitGateway JSON') - if 'updated_at' in _dict: - args['updated_at'] = string_to_datetime(_dict.get('updated_at')) + if (updated_at := _dict.get('updated_at')) is not None: + args['updated_at'] = string_to_datetime(updated_at) return cls(**args) @classmethod @@ -4936,11 +4938,11 @@ class TransitGatewayCollection: """ A list of Transit Gateways. - :attr PaginationFirstTG first: A reference to the first page of resources. - :attr int limit: The maximum number of gateways returned on one request. - :attr PaginationNextTG next: (optional) A reference to the next page of + :param PaginationFirstTG first: A reference to the first page of resources. + :param int limit: The maximum number of gateways returned on one request. + :param PaginationNextTG next: (optional) A reference to the next page of resources; this reference is included for all pages except the last page. - :attr List[TransitGateway] transit_gateways: Collection of Transit Services + :param List[TransitGateway] transit_gateways: Collection of Transit Services gateways. """ @@ -4950,7 +4952,7 @@ def __init__( limit: int, transit_gateways: List['TransitGateway'], *, - next: 'PaginationNextTG' = None, + next: Optional['PaginationNextTG'] = None, ) -> None: """ Initialize a TransitGatewayCollection object. @@ -4971,18 +4973,18 @@ def __init__( def from_dict(cls, _dict: Dict) -> 'TransitGatewayCollection': """Initialize a TransitGatewayCollection object from a json dictionary.""" args = {} - if 'first' in _dict: - args['first'] = PaginationFirstTG.from_dict(_dict.get('first')) + if (first := _dict.get('first')) is not None: + args['first'] = PaginationFirstTG.from_dict(first) else: raise ValueError('Required property \'first\' not present in TransitGatewayCollection JSON') - if 'limit' in _dict: - args['limit'] = _dict.get('limit') + if (limit := _dict.get('limit')) is not None: + args['limit'] = limit else: raise ValueError('Required property \'limit\' not present in TransitGatewayCollection JSON') - if 'next' in _dict: - args['next'] = PaginationNextTG.from_dict(_dict.get('next')) - if 'transit_gateways' in _dict: - args['transit_gateways'] = [TransitGateway.from_dict(v) for v in _dict.get('transit_gateways')] + if (next := _dict.get('next')) is not None: + args['next'] = PaginationNextTG.from_dict(next) + if (transit_gateways := _dict.get('transit_gateways')) is not None: + args['transit_gateways'] = [TransitGateway.from_dict(v) for v in transit_gateways] else: raise ValueError('Required property \'transit_gateways\' not present in TransitGatewayCollection JSON') return cls(**args) @@ -5040,18 +5042,18 @@ class TransitGatewayConnectionCollection: """ A set of Transit Gateway network connections. - :attr List[TransitGatewayConnectionCust] connections: Array of transit gateways + :param List[TransitGatewayConnectionCust] connections: Array of transit gateways network Connections. - :attr PaginationFirstTGWConnection first: A reference to the first page of + :param PaginationFirstTGWConnection first: A reference to the first page of resources. This will be returned when number of connections in response are greater than max page limit. - :attr int limit: The maximum number of connections returned on one request. This - will be returned when number of connections in response are greater than max - page limit. - :attr PaginationNextTGWConnection next: (optional) A reference to the next page + :param int limit: The maximum number of connections returned on one request. + This will be returned when number of connections in response are greater than + max page limit. + :param PaginationNextTGWConnection next: (optional) A reference to the next page of resources; this reference is included for all pages except the last page. - :attr int total_count: total number of resources across all pages (considering + :param int total_count: total number of resources across all pages (considering the supplied query parameter filters). """ @@ -5062,7 +5064,7 @@ def __init__( limit: int, total_count: int, *, - next: 'PaginationNextTGWConnection' = None, + next: Optional['PaginationNextTGWConnection'] = None, ) -> None: """ Initialize a TransitGatewayConnectionCollection object. @@ -5092,22 +5094,22 @@ def __init__( def from_dict(cls, _dict: Dict) -> 'TransitGatewayConnectionCollection': """Initialize a TransitGatewayConnectionCollection object from a json dictionary.""" args = {} - if 'connections' in _dict: - args['connections'] = [TransitGatewayConnectionCust.from_dict(v) for v in _dict.get('connections')] + if (connections := _dict.get('connections')) is not None: + args['connections'] = [TransitGatewayConnectionCust.from_dict(v) for v in connections] else: raise ValueError('Required property \'connections\' not present in TransitGatewayConnectionCollection JSON') - if 'first' in _dict: - args['first'] = PaginationFirstTGWConnection.from_dict(_dict.get('first')) + if (first := _dict.get('first')) is not None: + args['first'] = PaginationFirstTGWConnection.from_dict(first) else: raise ValueError('Required property \'first\' not present in TransitGatewayConnectionCollection JSON') - if 'limit' in _dict: - args['limit'] = _dict.get('limit') + if (limit := _dict.get('limit')) is not None: + args['limit'] = limit else: raise ValueError('Required property \'limit\' not present in TransitGatewayConnectionCollection JSON') - if 'next' in _dict: - args['next'] = PaginationNextTGWConnection.from_dict(_dict.get('next')) - if 'total_count' in _dict: - args['total_count'] = _dict.get('total_count') + if (next := _dict.get('next')) is not None: + args['next'] = PaginationNextTGWConnection.from_dict(next) + if (total_count := _dict.get('total_count')) is not None: + args['total_count'] = total_count else: raise ValueError('Required property \'total_count\' not present in TransitGatewayConnectionCollection JSON') return cls(**args) @@ -5167,44 +5169,44 @@ class TransitGatewayConnectionCust: """ Connection included in transit gateway. - :attr str base_connection_id: (optional) Deprecated: network_type `gre_tunnel` + :param str base_connection_id: (optional) Deprecated: network_type `gre_tunnel` connections use `base_connection_id` to specify the ID of a network_type `classic` connection the tunnel is configured over. The specified connection must reside in the same transit gateway and be in an active state. The `classic` connection cannot be deleted until any `gre_tunnel` connections using it are deleted. This field only applies to and is required for network type `gre_tunnel` connections. - :attr str base_network_type: (optional) The type of network the Unbound GRE + :param str base_network_type: (optional) 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`, `dynamic_route_server` and `gre_tunnel` connections. - :attr str cidr: (optional) network_type `vpn_gateway` and `dynamic_route_server` - connections use `cidr` to specify the CIDR to use for the `VPN gateway / Dynamic - route server` GRE tunnels. - :attr datetime created_at: The date and time that this connection was created. - :attr str id: The unique identifier for this Transit Gateway connection. - :attr int local_bgp_asn: (optional) Local network BGP ASN. This field only + :param str cidr: (optional) network_type `vpn_gateway` and + `dynamic_route_server` connections use `cidr` to specify the CIDR to use for the + `VPN gateway / Dynamic route server` GRE tunnels. + :param datetime created_at: The date and time that this connection was created. + :param str id: The unique identifier for this Transit Gateway connection. + :param int local_bgp_asn: (optional) Local network BGP ASN. This field only applies to network type `gre_tunnel` and `unbound_gre_tunnel` connections. - :attr str local_gateway_ip: (optional) Local gateway IP address. This field + :param str local_gateway_ip: (optional) Local gateway IP address. This field only applies to network type `gre_tunnel` and `unbound_gre_tunnel` connections. - :attr str local_tunnel_ip: (optional) Local tunnel IP address. This field only + :param str local_tunnel_ip: (optional) Local tunnel IP address. This field only applies to network type `gre_tunnel` and `unbound_gre_tunnel` connections. - :attr int mtu: (optional) GRE tunnel MTU. This field only applies to network + :param int mtu: (optional) GRE tunnel MTU. This field only applies to network type `gre_tunnel` and `unbound_gre_tunnel` connections. - :attr str name: (optional) The user-defined name for this transit gateway + :param str name: (optional) 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`, `dynamic_route_server` and `redundant_gre` connections. This field is optional for network type `classic`, `vpc` connections. - :attr str network_account_id: (optional) The ID of the account which owns the + :param str network_account_id: (optional) The ID of the account which owns the connected network. Generally only used if the network is in a different IBM Cloud account than the gateway. - :attr str network_id: (optional) The ID of the network being connected via this + :param str network_id: (optional) The ID of the network being connected via this connection. For network types `vpc`, `vpn_gateway`, `dynamic_route_server`, `power_virtual_server` and `directlink` this is the CRN of the VPC / VPN / Dynamic Route Server / PowerVS / Direct Link gateway respectively. This field is @@ -5213,34 +5215,34 @@ class TransitGatewayConnectionCust: `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. - :attr str network_type: (optional) Defines what type of network is connected via - this connection. - :attr List[TransitGatewayConnectionPrefixFilterReference] prefix_filters: + :param str network_type: (optional) Defines what type of network is connected + via this connection. + :param List[TransitGatewayConnectionPrefixFilterReference] prefix_filters: (optional) Array of prefix route filters for a transit gateway connection. This is order dependent with those first in the array being applied first, and those at the end of the array is applied last, or just before the default. This field does not apply to the `redundant_gre` network type. - :attr str prefix_filters_default: (optional) Default setting of permit or deny + :param str prefix_filters_default: (optional) Default setting of permit or deny which applies to any routes that don't match a specified filter. This field does not apply to the `redundant_gre` network type. - :attr int remote_bgp_asn: (optional) Remote network BGP ASN. This field only + :param int remote_bgp_asn: (optional) Remote network BGP ASN. This field only applies to network type `gre_tunnel` and `unbound_gre_tunnel` connections. - :attr str remote_gateway_ip: (optional) Remote gateway IP address. This field + :param str remote_gateway_ip: (optional) Remote gateway IP address. This field only applies to network type `gre_tunnel` and `unbound_gre_tunnel` connections. - :attr str remote_tunnel_ip: (optional) Remote tunnel IP address. This field + :param str remote_tunnel_ip: (optional) Remote tunnel IP address. This field only applies to network type `gre_tunnel` and `unbound_gre_tunnel` connections. - :attr str request_status: Only visible for cross account connections, this field - represents the status of a connection request between IBM Cloud accounts. The - list of enumerated values for this property may expand in the future. Code and - processes using this field must tolerate unexpected values. - :attr str status: Connection's current configuration state. The list of + :param str request_status: Only visible for cross account connections, this + field represents the status of a connection request between IBM Cloud accounts. + The list of enumerated values for this property may expand in the future. Code + and processes using this field must tolerate unexpected values. + :param str status: Connection's current configuration state. The list of enumerated values for this property may expand in the future. Code and processes using this field must tolerate unexpected values. - :attr List[TransitGatewayTunnel] tunnels: (optional) Collection of all tunnels + :param List[TransitGatewayTunnel] tunnels: (optional) Collection of all tunnels for `redundant_gre`, `vpn_gateway` and `dynamic_route_server` connections. - :attr datetime updated_at: The date and time that this connection was last + :param datetime updated_at: The date and time that this connection was last updated. - :attr ZoneReference zone: (optional) Location of GRE tunnel. This field is + :param ZoneReference zone: (optional) Location of GRE tunnel. This field is required for network type `gre_tunnel` and `unbound_gre_tunnel` connections. This field is optional for network type `vpn_gateway` connections. """ @@ -5253,24 +5255,24 @@ def __init__( status: str, updated_at: datetime, *, - base_connection_id: str = None, - base_network_type: str = None, - cidr: str = None, - local_bgp_asn: int = None, - local_gateway_ip: str = None, - local_tunnel_ip: str = None, - mtu: int = None, - name: str = None, - network_account_id: str = None, - network_id: str = None, - network_type: str = None, - prefix_filters: List['TransitGatewayConnectionPrefixFilterReference'] = None, - prefix_filters_default: str = None, - remote_bgp_asn: int = None, - remote_gateway_ip: str = None, - remote_tunnel_ip: str = None, - tunnels: List['TransitGatewayTunnel'] = None, - zone: 'ZoneReference' = None, + base_connection_id: Optional[str] = None, + base_network_type: Optional[str] = None, + cidr: Optional[str] = None, + local_bgp_asn: Optional[int] = None, + local_gateway_ip: Optional[str] = None, + local_tunnel_ip: Optional[str] = None, + mtu: Optional[int] = None, + name: Optional[str] = None, + network_account_id: Optional[str] = None, + network_id: Optional[str] = None, + network_type: Optional[str] = None, + prefix_filters: Optional[List['TransitGatewayConnectionPrefixFilterReference']] = 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['TransitGatewayTunnel']] = None, + zone: Optional['ZoneReference'] = None, ) -> None: """ Initialize a TransitGatewayConnectionCust object. @@ -5391,62 +5393,62 @@ def __init__( def from_dict(cls, _dict: Dict) -> 'TransitGatewayConnectionCust': """Initialize a TransitGatewayConnectionCust object from a json dictionary.""" args = {} - if 'base_connection_id' in _dict: - args['base_connection_id'] = _dict.get('base_connection_id') - if 'base_network_type' in _dict: - args['base_network_type'] = _dict.get('base_network_type') - if 'cidr' in _dict: - args['cidr'] = _dict.get('cidr') - if 'created_at' in _dict: - args['created_at'] = string_to_datetime(_dict.get('created_at')) + if (base_connection_id := _dict.get('base_connection_id')) is not None: + args['base_connection_id'] = base_connection_id + if (base_network_type := _dict.get('base_network_type')) is not None: + args['base_network_type'] = base_network_type + if (cidr := _dict.get('cidr')) is not None: + args['cidr'] = cidr + if (created_at := _dict.get('created_at')) is not None: + args['created_at'] = string_to_datetime(created_at) else: raise ValueError('Required property \'created_at\' not present in TransitGatewayConnectionCust JSON') - if 'id' in _dict: - args['id'] = _dict.get('id') + if (id := _dict.get('id')) is not None: + args['id'] = id else: raise ValueError('Required property \'id\' not present in TransitGatewayConnectionCust JSON') - if 'local_bgp_asn' in _dict: - args['local_bgp_asn'] = _dict.get('local_bgp_asn') - if 'local_gateway_ip' in _dict: - args['local_gateway_ip'] = _dict.get('local_gateway_ip') - if 'local_tunnel_ip' in _dict: - args['local_tunnel_ip'] = _dict.get('local_tunnel_ip') - if 'mtu' in _dict: - args['mtu'] = _dict.get('mtu') - if 'name' in _dict: - args['name'] = _dict.get('name') - if 'network_account_id' in _dict: - args['network_account_id'] = _dict.get('network_account_id') - if 'network_id' in _dict: - args['network_id'] = _dict.get('network_id') - if 'network_type' in _dict: - args['network_type'] = _dict.get('network_type') - if 'prefix_filters' in _dict: - args['prefix_filters'] = [TransitGatewayConnectionPrefixFilterReference.from_dict(v) for v in _dict.get('prefix_filters')] - if 'prefix_filters_default' in _dict: - args['prefix_filters_default'] = _dict.get('prefix_filters_default') - if 'remote_bgp_asn' in _dict: - args['remote_bgp_asn'] = _dict.get('remote_bgp_asn') - if 'remote_gateway_ip' in _dict: - args['remote_gateway_ip'] = _dict.get('remote_gateway_ip') - if 'remote_tunnel_ip' in _dict: - args['remote_tunnel_ip'] = _dict.get('remote_tunnel_ip') - if 'request_status' in _dict: - args['request_status'] = _dict.get('request_status') + if (local_bgp_asn := _dict.get('local_bgp_asn')) is not None: + args['local_bgp_asn'] = local_bgp_asn + if (local_gateway_ip := _dict.get('local_gateway_ip')) is not None: + args['local_gateway_ip'] = local_gateway_ip + if (local_tunnel_ip := _dict.get('local_tunnel_ip')) is not None: + args['local_tunnel_ip'] = local_tunnel_ip + if (mtu := _dict.get('mtu')) is not None: + args['mtu'] = mtu + if (name := _dict.get('name')) is not None: + args['name'] = name + if (network_account_id := _dict.get('network_account_id')) is not None: + args['network_account_id'] = network_account_id + if (network_id := _dict.get('network_id')) is not None: + args['network_id'] = network_id + if (network_type := _dict.get('network_type')) is not None: + args['network_type'] = network_type + if (prefix_filters := _dict.get('prefix_filters')) is not None: + args['prefix_filters'] = [TransitGatewayConnectionPrefixFilterReference.from_dict(v) for v in prefix_filters] + if (prefix_filters_default := _dict.get('prefix_filters_default')) is not None: + args['prefix_filters_default'] = prefix_filters_default + if (remote_bgp_asn := _dict.get('remote_bgp_asn')) is not None: + args['remote_bgp_asn'] = remote_bgp_asn + if (remote_gateway_ip := _dict.get('remote_gateway_ip')) is not None: + args['remote_gateway_ip'] = remote_gateway_ip + if (remote_tunnel_ip := _dict.get('remote_tunnel_ip')) is not None: + args['remote_tunnel_ip'] = remote_tunnel_ip + if (request_status := _dict.get('request_status')) is not None: + args['request_status'] = request_status else: raise ValueError('Required property \'request_status\' not present in TransitGatewayConnectionCust JSON') - if 'status' in _dict: - args['status'] = _dict.get('status') + if (status := _dict.get('status')) is not None: + args['status'] = status else: raise ValueError('Required property \'status\' not present in TransitGatewayConnectionCust JSON') - if 'tunnels' in _dict: - args['tunnels'] = [TransitGatewayTunnel.from_dict(v) for v in _dict.get('tunnels')] - if 'updated_at' in _dict: - args['updated_at'] = string_to_datetime(_dict.get('updated_at')) + if (tunnels := _dict.get('tunnels')) is not None: + args['tunnels'] = [TransitGatewayTunnel.from_dict(v) for v in tunnels] + if (updated_at := _dict.get('updated_at')) is not None: + args['updated_at'] = string_to_datetime(updated_at) else: raise ValueError('Required property \'updated_at\' not present in TransitGatewayConnectionCust JSON') - if 'zone' in _dict: - args['zone'] = ZoneReference.from_dict(_dict.get('zone')) + if (zone := _dict.get('zone')) is not None: + args['zone'] = ZoneReference.from_dict(zone) return cls(**args) @classmethod @@ -5616,10 +5618,10 @@ class TransitGatewayConnectionPrefixFilter: """ A prefix filter for a Transit Gateway connection. - :attr str action: Whether to permit or deny prefix filter. - :attr int ge: (optional) IP Prefix GE. - :attr int le: (optional) IP Prefix LE. - :attr str prefix: IP Prefix. + :param str action: Whether to permit or deny prefix filter. + :param int ge: (optional) IP Prefix GE. + :param int le: (optional) IP Prefix LE. + :param str prefix: IP Prefix. """ def __init__( @@ -5627,8 +5629,8 @@ def __init__( action: str, prefix: str, *, - ge: int = None, - le: int = None, + ge: Optional[int] = None, + le: Optional[int] = None, ) -> None: """ Initialize a TransitGatewayConnectionPrefixFilter object. @@ -5647,16 +5649,16 @@ def __init__( def from_dict(cls, _dict: Dict) -> 'TransitGatewayConnectionPrefixFilter': """Initialize a TransitGatewayConnectionPrefixFilter object from a json dictionary.""" args = {} - if 'action' in _dict: - args['action'] = _dict.get('action') + if (action := _dict.get('action')) is not None: + args['action'] = action else: raise ValueError('Required property \'action\' not present in TransitGatewayConnectionPrefixFilter JSON') - if 'ge' in _dict: - args['ge'] = _dict.get('ge') - if 'le' in _dict: - args['le'] = _dict.get('le') - if 'prefix' in _dict: - args['prefix'] = _dict.get('prefix') + if (ge := _dict.get('ge')) is not None: + args['ge'] = ge + if (le := _dict.get('le')) is not None: + args['le'] = le + if (prefix := _dict.get('prefix')) is not None: + args['prefix'] = prefix else: raise ValueError('Required property \'prefix\' not present in TransitGatewayConnectionPrefixFilter JSON') return cls(**args) @@ -5711,8 +5713,8 @@ class TransitGatewayConnectionPrefixFilterReference: """ A prefix filter reference object for a Transit Gateway connection. - :attr str action: Whether to permit or deny prefix filter. - :attr str before: (optional) Identifier of prefix filter that handles the + :param str action: Whether to permit or deny prefix filter. + :param str before: (optional) Identifier of prefix filter that handles the ordering and follow semantics: - When a filter reference another filter in it's before field, then the filter making the reference is applied before @@ -5730,13 +5732,13 @@ class TransitGatewayConnectionPrefixFilterReference: it will be applied last, but if filter D is created with an empty before field, then B's before field will be modified to point to D, so B will be applied before D. - :attr datetime created_at: The date and time that this prefix filter was + :param datetime created_at: The date and time that this prefix filter was created. - :attr int ge: (optional) IP Prefix GE. - :attr str id: Prefix Filter identifier. - :attr int le: (optional) IP Prefix LE. - :attr str prefix: IP Prefix. - :attr datetime updated_at: (optional) The date and time that this prefix filter + :param int ge: (optional) IP Prefix GE. + :param str id: Prefix Filter identifier. + :param int le: (optional) IP Prefix LE. + :param str prefix: IP Prefix. + :param datetime updated_at: (optional) The date and time that this prefix filter was last updated. """ @@ -5747,10 +5749,10 @@ def __init__( id: str, prefix: str, *, - before: str = None, - ge: int = None, - le: int = None, - updated_at: datetime = None, + before: Optional[str] = None, + ge: Optional[int] = None, + le: Optional[int] = None, + updated_at: Optional[datetime] = None, ) -> None: """ Initialize a TransitGatewayConnectionPrefixFilterReference object. @@ -5796,30 +5798,30 @@ def __init__( def from_dict(cls, _dict: Dict) -> 'TransitGatewayConnectionPrefixFilterReference': """Initialize a TransitGatewayConnectionPrefixFilterReference object from a json dictionary.""" args = {} - if 'action' in _dict: - args['action'] = _dict.get('action') + if (action := _dict.get('action')) is not None: + args['action'] = action else: raise ValueError('Required property \'action\' not present in TransitGatewayConnectionPrefixFilterReference JSON') - if 'before' in _dict: - args['before'] = _dict.get('before') - if 'created_at' in _dict: - args['created_at'] = string_to_datetime(_dict.get('created_at')) + if (before := _dict.get('before')) is not None: + args['before'] = before + if (created_at := _dict.get('created_at')) is not None: + args['created_at'] = string_to_datetime(created_at) else: raise ValueError('Required property \'created_at\' not present in TransitGatewayConnectionPrefixFilterReference JSON') - if 'ge' in _dict: - args['ge'] = _dict.get('ge') - if 'id' in _dict: - args['id'] = _dict.get('id') + if (ge := _dict.get('ge')) is not None: + args['ge'] = ge + if (id := _dict.get('id')) is not None: + args['id'] = id else: raise ValueError('Required property \'id\' not present in TransitGatewayConnectionPrefixFilterReference JSON') - if 'le' in _dict: - args['le'] = _dict.get('le') - if 'prefix' in _dict: - args['prefix'] = _dict.get('prefix') + if (le := _dict.get('le')) is not None: + args['le'] = le + if (prefix := _dict.get('prefix')) is not None: + args['prefix'] = prefix else: raise ValueError('Required property \'prefix\' not present in TransitGatewayConnectionPrefixFilterReference JSON') - if 'updated_at' in _dict: - args['updated_at'] = string_to_datetime(_dict.get('updated_at')) + if (updated_at := _dict.get('updated_at')) is not None: + args['updated_at'] = string_to_datetime(updated_at) return cls(**args) @classmethod @@ -5880,9 +5882,9 @@ class TransitGatewayReference: """ Transit gateway reference. - :attr str crn: gateway CRN. - :attr str id: gateway ID. - :attr str name: transit gateway name. + :param str crn: gateway CRN. + :param str id: gateway ID. + :param str name: transit gateway name. """ def __init__( @@ -5906,16 +5908,16 @@ def __init__( def from_dict(cls, _dict: Dict) -> 'TransitGatewayReference': """Initialize a TransitGatewayReference object from a json dictionary.""" args = {} - if 'crn' in _dict: - args['crn'] = _dict.get('crn') + if (crn := _dict.get('crn')) is not None: + args['crn'] = crn else: raise ValueError('Required property \'crn\' not present in TransitGatewayReference JSON') - if 'id' in _dict: - args['id'] = _dict.get('id') + if (id := _dict.get('id')) is not None: + args['id'] = id else: raise ValueError('Required property \'id\' not present in TransitGatewayReference JSON') - if 'name' in _dict: - args['name'] = _dict.get('name') + if (name := _dict.get('name')) is not None: + args['name'] = name else: raise ValueError('Required property \'name\' not present in TransitGatewayReference JSON') return cls(**args) @@ -5959,36 +5961,36 @@ class TransitGatewayTunnel: """ Details for a redundant GRE tunnel. - :attr str base_network_type: The type of network the redundant GRE tunnel is + :param str base_network_type: The type of network the redundant GRE tunnel is targeting. - :attr datetime created_at: The date and time that this GRE tunnel was created. - :attr str id: The unique identifier for this redundant GRE tunnel. - :attr int local_bgp_asn: Local network BGP ASN. It is assigned by IBM when the + :param datetime created_at: The date and time that this GRE tunnel was created. + :param str id: The unique identifier for this redundant GRE tunnel. + :param int local_bgp_asn: Local network BGP ASN. It is assigned by IBM when the tunnel is created. - :attr str local_gateway_ip: Local gateway IP address. - :attr str local_tunnel_ip: Local tunnel IP address. The local_tunnel_ip and + :param str local_gateway_ip: Local gateway IP address. + :param str local_tunnel_ip: 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. - :attr int mtu: (optional) GRE tunnel MTU. - :attr str name: The user-defined name for this tunnel. - :attr str network_account_id: (optional) The ID of the account for cross account - Classic connections. This field is required when the GRE tunnel is in a + :param int mtu: (optional) GRE tunnel MTU. + :param str name: The user-defined name for this tunnel. + :param str network_account_id: (optional) The ID of the account for cross + account Classic connections. This field is required when the GRE tunnel is in a different account than the gateway and the base network is Classic. - :attr str network_id: (optional) The ID of the network VPC being connected via + :param str network_id: (optional) The ID of the network VPC being connected via this connection. - :attr int remote_bgp_asn: Remote network BGP ASN. The following ASN values are + :param int remote_bgp_asn: 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 create requests, IBM will assign an ASN. - :attr str remote_gateway_ip: Remote gateway IP address. - :attr str remote_tunnel_ip: Remote tunnel IP address. The local_tunnel_ip and + :param str remote_gateway_ip: Remote gateway IP address. + :param str remote_tunnel_ip: 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. - :attr str status: Tunnel's current configuration state. The list of enumerated + :param str status: Tunnel's current configuration state. The list of enumerated values for this property may expand in the future. Code and processes using this field must tolerate unexpected values. - :attr datetime updated_at: The date and time that this tunnel was last updated. - :attr ZoneReference zone: Availability zone reference. + :param datetime updated_at: The date and time that this tunnel was last updated. + :param ZoneReference zone: Availability zone reference. """ def __init__( @@ -6007,9 +6009,9 @@ def __init__( updated_at: datetime, zone: 'ZoneReference', *, - mtu: int = None, - network_account_id: str = None, - network_id: str = None, + mtu: Optional[int] = None, + network_account_id: Optional[str] = None, + network_id: Optional[str] = None, ) -> None: """ Initialize a TransitGatewayTunnel object. @@ -6069,62 +6071,62 @@ def __init__( def from_dict(cls, _dict: Dict) -> 'TransitGatewayTunnel': """Initialize a TransitGatewayTunnel object from a json dictionary.""" args = {} - if 'base_network_type' in _dict: - args['base_network_type'] = _dict.get('base_network_type') + if (base_network_type := _dict.get('base_network_type')) is not None: + args['base_network_type'] = base_network_type else: raise ValueError('Required property \'base_network_type\' not present in TransitGatewayTunnel JSON') - if 'created_at' in _dict: - args['created_at'] = string_to_datetime(_dict.get('created_at')) + if (created_at := _dict.get('created_at')) is not None: + args['created_at'] = string_to_datetime(created_at) else: raise ValueError('Required property \'created_at\' not present in TransitGatewayTunnel JSON') - if 'id' in _dict: - args['id'] = _dict.get('id') + if (id := _dict.get('id')) is not None: + args['id'] = id else: raise ValueError('Required property \'id\' not present in TransitGatewayTunnel JSON') - if 'local_bgp_asn' in _dict: - args['local_bgp_asn'] = _dict.get('local_bgp_asn') + if (local_bgp_asn := _dict.get('local_bgp_asn')) is not None: + args['local_bgp_asn'] = local_bgp_asn else: raise ValueError('Required property \'local_bgp_asn\' not present in TransitGatewayTunnel JSON') - if 'local_gateway_ip' in _dict: - args['local_gateway_ip'] = _dict.get('local_gateway_ip') + if (local_gateway_ip := _dict.get('local_gateway_ip')) is not None: + args['local_gateway_ip'] = local_gateway_ip else: raise ValueError('Required property \'local_gateway_ip\' not present in TransitGatewayTunnel JSON') - if 'local_tunnel_ip' in _dict: - args['local_tunnel_ip'] = _dict.get('local_tunnel_ip') + if (local_tunnel_ip := _dict.get('local_tunnel_ip')) is not None: + args['local_tunnel_ip'] = local_tunnel_ip else: raise ValueError('Required property \'local_tunnel_ip\' not present in TransitGatewayTunnel JSON') - if 'mtu' in _dict: - args['mtu'] = _dict.get('mtu') - if 'name' in _dict: - args['name'] = _dict.get('name') + if (mtu := _dict.get('mtu')) is not None: + args['mtu'] = mtu + if (name := _dict.get('name')) is not None: + args['name'] = name else: raise ValueError('Required property \'name\' not present in TransitGatewayTunnel JSON') - if 'network_account_id' in _dict: - args['network_account_id'] = _dict.get('network_account_id') - if 'network_id' in _dict: - args['network_id'] = _dict.get('network_id') - if 'remote_bgp_asn' in _dict: - args['remote_bgp_asn'] = _dict.get('remote_bgp_asn') + if (network_account_id := _dict.get('network_account_id')) is not None: + args['network_account_id'] = network_account_id + if (network_id := _dict.get('network_id')) is not None: + args['network_id'] = network_id + if (remote_bgp_asn := _dict.get('remote_bgp_asn')) is not None: + args['remote_bgp_asn'] = remote_bgp_asn else: raise ValueError('Required property \'remote_bgp_asn\' not present in TransitGatewayTunnel JSON') - if 'remote_gateway_ip' in _dict: - args['remote_gateway_ip'] = _dict.get('remote_gateway_ip') + if (remote_gateway_ip := _dict.get('remote_gateway_ip')) is not None: + args['remote_gateway_ip'] = remote_gateway_ip else: raise ValueError('Required property \'remote_gateway_ip\' not present in TransitGatewayTunnel JSON') - if 'remote_tunnel_ip' in _dict: - args['remote_tunnel_ip'] = _dict.get('remote_tunnel_ip') + if (remote_tunnel_ip := _dict.get('remote_tunnel_ip')) is not None: + args['remote_tunnel_ip'] = remote_tunnel_ip else: raise ValueError('Required property \'remote_tunnel_ip\' not present in TransitGatewayTunnel JSON') - if 'status' in _dict: - args['status'] = _dict.get('status') + if (status := _dict.get('status')) is not None: + args['status'] = status else: raise ValueError('Required property \'status\' not present in TransitGatewayTunnel JSON') - if 'updated_at' in _dict: - args['updated_at'] = string_to_datetime(_dict.get('updated_at')) + if (updated_at := _dict.get('updated_at')) is not None: + args['updated_at'] = string_to_datetime(updated_at) else: raise ValueError('Required property \'updated_at\' not present in TransitGatewayTunnel JSON') - if 'zone' in _dict: - args['zone'] = ZoneReference.from_dict(_dict.get('zone')) + if (zone := _dict.get('zone')) is not None: + args['zone'] = ZoneReference.from_dict(zone) else: raise ValueError('Required property \'zone\' not present in TransitGatewayTunnel JSON') return cls(**args) @@ -6224,7 +6226,7 @@ class TransitGatewayTunnelCollection: Collection of all tunnels for `redundant_gre`, `vpn_gateway` and `dynamic_route_server` connections. - :attr List[TransitGatewayTunnel] tunnels: Collection of all tunnels for + :param List[TransitGatewayTunnel] tunnels: Collection of all tunnels for `redundant_gre`, `vpn_gateway` and `dynamic_route_server` connections. """ @@ -6244,8 +6246,8 @@ def __init__( def from_dict(cls, _dict: Dict) -> 'TransitGatewayTunnelCollection': """Initialize a TransitGatewayTunnelCollection object from a json dictionary.""" args = {} - if 'tunnels' in _dict: - args['tunnels'] = [TransitGatewayTunnel.from_dict(v) for v in _dict.get('tunnels')] + if (tunnels := _dict.get('tunnels')) is not None: + args['tunnels'] = [TransitGatewayTunnel.from_dict(v) for v in tunnels] else: raise ValueError('Required property \'tunnels\' not present in TransitGatewayTunnelCollection JSON') return cls(**args) @@ -6291,13 +6293,13 @@ class TransitGatewayTunnelPatch: """ An update template for a Transit Gateway connection tunnel. - :attr str name: (optional) The user-defined name for this connection tunnel. + :param str name: (optional) The user-defined name for this connection tunnel. """ def __init__( self, *, - name: str = None, + name: Optional[str] = None, ) -> None: """ Initialize a TransitGatewayTunnelPatch object. @@ -6311,8 +6313,8 @@ def __init__( def from_dict(cls, _dict: Dict) -> 'TransitGatewayTunnelPatch': """Initialize a TransitGatewayTunnelPatch object from a json dictionary.""" args = {} - if 'name' in _dict: - args['name'] = _dict.get('name') + if (name := _dict.get('name')) is not None: + args['name'] = name return cls(**args) @classmethod @@ -6350,21 +6352,21 @@ class TransitGatewayTunnelTemplate: """ A create template with information for redundant GRE tunnel. - :attr str local_gateway_ip: Local gateway IP address. - :attr str local_tunnel_ip: Local tunnel IP address. The local_tunnel_ip and + :param str local_gateway_ip: Local gateway IP address. + :param str local_tunnel_ip: 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. - :attr str name: The user-defined name for this tunnel connection. - :attr int remote_bgp_asn: (optional) Remote network BGP ASN. The following ASN + :param str name: The user-defined name for this tunnel connection. + :param int remote_bgp_asn: (optional) 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 create requests, IBM will assign an ASN. - :attr str remote_gateway_ip: Remote gateway IP address. - :attr str remote_tunnel_ip: Remote tunnel IP address. The local_tunnel_ip and + :param str remote_gateway_ip: Remote gateway IP address. + :param str remote_tunnel_ip: 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. - :attr ZoneIdentity zone: Specify the connection's location. The specified + :param ZoneIdentity zone: Specify the connection's location. The specified availability zone must reside in the gateway's region. Use the IBM Cloud global catalog to list zones within the desired region. """ @@ -6378,7 +6380,7 @@ def __init__( remote_tunnel_ip: str, zone: 'ZoneIdentity', *, - remote_bgp_asn: int = None, + remote_bgp_asn: Optional[int] = None, ) -> None: """ Initialize a TransitGatewayTunnelTemplate object. @@ -6413,30 +6415,30 @@ def __init__( def from_dict(cls, _dict: Dict) -> 'TransitGatewayTunnelTemplate': """Initialize a TransitGatewayTunnelTemplate object from a json dictionary.""" args = {} - if 'local_gateway_ip' in _dict: - args['local_gateway_ip'] = _dict.get('local_gateway_ip') + if (local_gateway_ip := _dict.get('local_gateway_ip')) is not None: + args['local_gateway_ip'] = local_gateway_ip else: raise ValueError('Required property \'local_gateway_ip\' not present in TransitGatewayTunnelTemplate JSON') - if 'local_tunnel_ip' in _dict: - args['local_tunnel_ip'] = _dict.get('local_tunnel_ip') + if (local_tunnel_ip := _dict.get('local_tunnel_ip')) is not None: + args['local_tunnel_ip'] = local_tunnel_ip else: raise ValueError('Required property \'local_tunnel_ip\' not present in TransitGatewayTunnelTemplate JSON') - if 'name' in _dict: - args['name'] = _dict.get('name') + if (name := _dict.get('name')) is not None: + args['name'] = name else: raise ValueError('Required property \'name\' not present in TransitGatewayTunnelTemplate JSON') - if 'remote_bgp_asn' in _dict: - args['remote_bgp_asn'] = _dict.get('remote_bgp_asn') - if 'remote_gateway_ip' in _dict: - args['remote_gateway_ip'] = _dict.get('remote_gateway_ip') + if (remote_bgp_asn := _dict.get('remote_bgp_asn')) is not None: + args['remote_bgp_asn'] = remote_bgp_asn + if (remote_gateway_ip := _dict.get('remote_gateway_ip')) is not None: + args['remote_gateway_ip'] = remote_gateway_ip else: raise ValueError('Required property \'remote_gateway_ip\' not present in TransitGatewayTunnelTemplate JSON') - if 'remote_tunnel_ip' in _dict: - args['remote_tunnel_ip'] = _dict.get('remote_tunnel_ip') + if (remote_tunnel_ip := _dict.get('remote_tunnel_ip')) is not None: + args['remote_tunnel_ip'] = remote_tunnel_ip else: raise ValueError('Required property \'remote_tunnel_ip\' not present in TransitGatewayTunnelTemplate JSON') - if 'zone' in _dict: - args['zone'] = _dict.get('zone') + if (zone := _dict.get('zone')) is not None: + args['zone'] = zone else: raise ValueError('Required property \'zone\' not present in TransitGatewayTunnelTemplate JSON') return cls(**args) @@ -6510,7 +6512,7 @@ class ZoneReference: """ Availability zone reference. - :attr str name: Availability zone name. + :param str name: Availability zone name. """ def __init__( @@ -6528,8 +6530,8 @@ def __init__( def from_dict(cls, _dict: Dict) -> 'ZoneReference': """Initialize a ZoneReference object from a json dictionary.""" args = {} - if 'name' in _dict: - args['name'] = _dict.get('name') + if (name := _dict.get('name')) is not None: + args['name'] = name else: raise ValueError('Required property \'name\' not present in ZoneReference JSON') return cls(**args) @@ -6569,13 +6571,13 @@ class ZoneIdentityByName(ZoneIdentity): """ Availability zone. - :attr str name: (optional) Availability zone name. + :param str name: (optional) Availability zone name. """ def __init__( self, *, - name: str = None, + name: Optional[str] = None, ) -> None: """ Initialize a ZoneIdentityByName object. @@ -6589,8 +6591,8 @@ def __init__( def from_dict(cls, _dict: Dict) -> 'ZoneIdentityByName': """Initialize a ZoneIdentityByName object from a json dictionary.""" args = {} - if 'name' in _dict: - args['name'] = _dict.get('name') + if (name := _dict.get('name')) is not None: + args['name'] = name return cls(**args) @classmethod diff --git a/test/unit/test_transit_gateway_apis_v1.py b/test/unit/test_transit_gateway_apis_v1.py index 6206f97..af0f12f 100644 --- a/test/unit/test_transit_gateway_apis_v1.py +++ b/test/unit/test_transit_gateway_apis_v1.py @@ -48,23 +48,15 @@ def preprocess_url(operation_path: str): The returned request URL is used to register the mock response so it needs to match the request URL that is formed by the requests library. """ - # First, unquote the path since it might have some quoted/escaped characters in it - # due to how the generator inserts the operation paths into the unit test code. - operation_path = urllib.parse.unquote(operation_path) - # Next, quote the path using urllib so that we approximate what will - # happen during request processing. - operation_path = urllib.parse.quote(operation_path, safe='/') - - # Finally, form the request URL from the base URL and operation path. + # Form the request URL from the base URL and operation path. request_url = _base_url + operation_path # If the request url does NOT end with a /, then just return it as-is. # Otherwise, return a regular expression that matches one or more trailing /. - if re.fullmatch('.*/+', request_url) is None: + if not request_url.endswith('/'): return request_url - else: - return re.compile(request_url.rstrip('/') + '/+') + return re.compile(request_url.rstrip('/') + '/+') ############################################################################## From 5fdd9b00ce30afb512548848c59635327c57b35c Mon Sep 17 00:00:00 2001 From: Joseph Kalandarishvili Date: Thu, 13 Aug 2026 15:04:35 -0500 Subject: [PATCH 3/4] feat: Added Redundant Global TGW related changes dependency: none Signed-off-by: Joseph Kalandarishvili --- .../transit_gateway_apis_v1.py | 173 ++++++++---------- 1 file changed, 81 insertions(+), 92 deletions(-) diff --git a/ibm_cloud_networking_services/transit_gateway_apis_v1.py b/ibm_cloud_networking_services/transit_gateway_apis_v1.py index 4e02102..95eb479 100644 --- a/ibm_cloud_networking_services/transit_gateway_apis_v1.py +++ b/ibm_cloud_networking_services/transit_gateway_apis_v1.py @@ -615,36 +615,35 @@ def create_transit_gateway_connection( `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`, - `dynamic_route_server` and `gre_tunnel` connections. - :param str cidr: (optional) network_type `vpn_gateway` and - `dynamic_route_server`connections use `cidr` to specify the CIDR to use for - the VPN gateway / Dynamic route server GRE tunnels. - This field is optional for network type `vpn_gateway` and - `dynamic_route_server` connections. If unspecified, the default value is - 198.19.174.0/23. + `directlink`, `vpc`, `power_virtual_server`, `vpn_gateway` and `gre_tunnel` + connections. + :param str cidr: (optional) network_type `vpn_gateway` connections use + `cidr` to specify the CIDR to use for the VPN gateway / Dynamic route + server GRE tunnels. + This field is optional for network type `vpn_gateway` connections. If + unspecified, the default value is 198.19.174.0/23. 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. :param str local_gateway_ip: (optional) 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`, - `dynamic_route_server` and `redundant_gre` connections. + `classic`, `directlink`, `vpc`, `power_virtual_server`, `vpn_gateway` and + `redundant_gre` connections. :param str local_tunnel_ip: (optional) 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`, - `dynamic_route_server` and `redundant_gre` connections. + `directlink`, `vpc`, `power_virtual_server`, `vpn_gateway` and + `redundant_gre` connections. :param str name: (optional) 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`, - `dynamic_route_server` and `redundant_gre` connections. + `directlink`, `gre_tunnel`, `unbound_gre_tunnel`, `vpn_gateway` and + `redundant_gre` connections. This field is optional for network type `classic`, `vpc` connections. :param str network_account_id: (optional) The ID of the account which owns the network that is being connected. Generally only used if the network is @@ -654,14 +653,13 @@ def create_transit_gateway_connection( account than the gateway. :param str network_id: (optional) The ID of the network being connected via this connection. For network types `vpc`, `vpn_gateway`, - `dynamic_route_server`, `power_virtual_server` and `directlink` this is the - CRN of the VPC / VPN / Dynamic Route Server / PowerVS / Direct Link gateway - respectively. This field is required for network type `vpc`, - `power_virtual_server`, `vpn_gateway`, `dynamic_route_server` 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. + `power_virtual_server` and `directlink` this is the CRN of the VPC / VPN / + Dynamic Route Server / PowerVS / Direct Link 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. :param List[TransitGatewayConnectionPrefixFilter] prefix_filters: (optional) Array of prefix route filters for a transit gateway connection. Prefix filters can be specified for netowrk type `vpc`, `classic`, @@ -671,14 +669,14 @@ def create_transit_gateway_connection( 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`, `dynamic_route_server` - and `redundant_gre` connections. + `gre_tunnel`, `unbound_gre_tunnel`, `vpn_gateway` and `redundant_gre` + connections. :param str prefix_filters_default: (optional) 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`, `dynamic_route_server` and `redundant_gre` connections. + `vpn_gateway` and `redundant_gre` connections. :param int remote_bgp_asn: (optional) 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 @@ -687,21 +685,21 @@ def create_transit_gateway_connection( 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`, - `dynamic_route_server` and `gre_tunnel` connections. + `directlink`, `vpc`, `power_virtual_server`, `vpn_gateway` and `gre_tunnel` + connections. :param str remote_gateway_ip: (optional) 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`, - `dynamic_route_server` and `redundant_gre` connections. + `classic`, `directlink`, `vpc`, `power_virtual_server`, `vpn_gateway` and + `redundant_gre` connections. :param str remote_tunnel_ip: (optional) 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`, - `dynamic_route_server` and `redundant_gre` connections. + `directlink`, `vpc`, `power_virtual_server`, `vpn_gateway` and + `redundant_gre` connections. :param List[TransitGatewayTunnelTemplate] tunnels: (optional) Array of GRE tunnels for a transit gateway `redundant_gre` connections. This field is required for `redundant_gre` connections. @@ -712,8 +710,8 @@ def create_transit_gateway_connection( `unbound_gre_tunnel` connections. This field is optional for network type `vpn_gateway` connections. This field is required to be unspecified for network type `classic`, - `directlink`, `vpc`, `power_virtual_server`, `redundant_gre` and - `dynamic_route_server` connections. + `directlink`, `vpc`, `power_virtual_server` and `redundant_gre` + connections. :param dict headers: A `dict` containing the request headers :return: A `DetailedResponse` containing the result, headers and HTTP status code. :rtype: DetailedResponse with `dict` result representing a `TransitGatewayConnectionCust` object @@ -4177,10 +4175,10 @@ class TransitConnection: :param str name: The user-defined name for this transit gateway connection. :param str network_id: (optional) The ID of the network being connected via this connection. This field is required for some types, such as `vpc`, - `power_virtual_server`, `directlink`, `vpn_gateway`, `dynamic_route_server` and - `redundant_gre`. For network types `vpc`, `vpn_gateway`, `dynamic_route_server`, - `power_virtual_server` and `directlink` this is the CRN of the VPC / VPN / - Dynamic Route Server / PowerVS / Direct Link gateway respectively. + `power_virtual_server`, `directlink`, `vpn_gateway` and `redundant_gre`. For + network types `vpc`, `vpn_gateway`, `power_virtual_server` and `directlink` this + is the CRN of the VPC / VPN / Dynamic Route Server / PowerVS / Direct Link + gateway respectively. :param str network_type: Defines what type of network is connected via this connection. The list of enumerated values for this property may expand in the future. Code and processes using this field must tolerate unexpected values. @@ -4192,9 +4190,9 @@ class TransitConnection: connection cannot be deleted until any `gre_tunnel` connections using it are deleted. This field only applies to and is required for network type `gre_tunnel` connections. - :param str cidr: (optional) network_type `vpn_gateway` and - `dynamic_route_server` connections use `cidr` to specify the CIDR to use for the - `VPN gateway / Dynamic route server` GRE tunnels. + :param str cidr: (optional) network_type `vpn_gateway` connections use `cidr` to + specify the CIDR to use for the `VPN gateway / Dynamic route server` GRE + tunnels. :param datetime created_at: The date and time that this connection was created. :param int local_bgp_asn: (optional) Local network BGP ASN. This field only applies to network type `gre_tunnel` and `unbound_gre_tunnel` connections. @@ -4230,7 +4228,7 @@ class TransitConnection: using this field must tolerate unexpected values. :param TransitGatewayReference transit_gateway: Transit gateway reference. :param List[TransitGatewayTunnel] tunnels: (optional) Collection of all tunnels - for `redundant_gre`, `vpn_gateway` and `dynamic_route_server` connections. + for `redundant_gre` and `vpn_gateway` connections. :param datetime updated_at: The date and time that this connection was last updated. :param ZoneReference zone: (optional) Availability zone reference. @@ -4290,11 +4288,10 @@ def __init__( is targeting. :param str network_id: (optional) The ID of the network being connected via this connection. This field is required for some types, such as `vpc`, - `power_virtual_server`, `directlink`, `vpn_gateway`, `dynamic_route_server` - and `redundant_gre`. For network types `vpc`, `vpn_gateway`, - `dynamic_route_server`, `power_virtual_server` and `directlink` this is the - CRN of the VPC / VPN / Dynamic Route Server / PowerVS / Direct Link gateway - respectively. + `power_virtual_server`, `directlink`, `vpn_gateway` and `redundant_gre`. + For network types `vpc`, `vpn_gateway`, `power_virtual_server` and + `directlink` this is the CRN of the VPC / VPN / Dynamic Route Server / + PowerVS / Direct Link gateway respectively. :param str base_connection_id: (optional) Deprecated: network_type `gre_tunnel` connections use `base_connection_id` to specify the ID of a network_type `classic` connection the tunnel is configured over. The @@ -4302,9 +4299,9 @@ def __init__( active state. The `classic` connection cannot be deleted until any `gre_tunnel` connections using it are deleted. This field only applies to and is required for network type `gre_tunnel` connections. - :param str cidr: (optional) network_type `vpn_gateway` and - `dynamic_route_server` connections use `cidr` to specify the CIDR to use - for the `VPN gateway / Dynamic route server` GRE tunnels. + :param str cidr: (optional) network_type `vpn_gateway` connections use + `cidr` to specify the CIDR to use for the `VPN gateway / Dynamic route + server` GRE tunnels. :param int local_bgp_asn: (optional) Local network BGP ASN. This field only applies to network type `gre_tunnel` and `unbound_gre_tunnel` connections. @@ -4338,8 +4335,7 @@ def __init__( field only applies to network type `gre_tunnel` and `unbound_gre_tunnel` connections. :param List[TransitGatewayTunnel] tunnels: (optional) Collection of all - tunnels for `redundant_gre`, `vpn_gateway` and `dynamic_route_server` - connections. + tunnels for `redundant_gre` and `vpn_gateway` connections. :param ZoneReference zone: (optional) Availability zone reference. """ self.base_network_type = base_network_type @@ -4555,7 +4551,6 @@ class NetworkTypeEnum(str, Enum): POWER_VIRTUAL_SERVER = 'power_virtual_server' REDUNDANT_GRE = 'redundant_gre' VPN_GATEWAY = 'vpn_gateway' - DYNAMIC_ROUTE_SERVER = 'dynamic_route_server' class PrefixFiltersDefaultEnum(str, Enum): @@ -5181,11 +5176,10 @@ class TransitGatewayConnectionCust: `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`, `dynamic_route_server` and `gre_tunnel` - connections. - :param str cidr: (optional) network_type `vpn_gateway` and - `dynamic_route_server` connections use `cidr` to specify the CIDR to use for the - `VPN gateway / Dynamic route server` GRE tunnels. + `power_virtual_server`, `vpn_gateway` and `gre_tunnel` connections. + :param str cidr: (optional) network_type `vpn_gateway` connections use `cidr` to + specify the CIDR to use for the `VPN gateway / Dynamic route server` GRE + tunnels. :param datetime created_at: The date and time that this connection was created. :param str id: The unique identifier for this Transit Gateway connection. :param int local_bgp_asn: (optional) Local network BGP ASN. This field only @@ -5200,21 +5194,20 @@ class TransitGatewayConnectionCust: 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`, `dynamic_route_server` and - `redundant_gre` connections. + `gre_tunnel`, `unbound_gre_tunnel`, `vpn_gateway` and `redundant_gre` + connections. This field is optional for network type `classic`, `vpc` connections. :param str network_account_id: (optional) The ID of the account which owns the connected network. Generally only used if the network is in a different IBM Cloud account than the gateway. :param str network_id: (optional) The ID of the network being connected via this - connection. For network types `vpc`, `vpn_gateway`, `dynamic_route_server`, - `power_virtual_server` and `directlink` this is the CRN of the VPC / VPN / - Dynamic Route Server / PowerVS / Direct Link gateway respectively. This field is - required for network type `vpc`, `power_virtual_server`, `vpn_gateway`, - `dynamic_route_server` 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. + connection. For network types `vpc`, `vpn_gateway`, `power_virtual_server` and + `directlink` this is the CRN of the VPC / VPN / Dynamic Route Server / PowerVS / + Direct Link 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. :param str network_type: (optional) Defines what type of network is connected via this connection. :param List[TransitGatewayConnectionPrefixFilterReference] prefix_filters: @@ -5239,7 +5232,7 @@ class TransitGatewayConnectionCust: enumerated values for this property may expand in the future. Code and processes using this field must tolerate unexpected values. :param List[TransitGatewayTunnel] tunnels: (optional) Collection of all tunnels - for `redundant_gre`, `vpn_gateway` and `dynamic_route_server` connections. + for `redundant_gre` and `vpn_gateway` connections. :param datetime updated_at: The date and time that this connection was last updated. :param ZoneReference zone: (optional) Location of GRE tunnel. This field is @@ -5302,11 +5295,11 @@ def __init__( `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`, - `dynamic_route_server` and `gre_tunnel` connections. - :param str cidr: (optional) network_type `vpn_gateway` and - `dynamic_route_server` connections use `cidr` to specify the CIDR to use - for the `VPN gateway / Dynamic route server` GRE tunnels. + `directlink`, `vpc`, `power_virtual_server`, `vpn_gateway` and `gre_tunnel` + connections. + :param str cidr: (optional) network_type `vpn_gateway` connections use + `cidr` to specify the CIDR to use for the `VPN gateway / Dynamic route + server` GRE tunnels. :param int local_bgp_asn: (optional) Local network BGP ASN. This field only applies to network type `gre_tunnel` and `unbound_gre_tunnel` connections. @@ -5322,22 +5315,21 @@ def __init__( 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`, - `dynamic_route_server` and `redundant_gre` connections. + `directlink`, `gre_tunnel`, `unbound_gre_tunnel`, `vpn_gateway` and + `redundant_gre` connections. This field is optional for network type `classic`, `vpc` connections. :param str network_account_id: (optional) The ID of the account which owns the connected network. Generally only used if the network is in a different IBM Cloud account than the gateway. :param str network_id: (optional) The ID of the network being connected via this connection. For network types `vpc`, `vpn_gateway`, - `dynamic_route_server`, `power_virtual_server` and `directlink` this is the - CRN of the VPC / VPN / Dynamic Route Server / PowerVS / Direct Link gateway - respectively. This field is required for network type `vpc`, - `power_virtual_server`, `vpn_gateway`, `dynamic_route_server` 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. + `power_virtual_server` and `directlink` this is the CRN of the VPC / VPN / + Dynamic Route Server / PowerVS / Direct Link 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. :param str network_type: (optional) Defines what type of network is connected via this connection. :param List[TransitGatewayConnectionPrefixFilterReference] prefix_filters: @@ -5358,8 +5350,7 @@ def __init__( field only applies to network type `gre_tunnel` and `unbound_gre_tunnel` connections. :param List[TransitGatewayTunnel] tunnels: (optional) Collection of all - tunnels for `redundant_gre`, `vpn_gateway` and `dynamic_route_server` - connections. + tunnels for `redundant_gre` and `vpn_gateway` connections. :param ZoneReference zone: (optional) Location of GRE tunnel. This field is required for network type `gre_tunnel` and `unbound_gre_tunnel` connections. @@ -5546,8 +5537,8 @@ class BaseNetworkTypeEnum(str, Enum): 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`, `dynamic_route_server` - and `gre_tunnel` connections. + `directlink`, `vpc`, `power_virtual_server`, `vpn_gateway` and `gre_tunnel` + connections. """ CLASSIC = 'classic' @@ -5567,7 +5558,6 @@ class NetworkTypeEnum(str, Enum): POWER_VIRTUAL_SERVER = 'power_virtual_server' REDUNDANT_GRE = 'redundant_gre' VPN_GATEWAY = 'vpn_gateway' - DYNAMIC_ROUTE_SERVER = 'dynamic_route_server' class PrefixFiltersDefaultEnum(str, Enum): @@ -6223,11 +6213,10 @@ class StatusEnum(str, Enum): class TransitGatewayTunnelCollection: """ - Collection of all tunnels for `redundant_gre`, `vpn_gateway` and - `dynamic_route_server` connections. + Collection of all tunnels for `redundant_gre` and `vpn_gateway` connections. :param List[TransitGatewayTunnel] tunnels: Collection of all tunnels for - `redundant_gre`, `vpn_gateway` and `dynamic_route_server` connections. + `redundant_gre` and `vpn_gateway` connections. """ def __init__( @@ -6238,7 +6227,7 @@ def __init__( Initialize a TransitGatewayTunnelCollection object. :param List[TransitGatewayTunnel] tunnels: Collection of all tunnels for - `redundant_gre`, `vpn_gateway` and `dynamic_route_server` connections. + `redundant_gre` and `vpn_gateway` connections. """ self.tunnels = tunnels From 08bff352ab5f201d09bff79a26f85e7bde0f8b6e Mon Sep 17 00:00:00 2001 From: Joseph Kalandarishvili Date: Thu, 13 Aug 2026 15:27:01 -0500 Subject: [PATCH 4/4] feat: Added Redundant Global TGW related changes dependency: none Signed-off-by: Joseph Kalandarishvili --- .../transit_gateway_apis_v1.py | 50 ++++++++----------- 1 file changed, 22 insertions(+), 28 deletions(-) diff --git a/ibm_cloud_networking_services/transit_gateway_apis_v1.py b/ibm_cloud_networking_services/transit_gateway_apis_v1.py index 95eb479..565deb3 100644 --- a/ibm_cloud_networking_services/transit_gateway_apis_v1.py +++ b/ibm_cloud_networking_services/transit_gateway_apis_v1.py @@ -618,8 +618,7 @@ def create_transit_gateway_connection( `directlink`, `vpc`, `power_virtual_server`, `vpn_gateway` and `gre_tunnel` connections. :param str cidr: (optional) network_type `vpn_gateway` connections use - `cidr` to specify the CIDR to use for the VPN gateway / Dynamic route - server GRE tunnels. + `cidr` to specify the CIDR to use for the VPN gateway GRE tunnels. This field is optional for network type `vpn_gateway` connections. If unspecified, the default value is 198.19.174.0/23. This field is required to be unspecified for network type `classic`, @@ -654,12 +653,12 @@ def create_transit_gateway_connection( :param str network_id: (optional) The ID of the network being connected via this connection. For network types `vpc`, `vpn_gateway`, `power_virtual_server` and `directlink` this is the CRN of the VPC / VPN / - Dynamic Route Server / PowerVS / Direct Link 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. + PowerVS / Direct Link 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. :param List[TransitGatewayConnectionPrefixFilter] prefix_filters: (optional) Array of prefix route filters for a transit gateway connection. Prefix filters can be specified for netowrk type `vpc`, `classic`, @@ -4177,8 +4176,7 @@ class TransitConnection: connection. This field is required for some types, such as `vpc`, `power_virtual_server`, `directlink`, `vpn_gateway` and `redundant_gre`. For network types `vpc`, `vpn_gateway`, `power_virtual_server` and `directlink` this - is the CRN of the VPC / VPN / Dynamic Route Server / PowerVS / Direct Link - gateway respectively. + is the CRN of the VPC / VPN / PowerVS / Direct Link gateway respectively. :param str network_type: Defines what type of network is connected via this connection. The list of enumerated values for this property may expand in the future. Code and processes using this field must tolerate unexpected values. @@ -4191,8 +4189,7 @@ class TransitConnection: deleted. This field only applies to and is required for network type `gre_tunnel` connections. :param str cidr: (optional) network_type `vpn_gateway` connections use `cidr` to - specify the CIDR to use for the `VPN gateway / Dynamic route server` GRE - tunnels. + specify the CIDR to use for the `VPN gateway` GRE tunnels. :param datetime created_at: The date and time that this connection was created. :param int local_bgp_asn: (optional) Local network BGP ASN. This field only applies to network type `gre_tunnel` and `unbound_gre_tunnel` connections. @@ -4290,8 +4287,8 @@ def __init__( this connection. This field is required for some types, such as `vpc`, `power_virtual_server`, `directlink`, `vpn_gateway` and `redundant_gre`. For network types `vpc`, `vpn_gateway`, `power_virtual_server` and - `directlink` this is the CRN of the VPC / VPN / Dynamic Route Server / - PowerVS / Direct Link gateway respectively. + `directlink` this is the CRN of the VPC / VPN / PowerVS / Direct Link + gateway respectively. :param str base_connection_id: (optional) Deprecated: network_type `gre_tunnel` connections use `base_connection_id` to specify the ID of a network_type `classic` connection the tunnel is configured over. The @@ -4300,8 +4297,7 @@ def __init__( `gre_tunnel` connections using it are deleted. This field only applies to and is required for network type `gre_tunnel` connections. :param str cidr: (optional) network_type `vpn_gateway` connections use - `cidr` to specify the CIDR to use for the `VPN gateway / Dynamic route - server` GRE tunnels. + `cidr` to specify the CIDR to use for the `VPN gateway` GRE tunnels. :param int local_bgp_asn: (optional) Local network BGP ASN. This field only applies to network type `gre_tunnel` and `unbound_gre_tunnel` connections. @@ -5178,8 +5174,7 @@ class TransitGatewayConnectionCust: is required to be unspecified for network type `classic`, `directlink`, `vpc`, `power_virtual_server`, `vpn_gateway` and `gre_tunnel` connections. :param str cidr: (optional) network_type `vpn_gateway` connections use `cidr` to - specify the CIDR to use for the `VPN gateway / Dynamic route server` GRE - tunnels. + specify the CIDR to use for the `VPN gateway` GRE tunnels. :param datetime created_at: The date and time that this connection was created. :param str id: The unique identifier for this Transit Gateway connection. :param int local_bgp_asn: (optional) Local network BGP ASN. This field only @@ -5202,8 +5197,8 @@ class TransitGatewayConnectionCust: Cloud account than the gateway. :param str network_id: (optional) The ID of the network being connected via this connection. For network types `vpc`, `vpn_gateway`, `power_virtual_server` and - `directlink` this is the CRN of the VPC / VPN / Dynamic Route Server / PowerVS / - Direct Link gateway respectively. This field is required for network type `vpc`, + `directlink` this is the CRN of the VPC / VPN / PowerVS / Direct Link 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`, @@ -5298,8 +5293,7 @@ def __init__( `directlink`, `vpc`, `power_virtual_server`, `vpn_gateway` and `gre_tunnel` connections. :param str cidr: (optional) network_type `vpn_gateway` connections use - `cidr` to specify the CIDR to use for the `VPN gateway / Dynamic route - server` GRE tunnels. + `cidr` to specify the CIDR to use for the `VPN gateway` GRE tunnels. :param int local_bgp_asn: (optional) Local network BGP ASN. This field only applies to network type `gre_tunnel` and `unbound_gre_tunnel` connections. @@ -5324,12 +5318,12 @@ def __init__( :param str network_id: (optional) The ID of the network being connected via this connection. For network types `vpc`, `vpn_gateway`, `power_virtual_server` and `directlink` this is the CRN of the VPC / VPN / - Dynamic Route Server / PowerVS / Direct Link 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. + PowerVS / Direct Link 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. :param str network_type: (optional) Defines what type of network is connected via this connection. :param List[TransitGatewayConnectionPrefixFilterReference] prefix_filters: