diff --git a/ibm_cloud_networking_services/transit_gateway_apis_v1.py b/ibm_cloud_networking_services/transit_gateway_apis_v1.py index e63a86f..565deb3 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. @@ -102,17 +102,27 @@ def list_transit_gateways( *, limit: Optional[int] = None, start: Optional[str] = None, + redundancy_group: Optional[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: @@ -155,13 +166,20 @@ def create_transit_gateway( *, global_: Optional[bool] = None, gre_enhanced_route_propagation: Optional[bool] = None, + redundancy_group: Optional[str] = None, resource_group: Optional['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 @@ -332,21 +362,32 @@ def update_transit_gateway( global_: Optional[bool] = None, gre_enhanced_route_propagation: Optional[bool] = None, name: Optional[str] = None, + redundancy_group: Optional[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) @@ -411,7 +453,13 @@ def list_connections( """ 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. @@ -569,9 +617,10 @@ def create_transit_gateway_connection( 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. + :param str cidr: (optional) network_type `vpn_gateway` connections use + `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`, `directlink`, `vpc`, `power_virtual_server`, `gre_tunnel`, `unbound_gre_tunnel`, and `redundant_gre` connections. @@ -602,10 +651,10 @@ 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` + this connection. For network types `vpc`, `vpn_gateway`, + `power_virtual_server` and `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`, `gre_tunnel` and `unbound_gre_tunnel` @@ -2001,6 +2050,165 @@ def get_transit_gateway_route_report( response = self.send(request, **kwargs) return response + ######################### + # Redundancy Groups + ######################### + + def list_redundancy_groups( + self, + *, + name: Optional[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 @@ -2648,6 +2856,222 @@ class ActionEnum(str, Enum): +class RedundancyGroup: + """ + A redundancy group. + + :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. + """ + + def __init__( + self, + created_at: datetime, + id: str, + name: str, + *, + updated_at: Optional[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 := _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 := _dict.get('id')) is not None: + args['id'] = id + else: + raise ValueError('Required property \'id\' not present in RedundancyGroup JSON') + 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 := _dict.get('updated_at')) is not None: + args['updated_at'] = string_to_datetime(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. + + :param 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 := _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) + + @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. + + :param str name: (optional) The new name for the redundancy group. + """ + + def __init__( + self, + *, + name: Optional[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 := _dict.get('name')) is not None: + args['name'] = 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 @@ -2988,33 +3412,30 @@ class RouteReportConnection: """ route report connection. - :param List[RouteReportConnectionBgp] bgps: (optional) Array of connection's - bgps. + :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: (optional) Array of connection's - routes. + :param List[RouteReportConnectionRoute] routes: Array of connection's routes. :param 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, ) -> 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 @@ -3029,12 +3450,16 @@ def from_dict(cls, _dict: Dict) -> 'RouteReportConnection': args = {} 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 := _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 := _dict.get('type')) is not None: args['type'] = type return cls(**args) @@ -3302,20 +3727,19 @@ class RouteReportOverlappingRouteGroup: """ Collection of overlapping route. - :param List[RouteReportOverlappingRoute] routes: (optional) Array of overlapping + :param 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 @@ -3325,6 +3749,8 @@ def from_dict(cls, _dict: Dict) -> 'RouteReportOverlappingRouteGroup': args = {} 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) @classmethod @@ -3436,8 +3862,8 @@ class TSLocalLocation: :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 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 @@ -3448,21 +3874,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 @@ -3483,6 +3908,8 @@ def from_dict(cls, _dict: Dict) -> 'TSLocalLocation': 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 + else: + raise ValueError('Required property \'supported_connection_types\' not present in TSLocalLocation JSON') if (type := _dict.get('type')) is not None: args['type'] = type else: @@ -3748,8 +4175,8 @@ class TransitConnection: :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. + network types `vpc`, `vpn_gateway`, `power_virtual_server` and `directlink` this + 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. @@ -3761,6 +4188,8 @@ 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` connections use `cidr` to + 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. @@ -3816,6 +4245,7 @@ def __init__( 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, @@ -3856,8 +4286,8 @@ def __init__( :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 + For network types `vpc`, `vpn_gateway`, `power_virtual_server` and + `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 @@ -3866,6 +4296,8 @@ 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` connections use + `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. @@ -3908,6 +4340,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 @@ -3948,6 +4381,8 @@ def from_dict(cls, _dict: Dict) -> 'TransitConnection': 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 (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: @@ -4014,6 +4449,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 +4530,6 @@ class BaseNetworkTypeEnum(str, Enum): CLASSIC = 'classic' VPC = 'vpc' - VPN = 'vpn' class NetworkTypeEnum(str, Enum): @@ -4283,6 +4719,11 @@ class TransitGateway: :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. + :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) is @@ -4307,6 +4748,8 @@ def __init__( *, 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: @@ -4330,6 +4773,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 +4794,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 @@ -4386,6 +4836,10 @@ def from_dict(cls, _dict: Dict) -> 'TransitGateway': args['name'] = name else: raise ValueError('Required property \'name\' not present in TransitGateway JSON') + 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: @@ -4422,6 +4876,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 @@ -4715,8 +5173,8 @@ class TransitGatewayConnectionCust: 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 str cidr: (optional) network_type `vpn_gateway` connections use `cidr` to + 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 @@ -4738,10 +5196,10 @@ class TransitGatewayConnectionCust: 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 + connection. For network types `vpc`, `vpn_gateway`, `power_virtual_server` and + `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`, `gre_tunnel` and `unbound_gre_tunnel` connections. @@ -4834,8 +5292,8 @@ def __init__( 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 str cidr: (optional) network_type `vpn_gateway` connections use + `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. @@ -4858,10 +5316,10 @@ def __init__( 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` + this connection. For network types `vpc`, `vpn_gateway`, + `power_virtual_server` and `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`, `gre_tunnel` and `unbound_gre_tunnel` @@ -5079,7 +5537,6 @@ class BaseNetworkTypeEnum(str, Enum): CLASSIC = 'classic' VPC = 'vpc' - VPN = 'vpn' class NetworkTypeEnum(str, Enum): @@ -5728,7 +6185,6 @@ class BaseNetworkTypeEnum(str, Enum): CLASSIC = 'classic' VPC = 'vpc' - VPN = 'vpn' class StatusEnum(str, Enum): @@ -6167,16 +6623,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 +6655,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..af0f12f 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. @@ -123,7 +123,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 +135,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 +153,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 +171,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 +203,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 +236,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 +258,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 +273,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 +294,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 +313,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 +331,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 +340,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 +354,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 +373,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 +391,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 +501,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 +539,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 +582,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 +596,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 +604,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 +616,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 +634,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 +648,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 +738,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 +789,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 +821,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 +854,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 +892,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 +990,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 +1040,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 +1078,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 +1115,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 +1153,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 +1194,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 +1229,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 +1273,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 +1303,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 +1338,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 +1463,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 +1503,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 +1548,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 +1596,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 +1729,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 +1769,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 +1814,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 +1881,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 +2026,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 +2068,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 +2115,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 +2166,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 +3338,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 +3954,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 +4465,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 +4499,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 +4595,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 +4617,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 +4686,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 +4707,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 +4783,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 +4838,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 +4896,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 +4913,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 +4995,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 +5013,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 +5173,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 +5222,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