diff --git a/ibm_cloud_networking_services/transit_gateway_apis_v1.py b/ibm_cloud_networking_services/transit_gateway_apis_v1.py index f44c195..d62ba41 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. 2024. +# (C) Copyright IBM Corp. 2025. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -154,6 +154,7 @@ def create_transit_gateway( name: str, *, global_: bool = None, + gre_enhanced_route_propagation: bool = None, resource_group: 'ResourceGroupIdentity' = None, **kwargs, ) -> DetailedResponse: @@ -163,9 +164,11 @@ def create_transit_gateway( Create a Transit Gateway based on the supplied input template. :param str location: Location of Transit Gateway Services. - :param str name: Name Transit Gateway Services. + :param str name: A human readable name for the transit gateway. :param bool global_: (optional) Allow global routing for a Transit Gateway. If unspecified, the default value is false. + :param bool gre_enhanced_route_propagation: (optional) Allow GRE Enhanced + Route Propagation on this gateway. :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) @@ -197,6 +200,7 @@ def create_transit_gateway( 'location': location, 'name': name, 'global': global_, + 'gre_enhanced_route_propagation': gre_enhanced_route_propagation, 'resource_group': resource_group, } data = {k: v for (k, v) in data.items() if v is not None} @@ -324,6 +328,7 @@ def update_transit_gateway( id: str, *, global_: bool = None, + gre_enhanced_route_propagation: bool = None, name: str = None, **kwargs, ) -> DetailedResponse: @@ -334,7 +339,9 @@ def update_transit_gateway( :param str id: The Transit Gateway identifier. :param bool global_: (optional) Allow global routing for a Transit Gateway. - :param str name: (optional) The user-defined name for this transit gateway. + :param bool gre_enhanced_route_propagation: (optional) Allow GRE Enhanced + Route Propagation on this gateway. + :param str name: (optional) A human readable name for a resource. :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 @@ -356,6 +363,7 @@ def update_transit_gateway( data = { 'global': global_, + 'gre_enhanced_route_propagation': gre_enhanced_route_propagation, 'name': name, } data = {k: v for (k, v) in data.items() if v is not None} @@ -392,6 +400,7 @@ def list_connections( limit: int = None, start: str = None, network_id: str = None, + network_type: str = None, **kwargs, ) -> DetailedResponse: """ @@ -405,6 +414,8 @@ def list_connections( resource to start the page on. :param str network_id: (optional) Search for connections with the given network_id value. + :param str network_type: (optional) Search for connections with the given + network_type value. :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 `TransitConnectionCollection` object @@ -423,6 +434,7 @@ def list_connections( 'limit': limit, 'start': start, 'network_id': network_id, + 'network_type': network_type, } if 'headers' in kwargs: @@ -513,6 +525,7 @@ def create_transit_gateway_connection( *, base_connection_id: str = None, base_network_type: str = None, + cidr: str = None, local_gateway_ip: str = None, local_tunnel_ip: str = None, name: str = None, @@ -523,12 +536,12 @@ def create_transit_gateway_connection( remote_bgp_asn: int = None, remote_gateway_ip: str = None, remote_tunnel_ip: str = None, - tunnels: List['TransitGatewayRedundantGRETunnelTemplate'] = None, + tunnels: List['TransitGatewayTunnelTemplate'] = None, zone: 'ZoneIdentity' = None, **kwargs, ) -> DetailedResponse: """ - Add connection to a Transit Gateway. + Adds a connection to a Transit Gateway. Add a connection to Transit Gateway. @@ -536,102 +549,113 @@ def create_transit_gateway_connection( :param str network_type: Defines what type of network is connected via this connection. :param str base_connection_id: (optional) Deprecated: network_type - 'gre_tunnel' connections must be created over an existing network_type - 'classic' connection. This field must specify the ID of an active transit - gateway network_type 'classic' connection in the same transit gateway. - This field is required for network type 'gre_tunnel' connections. - This field is required to be unspecified for network type 'classic', - 'directlink', 'vpc', - 'power_virtual_server', 'unbound_gre_tunnel' and 'redundant_gre' - connections. + `gre_tunnel` connections must be created over an existing network_type + `classic` connection. This field must specify the ID of an active transit + gateway network_type `classic` connection in the same transit gateway. + This field is required for network type `gre_tunnel` connections. + This field is required to be unspecified for network type `classic`, + `directlink`, `vpc`, + `power_virtual_server`, `unbound_gre_tunnel`, `vpn_gateway` and + `redundant_gre` connections. :param str base_network_type: (optional) The type of network the Unbound GRE tunnel is targeting. This field is required for network type - 'unbound_gre_tunnel' and must be set to 'classic'. For a 'redundant_gre' + `unbound_gre_tunnel` and must be set to `classic`. For a `redundant_gre` network type, the value is required and can be either VPC or Classic. This - field is required to be unspecified for network type 'classic', - 'directlink', 'vpc', 'power_virtual_server' and 'gre_tunnel' connections. + 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. + This field is required to be unspecified for network type `classic`, + `directlink`, `vpc`, `power_virtual_server`, `gre_tunnel`, + `unbound_gre_tunnel`, and `redundant_gre` connections. :param str local_gateway_ip: (optional) Local gateway IP address. This - field is required for network type 'gre_tunnel' and 'unbound_gre_tunnel' + field is required for network type `gre_tunnel` and `unbound_gre_tunnel` connections. This field is required to be unspecified for network type - 'classic', 'directlink', 'vpc', 'power_virtual_server' and 'redundant_gre' - connections. + `classic`, `directlink`, `vpc`, `power_virtual_server`, `vpn_gateway` and + `redundant_gre` connections. :param str local_tunnel_ip: (optional) Local tunnel IP address. The local_tunnel_ip and remote_tunnel_ip addresses must be in the same /30 network. Neither can be the network nor broadcast addresses. - This field is required for network type 'gre_tunnel' and - 'unbound_gre_tunnel' connections. - This field is required to be unspecified for network type 'classic', - 'directlink', 'vpc', 'power_virtual_server' and 'redundant_gre' - connections. + This field is required for network type `gre_tunnel` and + `unbound_gre_tunnel` connections. + This field is required to be unspecified for network type `classic`, + `directlink`, `vpc`, `power_virtual_server`, `vpn_gateway` and + `redundant_gre` connections. :param str name: (optional) The user-defined name for this transit gateway - connection. Network type 'vpc' connections are defaulted to the name of - the VPC. Network type 'classic' connections are named 'Classic'. - This field is required for network type 'gre_tunnel', 'unbound_gre_tunnel' - and 'redundant_gre' connections. - This field is optional for network type 'classic', 'directlink', 'vpc' and - 'power_virtual_server' connections. + connection. Network type `vpc` connections are defaulted to the name of + the VPC. Network type `classic` connections are named `classic`. + This field is required for network type `power_virtual_server`, + `directlink`, `gre_tunnel`, `unbound_gre_tunnel`, `vpn_gateway` and + `redundant_gre` connections. + This field is optional for network type `classic`, `vpc` connections. :param str network_account_id: (optional) The ID of the account which owns the network that is being connected. Generally only used if the network is in a different account than the gateway. This field is required for type - 'unbound_gre_tunnel' when the associated_network_type is 'classic' or - network_type is 'redundant_gre' and the GRE tunnel is in a different + `unbound_gre_tunnel` when the associated_network_type is `classic` or + network_type is `redundant_gre` and the GRE tunnel is in a different account than the gateway. :param str network_id: (optional) The ID of the network being connected via - this connection. For network types 'vpc','power_virtual_server' and - 'directlink' this is the CRN of the VPC / PowerVS / Direct Link gateway - respectively. This field is required for network type 'vpc', - 'power_virtual_server' and 'directlink' connections. It is also required - for 'redundant_gre' connections when the base_network_type is set to VPC. - This field is required to be unspecified for network type 'classic', - 'gre_tunnel' and 'unbound_gre_tunnel' connections. + this connection. For network types `vpc`,`power_virtual_server`, + `directlink` and `vpn_gateway` this is the CRN of the VPC / PowerVS / VDC / + Direct Link / VPN gateway respectively. This field is required for network + type `vpc`, `power_virtual_server`, `vpn_gateway`, and `directlink` + connections. It is also required for `redundant_gre` connections when the + base_network_type is set to VPC. This field is required to be unspecified + for network type `classic`, `gre_tunnel` and `unbound_gre_tunnel` + connections. :param List[TransitGatewayConnectionPrefixFilter] prefix_filters: (optional) Array of prefix route filters for a transit gateway connection. - Prefix filters can be specified for netowrk type 'vpc', 'classic', - 'power_virtual_server' and 'directlink' connections. They are not allowed - for type 'gre_tunnel' connections. This is order dependent with those first + Prefix filters can be specified for netowrk type `vpc`, `classic`, + `power_virtual_server` and `directlink` connections. They are not allowed + for type `gre_tunnel` connections. This is order dependent with those first in the array being applied first, and those at the end of the array being applied last, or just before applying the default. This field is optional - for network type 'classic', 'vpc', 'directlink', and 'power_virtual_server' + for network type `classic`, `vpc`, `directlink`, and `power_virtual_server` connections. This field is required to be unspecified for network type - 'gre_tunnel', 'unbound_gre_tunnel' and 'redundant_gre' connections. + `gre_tunnel`, `unbound_gre_tunnel`, `vpn_gateway` and `redundant_gre` + connections. :param str prefix_filters_default: (optional) Default setting of permit or deny which applies to any routes that don't match a specified filter. This - field is optional for network type 'classic', 'vpc', 'directlink', and - 'power_virtual_server' connections. This field is required to be - unspecified for network type 'gre_tunnel', 'unbound_gre_tunnel' and - 'redundant_gre' connections. + field is optional for network type `classic`, `vpc`, `directlink`, and + `power_virtual_server` connections. This field is required to be + unspecified for network type `gre_tunnel`, `unbound_gre_tunnel`, + `vpn_gateway` and `redundant_gre` connections. :param int remote_bgp_asn: (optional) Remote network BGP ASN. The following ASN values are reserved and unavailable 0, 13884, 36351, 64512-64513, 65100, 65200-65234, 65402-65433, 65500 and 4201065000-4201065999. If - 'remote_bgp_asn' is omitted on gre_tunnel or unbound_gre_tunnel connection + `remote_bgp_asn` is omitted on gre_tunnel or unbound_gre_tunnel connection create requests IBM will assign an ASN. - This field is optional for network type 'gre_tunnel' and - 'unbound_gre_tunnel' connections. - This field is required to be unspecified for network type 'classic', - 'directlink', 'vpc', 'power_virtual_server' and 'gre_tunnel' connections. + This field is optional for network type `gre_tunnel` and + `unbound_gre_tunnel` connections. + This field is required to be unspecified for network type `classic`, + `directlink`, `vpc`, `power_virtual_server`, `vpn_gateway` and `gre_tunnel` + connections. :param str remote_gateway_ip: (optional) Remote gateway IP address. This - field is required for network type 'gre_tunnel' and 'unbound_gre_tunnel' + field is required for network type `gre_tunnel` and `unbound_gre_tunnel` connections. This field is required to be unspecified for network type - 'classic', 'directlink', 'vpc', 'power_virtual_server' and 'redundant_gre' - connections. + `classic`, `directlink`, `vpc`, `power_virtual_server`, `vpn_gateway` and + `redundant_gre` connections. :param str remote_tunnel_ip: (optional) Remote tunnel IP address. The local_tunnel_ip and remote_tunnel_ip addresses must be in the same /30 network. Neither can be the network nor broadcast addresses. - This field is required for network type 'gre_tunnel' and - 'unbound_gre_tunnel' connections. - This field is required to be unspecified for network type 'classic', - 'directlink', 'vpc', 'power_virtual_server' and 'redundant_gre' + This field is required for network type `gre_tunnel` and + `unbound_gre_tunnel` connections. + This field is required to be unspecified for network type `classic`, + `directlink`, `vpc`, `power_virtual_server`, `vpn_gateway` and + `redundant_gre` connections. + :param List[TransitGatewayTunnelTemplate] tunnels: (optional) Array of GRE + tunnels for a transit gateway `redundant_gre` and `vpn_gateway` + connections. This field is required for `redundant_gre` and `vpn_gateway` connections. - :param List[TransitGatewayRedundantGRETunnelTemplate] tunnels: (optional) - Array of GRE tunnels for a transit gateway redundant GRE tunnel connection. - This field is required for 'redundant_gre' connections. :param ZoneIdentity zone: (optional) Specify the connection's location. The specified availability zone must reside in the gateway's region. Use the IBM Cloud global catalog to list zones within the desired region. - This field is required for network type 'gre_tunnel' and - 'unbound_gre_tunnel' connections. - This field is required to be unspecified for network type 'classic', - 'directlink', 'vpc', 'power_virtual_server' and 'redundant_gre' + This field is required for network type `gre_tunnel`, `unbound_gre_tunnel` + and `vpn_gateway` connections. + This field is required to be unspecified for network type `classic`, + `directlink`, `vpc`, `power_virtual_server` and `redundant_gre` connections. :param dict headers: A `dict` containing the request headers :return: A `DetailedResponse` containing the result, headers and HTTP status code. @@ -664,6 +688,7 @@ def create_transit_gateway_connection( 'network_type': network_type, 'base_connection_id': base_connection_id, 'base_network_type': base_network_type, + 'cidr': cidr, 'local_gateway_ip': local_gateway_ip, 'local_tunnel_ip': local_tunnel_ip, 'name': name, @@ -708,7 +733,7 @@ def delete_transit_gateway_connection( **kwargs, ) -> DetailedResponse: """ - Remove connection from Transit Gateway. + Removes a connection from Transit Gateway. After the specified connection is detached, entities still within the Transit Gateway will no longer be able to communicate directly to it through the IBM Cloud @@ -826,8 +851,8 @@ def update_transit_gateway_connection( :param str id: The connection identifier. :param str name: (optional) The user-defined name for this transit gateway. If specified as empty string or nil, the name will be the network name - (the name of the VPC in the case of network type 'vpc', and the word - Classic, in the case of network type 'classic'). + (the name of the VPC in the case of network type `vpc`, and the word + Classic, in the case of network type `classic`). :param str prefix_filters_default: (optional) Default setting of permit or deny which applies to any routes that don't match a specified filter. :param dict headers: A `dict` containing the request headers @@ -887,7 +912,7 @@ def create_transit_gateway_connection_actions( **kwargs, ) -> DetailedResponse: """ - Perform actions on a connection for a Transit Gateway. + Performs actions on a connection for a Transit Gateway. Allow a network owner to approve or reject a cross-account connection request. @@ -944,7 +969,7 @@ def create_transit_gateway_connection_actions( response = self.send(request, **kwargs) return response - def get_transit_gateway_gre_tunnel( + def list_transit_gateway_gre_tunnel( self, transit_gateway_id: str, id: str, @@ -953,13 +978,13 @@ def get_transit_gateway_gre_tunnel( """ Retrieves specified Transit Gateway redundant gre connection tunnels. - This request retrieves a list of all the tunnels for the redundant gre conneciton. + This request retrieves a list of all the tunnels for connection. :param str transit_gateway_id: The Transit Gateway identifier. :param str id: The connection 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 `RedundantGRETunnelCollection` object + :rtype: DetailedResponse with `dict` result representing a `TransitGatewayTunnelCollection` object """ if not transit_gateway_id: @@ -970,7 +995,7 @@ def get_transit_gateway_gre_tunnel( sdk_headers = get_sdk_headers( service_name=self.DEFAULT_SERVICE_NAME, service_version='V1', - operation_id='get_transit_gateway_gre_tunnel', + operation_id='list_transit_gateway_gre_tunnel', ) headers.update(sdk_headers) @@ -1012,7 +1037,7 @@ def create_transit_gateway_gre_tunnel( **kwargs, ) -> DetailedResponse: """ - Create Transit Gateway redundant GRE tunnel. + Creates a Transit Gateway redundant GRE tunnel. Add a tunnel to an existing Redundant GRE connection. @@ -1033,10 +1058,10 @@ def create_transit_gateway_gre_tunnel( :param int remote_bgp_asn: (optional) Remote network BGP ASN. The following ASN values are reserved and unavailable 0, 13884, 36351, 64512-64513, 65100, 65200-65234, 65402-65433, 65500 and 4201065000-4201065999. If - 'remote_bgp_asn' is omitted on create requests, IBM will assign an ASN. + `remote_bgp_asn` is omitted on create requests, IBM will assign an ASN. :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 `RedundantGRETunnelReference` object + :rtype: DetailedResponse with `dict` result representing a `TransitGatewayTunnel` object """ if not transit_gateway_id: @@ -1109,7 +1134,7 @@ def delete_transit_gateway_connection_tunnels( **kwargs, ) -> DetailedResponse: """ - Delete specified Transit Gateway redundant GRE tunnel. + Deletes a specified Transit Gateway redundant GRE tunnel. Remove a tunnel from a redundant GRE connection. @@ -1167,14 +1192,14 @@ def get_transit_gateway_connection_tunnels( """ Retrieves specified Transit Gateway connection tunnel. - This request retrieves a connection tunnel from the Transit Gateway Connection. + This request retrieves a connection tunnel from the Transit Gateway connection. :param str transit_gateway_id: The Transit Gateway identifier. :param str id: The connection identifier. :param str gre_tunnel_id: The tunnel 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 `RedundantGRETunnelReference` object + :rtype: DetailedResponse with `dict` result representing a `TransitGatewayTunnel` object """ if not transit_gateway_id: @@ -1219,8 +1244,7 @@ def update_transit_gateway_connection_tunnels( transit_gateway_id: str, id: str, gre_tunnel_id: str, - *, - name: str = None, + transit_gateway_tunnel_patch: 'TransitGatewayTunnelPatch', **kwargs, ) -> DetailedResponse: """ @@ -1231,11 +1255,11 @@ def update_transit_gateway_connection_tunnels( :param str transit_gateway_id: The Transit Gateway identifier. :param str id: The connection identifier. :param str gre_tunnel_id: The tunnel identifier. - :param str name: (optional) The user-defined name for this connection - tunnel. + :param TransitGatewayTunnelPatch transit_gateway_tunnel_patch: The update + connection tunnel 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 `RedundantGRETunnelReference` object + :rtype: DetailedResponse with `dict` result representing a `TransitGatewayTunnel` object """ if not transit_gateway_id: @@ -1244,6 +1268,10 @@ def update_transit_gateway_connection_tunnels( raise ValueError('id must be provided') if not gre_tunnel_id: raise ValueError('gre_tunnel_id must be provided') + if transit_gateway_tunnel_patch is None: + raise ValueError('transit_gateway_tunnel_patch must be provided') + if isinstance(transit_gateway_tunnel_patch, TransitGatewayTunnelPatch): + transit_gateway_tunnel_patch = convert_model(transit_gateway_tunnel_patch) headers = {} sdk_headers = get_sdk_headers( service_name=self.DEFAULT_SERVICE_NAME, @@ -1256,12 +1284,8 @@ def update_transit_gateway_connection_tunnels( 'version': self.version, } - data = { - 'name': name, - } - data = {k: v for (k, v) in data.items() if v is not None} - data = json.dumps(data) - headers['content-type'] = 'application/json' + data = json.dumps(transit_gateway_tunnel_patch) + headers['content-type'] = 'application/merge-patch+json' if 'headers' in kwargs: headers.update(kwargs.get('headers')) @@ -1284,7 +1308,7 @@ def update_transit_gateway_connection_tunnels( return response ######################### - # Transit Location + # Transit Locations ######################### def list_gateway_locations( @@ -1292,7 +1316,7 @@ def list_gateway_locations( **kwargs, ) -> DetailedResponse: """ - List all locations that support Transit Gateways. + Lists all locations that support Transit Gateways. List all locations that support Transit Gateways. @@ -1335,7 +1359,7 @@ def get_gateway_location( **kwargs, ) -> DetailedResponse: """ - Show the details of a given Transit Gateway location. + Shows the details of a given Transit Gateway location. Get the details of a Transit Gateway Location. @@ -1448,20 +1472,20 @@ def create_transit_gateway_connection_prefix_filter( **kwargs, ) -> DetailedResponse: """ - Add a prefix filter to a Transit Gateway Connection. + Add a prefix filter to a Transit Gateway connection. - Add a prefix filter to a Transit Gateway Connection. + Add a prefix filter to a Transit Gateway connection. :param str transit_gateway_id: The Transit Gateway identifier. :param str id: The connection identifier. :param str action: Whether or not this prefix filter should allow or deny prefixes matching this filter's prefix definition. :param str prefix: The IPv4 Prefix to be matched by this filter. If both - the 'le' and 'ge' are zero, then this filter will only apply to routes that - exactly match this prefix, while a non-zero value for either 'le' or 'ge', + the `le` and `ge` are zero, then this filter will only apply to routes that + exactly match this prefix, while a non-zero value for either `le` or `ge`, this filter can apply to multiple routes with different prefix lengths, but will still only apply to prefixes contained in the address space defined by - 'prefix'. + `prefix`. :param str before: (optional) A reference to the prefix filter that will be the next filter applied to the Transit Gateway connection. If this field is blank, this prefix filter will be the last rule applied @@ -1471,21 +1495,21 @@ def create_transit_gateway_connection_prefix_filter( and the existing filter's before field will be updated accordingly. :param int ge: (optional) Defines the minimum matched prefix precision. If this field is non-zero then the filter will match all routes within the - 'prefix' that have a prefix length greater than or equal to this value. + `prefix` that have a prefix length greater than or equal to this value. This value can be zero, or a non-negative number greater than or equal to the prefix length of the filter's prefix or less then or equal to 32. If - this value is set to zero, the filter will not use the 'ge' route matching - behavior. If the 'le' value is non-zero the the 'ge' value must between the + this value is set to zero, the filter will not use the `ge` route matching + behavior. If the `le` value is non-zero the the `ge` value must between the prefix length and the - 'le' value, inclusive. + `le` value, inclusive. :param int le: (optional) Defines the maximum matched prefix precision. If this field is non-zero then the filter will match all routes within the - 'prefix' that have a prefix length less than or equal to this value. + `prefix` that have a prefix length less than or equal to this value. This value can be zero, or a non-negative number greater than or equal to the prefix length of the filter's prefix or less then or equal to 32. If - this value is set to zero, the filter will not use the 'le' route matching - behavior. If the 'ge' value is non-zero the the 'le' value must between the - 'ge' value and 32, inclusive. + this value is set to zero, the filter will not use the `le` route matching + behavior. If the `ge` value is non-zero the the `le` value must between the + `ge` value and 32, inclusive. :param 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 `PrefixFilterCust` object @@ -1550,9 +1574,9 @@ def replace_transit_gateway_connection_prefix_filter( **kwargs, ) -> DetailedResponse: """ - Replaces the prefix filters of the Transit Gateway Connection. + Replaces the prefix filters of the Transit Gateway connection. - Replaces the prefix filters of the Transit Gateway Connection. + Replaces the prefix filters of the Transit Gateway connection. :param str transit_gateway_id: The Transit Gateway identifier. :param str id: The connection identifier. @@ -1616,7 +1640,7 @@ def delete_transit_gateway_connection_prefix_filter( **kwargs, ) -> DetailedResponse: """ - Remove prefix filter from Transit Gateway Connection. + Remove prefix filter from Transit Gateway connection. Delete a prefix filter. @@ -1674,7 +1698,7 @@ def get_transit_gateway_connection_prefix_filter( """ Retrieves specified Transit Gateway connection prefix filter. - This request retrieves a prefix filter from the Transit Gateway Connection. + This request retrieves a prefix filter from the Transit Gateway connection. :param str transit_gateway_id: The Transit Gateway identifier. :param str id: The connection identifier. @@ -1753,21 +1777,21 @@ def update_transit_gateway_connection_prefix_filter( and the existing filter's before field will be updated accordingly. :param int ge: (optional) Defines the minimum matched prefix precision. If this field is non-zero then the filter will match all routes within the - 'prefix' that have a prefix length greater or equal to this value. + `prefix` that have a prefix length greater or equal to this value. This value can be zero, or a non-negative number greater than or equal to the prefix length of the filter's prefix or less then or equal to 32. If - this value is set to zero, the filter will not use the 'ge' route matching - behavior. If the 'le' value is non-zero the the 'ge' value must between the + this value is set to zero, the filter will not use the `ge` route matching + behavior. If the `le` value is non-zero the the `ge` value must between the prefix length and the - 'le' value, inclusive. + `le` value, inclusive. :param int le: (optional) Defines the maximum matched prefix precision. If this field is non-zero then the filter will match all routes within the - 'prefix' that have a prefix length less than or equal to this value. + `prefix` that have a prefix length less than or equal to this value. This value can be zero, or a non-negative number greater than or equal to the prefix length of the filter's prefix or less then or equal to 32. If - this value is set to zero, the filter will not use the 'le' route matching - behavior. If the 'ge' value is non-zero the the 'le' value must between the - 'ge' value and 32, inclusive. + this value is set to zero, the filter will not use the `le` route matching + behavior. If the `ge` value is non-zero the the `le` value must between the + `ge` value and 32, inclusive. :param str prefix: (optional) The IPv4 Prefix to be matched by this filter. :param dict headers: A `dict` containing the request headers :return: A `DetailedResponse` containing the result, headers and HTTP status code. @@ -1833,7 +1857,7 @@ def list_transit_gateway_route_reports( **kwargs, ) -> DetailedResponse: """ - List route reports. + Lists route reports. Retrieve all route reports for the specified Transit Gateway. There will normally be at most one completed report and one pending report. Additionally, completed @@ -1884,7 +1908,7 @@ def create_transit_gateway_route_report( **kwargs, ) -> DetailedResponse: """ - Request a route report. + Requests a route report. Request route report generation. While report generation is in progress, additional requests to generate a report are ignored and return the current @@ -1936,7 +1960,7 @@ def delete_transit_gateway_route_report( **kwargs, ) -> DetailedResponse: """ - Delete route report. + Deletes a route report. Delete a route report. @@ -1988,7 +2012,7 @@ def get_transit_gateway_route_report( **kwargs, ) -> DetailedResponse: """ - Retrieve route report. + Retrieves a route report. Retrieve a route report. @@ -2040,66 +2064,6 @@ def get_transit_gateway_route_report( ############################################################################## -class GreTunnelZoneReference: - """ - Location of GRE tunnel. This field only applies to network type 'gre_tunnel' - connections. - - :attr str name: Availability zone name. - """ - - def __init__( - self, - name: str, - ) -> None: - """ - Initialize a GreTunnelZoneReference object. - - :param str name: Availability zone name. - """ - self.name = name - - @classmethod - def from_dict(cls, _dict: Dict) -> 'GreTunnelZoneReference': - """Initialize a GreTunnelZoneReference object from a json dictionary.""" - args = {} - if 'name' in _dict: - args['name'] = _dict.get('name') - else: - raise ValueError('Required property \'name\' not present in GreTunnelZoneReference JSON') - return cls(**args) - - @classmethod - def _from_dict(cls, _dict): - """Initialize a GreTunnelZoneReference 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 GreTunnelZoneReference object.""" - return json.dumps(self.to_dict(), indent=2) - - def __eq__(self, other: 'GreTunnelZoneReference') -> 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: 'GreTunnelZoneReference') -> bool: - """Return `true` when self and other are not equal, false otherwise.""" - return not self == other - - class PaginationFirstConnection: """ A reference to the first page of resources. @@ -2569,27 +2533,27 @@ class PrefixFilterCust: :attr datetime created_at: The date and time that this prefix filter was created. :attr int ge: (optional) Defines the minimum matched prefix precision. If this - field is non-zero then the filter will match all routes within the 'prefix' that + field is non-zero then the filter will match all routes within the `prefix` that have a prefix length greater or equal to this value. This value can be zero, or a non-negative number greater than or equal to the prefix length of the filter's prefix or less then or equal to 32. If this value - is set to zero, the filter will not use the 'ge' route matching behavior. If the - 'le' value is non-zero the the 'ge' value must between the prefix length and the - 'le' value, inclusive. + is set to zero, the filter will not use the `ge` route matching behavior. If the + `le` value is non-zero the the `ge` value must between the prefix length and the + `le` value, inclusive. :attr str id: Prefix Filter identifier. :attr int le: (optional) Defines the maximum matched prefix precision. If this - field is non-zero then the filter will match all routes within the 'prefix' that + field is non-zero then the filter will match all routes within the `prefix` that have a prefix length less than or equal to this value. This value can be zero, or a non-negative number greater than or equal to the prefix length of the filter's prefix or less then or equal to 32. If this value - is set to zero, the filter will not use the 'le' route matching behavior. If the - 'ge' value is non-zero the the 'le' value must between the 'ge' value and 32, + is set to zero, the filter will not use the `le` route matching behavior. If the + `ge` value is non-zero the the `le` value must between the `ge` value and 32, inclusive. - :attr str prefix: The IPv4 Prefix to be matched by this filter. If both the 'le' - and 'ge' are zero, then this filter will only apply to routes that exactly match - this prefix, while a non-zero value for either 'le' or 'ge', this filter can + :attr str prefix: The IPv4 Prefix to be matched by this filter. If both the `le` + and `ge` are zero, then this filter will only apply to routes that exactly match + this prefix, while a non-zero value for either `le` or `ge`, this filter can apply to multiple routes with different prefix lengths, but will still only - apply to prefixes contained in the address space defined by 'prefix'. + apply to prefixes contained in the address space defined by `prefix`. :attr datetime updated_at: (optional) The date and time that this prefix filter was last updated. """ @@ -2615,11 +2579,11 @@ def __init__( created. :param str id: Prefix Filter identifier. :param str prefix: The IPv4 Prefix to be matched by this filter. If both - the 'le' and 'ge' are zero, then this filter will only apply to routes that - exactly match this prefix, while a non-zero value for either 'le' or 'ge', + the `le` and `ge` are zero, then this filter will only apply to routes that + exactly match this prefix, while a non-zero value for either `le` or `ge`, this filter can apply to multiple routes with different prefix lengths, but will still only apply to prefixes contained in the address space defined by - 'prefix'. + `prefix`. :param str before: (optional) A reference to the prefix filter that will be the next filter applied to the Transit Gateway connection. If this field is blank, this prefix filter will be the last rule applied @@ -2629,21 +2593,21 @@ def __init__( and the existing filter's before field will be updated accordingly. :param int ge: (optional) Defines the minimum matched prefix precision. If this field is non-zero then the filter will match all routes within the - 'prefix' that have a prefix length greater or equal to this value. + `prefix` that have a prefix length greater or equal to this value. This value can be zero, or a non-negative number greater than or equal to the prefix length of the filter's prefix or less then or equal to 32. If - this value is set to zero, the filter will not use the 'ge' route matching - behavior. If the 'le' value is non-zero the the 'ge' value must between the + this value is set to zero, the filter will not use the `ge` route matching + behavior. If the `le` value is non-zero the the `ge` value must between the prefix length and the - 'le' value, inclusive. + `le` value, inclusive. :param int le: (optional) Defines the maximum matched prefix precision. If this field is non-zero then the filter will match all routes within the - 'prefix' that have a prefix length less than or equal to this value. + `prefix` that have a prefix length less than or equal to this value. This value can be zero, or a non-negative number greater than or equal to the prefix length of the filter's prefix or less then or equal to 32. If - this value is set to zero, the filter will not use the 'le' route matching - behavior. If the 'ge' value is non-zero the the 'le' value must between the - 'ge' value and 32, inclusive. + this value is set to zero, the filter will not use the `le` route matching + behavior. If the `ge` value is non-zero the the `le` value must between the + `ge` value and 32, inclusive. :param datetime updated_at: (optional) The date and time that this prefix filter was last updated. """ @@ -2748,26 +2712,26 @@ class PrefixFilterPut: :attr str action: Whether or not this prefix filter should allow or deny prefixes matching this filter's prefix definition. :attr int ge: (optional) Defines the minimum matched prefix precision. If this - field is non-zero then the filter will match all routes within the 'prefix' that + field is non-zero then the filter will match all routes within the `prefix` that have a prefix length greater or equal to this value. This value can be zero, or a non-negative number greater than or equal to the prefix length of the filter's prefix or less then or equal to 32. If this value - is set to zero, the filter will not use the 'ge' route matching behavior. If the - 'le' value is non-zero the the 'ge' value must between the prefix length and the - 'le' value, inclusive. + is set to zero, the filter will not use the `ge` route matching behavior. If the + `le` value is non-zero the the `ge` value must between the prefix length and the + `le` value, inclusive. :attr int le: (optional) Defines the maximum matched prefix precision. If this - field is non-zero then the filter will match all routes within the 'prefix' that + field is non-zero then the filter will match all routes within the `prefix` that have a prefix length less than or equal to this value. This value can be zero, or a non-negative number greater than or equal to the prefix length of the filter's prefix or less then or equal to 32. If this value - is set to zero, the filter will not use the 'le' route matching behavior. If the - 'ge' value is non-zero the the 'le' value must between the 'ge' value and 32, + is set to zero, the filter will not use the `le` route matching behavior. If the + `ge` value is non-zero the the `le` value must between the `ge` value and 32, inclusive. - :attr str prefix: The IPv4 Prefix to be matched by this filter. If both the 'le' - and 'ge' are zero, then this filter will only apply to routes that exactly match - this prefix, while a non-zero value for either 'le' or 'ge', this filter can + :attr str prefix: The IPv4 Prefix to be matched by this filter. If both the `le` + and `ge` are zero, then this filter will only apply to routes that exactly match + this prefix, while a non-zero value for either `le` or `ge`, this filter can apply to multiple routes with different prefix lengths, but will still only - apply to prefixes contained in the address space defined by 'prefix'. + apply to prefixes contained in the address space defined by `prefix`. """ def __init__( @@ -2784,28 +2748,28 @@ def __init__( :param str action: Whether or not this prefix filter should allow or deny prefixes matching this filter's prefix definition. :param str prefix: The IPv4 Prefix to be matched by this filter. If both - the 'le' and 'ge' are zero, then this filter will only apply to routes that - exactly match this prefix, while a non-zero value for either 'le' or 'ge', + the `le` and `ge` are zero, then this filter will only apply to routes that + exactly match this prefix, while a non-zero value for either `le` or `ge`, this filter can apply to multiple routes with different prefix lengths, but will still only apply to prefixes contained in the address space defined by - 'prefix'. + `prefix`. :param int ge: (optional) Defines the minimum matched prefix precision. If this field is non-zero then the filter will match all routes within the - 'prefix' that have a prefix length greater or equal to this value. + `prefix` that have a prefix length greater or equal to this value. This value can be zero, or a non-negative number greater than or equal to the prefix length of the filter's prefix or less then or equal to 32. If - this value is set to zero, the filter will not use the 'ge' route matching - behavior. If the 'le' value is non-zero the the 'ge' value must between the + this value is set to zero, the filter will not use the `ge` route matching + behavior. If the `le` value is non-zero the the `ge` value must between the prefix length and the - 'le' value, inclusive. + `le` value, inclusive. :param int le: (optional) Defines the maximum matched prefix precision. If this field is non-zero then the filter will match all routes within the - 'prefix' that have a prefix length less than or equal to this value. + `prefix` that have a prefix length less than or equal to this value. This value can be zero, or a non-negative number greater than or equal to the prefix length of the filter's prefix or less then or equal to 32. If - this value is set to zero, the filter will not use the 'le' route matching - behavior. If the 'ge' value is non-zero the the 'le' value must between the - 'ge' value and 32, inclusive. + this value is set to zero, the filter will not use the `le` route matching + behavior. If the `ge` value is non-zero the the `le` value must between the + `ge` value and 32, inclusive. """ self.action = action self.ge = ge @@ -2877,52 +2841,45 @@ class ActionEnum(str, Enum): -class RedundantGRETunnelCollection: +class ResourceGroupIdentity: """ - Collection of all tunnels for redundant gre connection. + The resource group to use. If unspecified, the account's [default resource + group](https://console.bluemix.net/apidocs/resource-manager#introduction) is used. - :attr List[RedundantGRETunnelReference] tunnels: Collection of all tunnels for - redundant gre connection. + :attr str id: The unique identifier for this resource group. """ def __init__( self, - tunnels: List['RedundantGRETunnelReference'], + id: str, ) -> None: """ - Initialize a RedundantGRETunnelCollection object. + Initialize a ResourceGroupIdentity object. - :param List[RedundantGRETunnelReference] tunnels: Collection of all tunnels - for redundant gre connection. + :param str id: The unique identifier for this resource group. """ - self.tunnels = tunnels + self.id = id @classmethod - def from_dict(cls, _dict: Dict) -> 'RedundantGRETunnelCollection': - """Initialize a RedundantGRETunnelCollection object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'ResourceGroupIdentity': + """Initialize a ResourceGroupIdentity object from a json dictionary.""" args = {} - if 'tunnels' in _dict: - args['tunnels'] = [RedundantGRETunnelReference.from_dict(v) for v in _dict.get('tunnels')] + if 'id' in _dict: + args['id'] = _dict.get('id') else: - raise ValueError('Required property \'tunnels\' not present in RedundantGRETunnelCollection JSON') + raise ValueError('Required property \'id\' not present in ResourceGroupIdentity JSON') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a RedundantGRETunnelCollection object from a json dictionary.""" + """Initialize a ResourceGroupIdentity 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, 'tunnels') and self.tunnels is not None: - tunnels_list = [] - for v in self.tunnels: - if isinstance(v, dict): - tunnels_list.append(v) - else: - tunnels_list.append(v.to_dict()) - _dict['tunnels'] = tunnels_list + if hasattr(self, 'id') and self.id is not None: + _dict['id'] = self.id return _dict def _to_dict(self): @@ -2930,396 +2887,67 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this RedundantGRETunnelCollection object.""" + """Return a `str` version of this ResourceGroupIdentity object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'RedundantGRETunnelCollection') -> bool: + def __eq__(self, other: 'ResourceGroupIdentity') -> 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: 'RedundantGRETunnelCollection') -> bool: + def __ne__(self, other: 'ResourceGroupIdentity') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other -class RedundantGRETunnelReference: +class ResourceGroupReference: """ - Details for a redundant GRE tunnel. + The resource group to use. If unspecified, the account's [default resource + group](https://console.bluemix.net/apidocs/resource-manager#introduction) is used. - :attr str base_network_type: The type of network the redundant GRE tunnel is - targeting. - :attr datetime created_at: The date and time that this GRE tunnel was created. - :attr str id: The unique identifier for this redundant GRE tunnel. - :attr int local_bgp_asn: Local network BGP ASN. It is assigned by IBM when the - tunnel is created. - :attr str local_gateway_ip: Local gateway IP address. - :attr str local_tunnel_ip: Local tunnel IP address. The local_tunnel_ip and - remote_tunnel_ip addresses must be in the same /30 network. Neither can be the - network nor broadcast addresses. - :attr int mtu: GRE tunnel MTU. - :attr str name: The user-defined name for this tunnel. - :attr str network_account_id: (optional) The ID of the account for cross account - Classic connections. This field is required when the GRE tunnel is in a - different account than the gateway and the base network is Classic. - :attr str network_id: (optional) The ID of the network VPC being connected via - this connection. - :attr int remote_bgp_asn: Remote network BGP ASN. The following ASN values are - reserved and unavailable 0, 13884, 36351, 64512-64513, 65100, 65200-65234, - 65402-65433, 65500 and 4201065000-4201065999. If 'remote_bgp_asn' is omitted on - create requests, IBM will assign an ASN. - :attr str remote_gateway_ip: Remote gateway IP address. - :attr str remote_tunnel_ip: Remote tunnel IP address. The local_tunnel_ip and - remote_tunnel_ip addresses must be in the same /30 network. Neither can be the - network nor broadcast addresses. - :attr str status: Tunnel's current configuration state. The list of enumerated - values for this property may expand in the future. Code and processes using this - field must tolerate unexpected values. - :attr datetime updated_at: The date and time that this tunnel was last updated. - :attr RgreTunnelZoneReference zone: The tunnel's location. The specified - availability zone must reside in the gateway's region. Use the IBM Cloud global - catalog to list zones within the desired region. + :attr str href: The URL for this resource group. + :attr str id: The unique identifier for this resource group. """ def __init__( self, - base_network_type: str, - created_at: datetime, + href: str, id: str, - local_bgp_asn: int, - local_gateway_ip: str, - local_tunnel_ip: str, - mtu: int, - name: str, - remote_bgp_asn: int, - remote_gateway_ip: str, - remote_tunnel_ip: str, - status: str, - updated_at: datetime, - zone: 'RgreTunnelZoneReference', - *, - network_account_id: str = None, - network_id: str = None, ) -> None: """ - Initialize a RedundantGRETunnelReference object. + Initialize a ResourceGroupReference object. - :param str base_network_type: The type of network the redundant GRE tunnel - is targeting. - :param datetime created_at: The date and time that this GRE tunnel was - created. - :param str id: The unique identifier for this redundant GRE tunnel. - :param int local_bgp_asn: Local network BGP ASN. It is assigned by IBM - when the tunnel is created. - :param str local_gateway_ip: Local gateway IP address. - :param str local_tunnel_ip: Local tunnel IP address. The local_tunnel_ip - and remote_tunnel_ip addresses must be in the same /30 network. Neither can - be the network nor broadcast addresses. - :param int mtu: GRE tunnel MTU. - :param str name: The user-defined name for this tunnel. - :param int remote_bgp_asn: Remote network BGP ASN. The following ASN values - are reserved and unavailable 0, 13884, 36351, 64512-64513, 65100, - 65200-65234, 65402-65433, 65500 and 4201065000-4201065999. If - 'remote_bgp_asn' is omitted on create requests, IBM will assign an ASN. - :param str remote_gateway_ip: Remote gateway IP address. - :param str remote_tunnel_ip: Remote tunnel IP address. The local_tunnel_ip - and remote_tunnel_ip addresses must be in the same /30 network. Neither can - be the network nor broadcast addresses. - :param str status: Tunnel's current configuration state. The list of - enumerated values for this property may expand in the future. Code and - processes using this field must tolerate unexpected values. - :param datetime updated_at: The date and time that this tunnel was last - updated. - :param RgreTunnelZoneReference zone: The tunnel's location. The specified - availability zone must reside in the gateway's region. Use the IBM Cloud - global catalog to list zones within the desired region. - :param str network_account_id: (optional) The ID of the account for cross - account Classic connections. This field is required when the GRE tunnel is - in a different account than the gateway and the base network is Classic. - :param str network_id: (optional) The ID of the network VPC being connected - via this connection. + :param str href: The URL for this resource group. + :param str id: The unique identifier for this resource group. """ - self.base_network_type = base_network_type - self.created_at = created_at + self.href = href self.id = id - self.local_bgp_asn = local_bgp_asn - self.local_gateway_ip = local_gateway_ip - self.local_tunnel_ip = local_tunnel_ip - self.mtu = mtu - self.name = name - self.network_account_id = network_account_id - self.network_id = network_id - self.remote_bgp_asn = remote_bgp_asn - self.remote_gateway_ip = remote_gateway_ip - self.remote_tunnel_ip = remote_tunnel_ip - self.status = status - self.updated_at = updated_at - self.zone = zone @classmethod - def from_dict(cls, _dict: Dict) -> 'RedundantGRETunnelReference': - """Initialize a RedundantGRETunnelReference object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'ResourceGroupReference': + """Initialize a ResourceGroupReference object from a json dictionary.""" args = {} - if 'base_network_type' in _dict: - args['base_network_type'] = _dict.get('base_network_type') - else: - raise ValueError('Required property \'base_network_type\' not present in RedundantGRETunnelReference JSON') - if 'created_at' in _dict: - args['created_at'] = string_to_datetime(_dict.get('created_at')) + if 'href' in _dict: + args['href'] = _dict.get('href') else: - raise ValueError('Required property \'created_at\' not present in RedundantGRETunnelReference JSON') + raise ValueError('Required property \'href\' not present in ResourceGroupReference JSON') if 'id' in _dict: args['id'] = _dict.get('id') else: - raise ValueError('Required property \'id\' not present in RedundantGRETunnelReference JSON') - if 'local_bgp_asn' in _dict: - args['local_bgp_asn'] = _dict.get('local_bgp_asn') - else: - raise ValueError('Required property \'local_bgp_asn\' not present in RedundantGRETunnelReference JSON') - if 'local_gateway_ip' in _dict: - args['local_gateway_ip'] = _dict.get('local_gateway_ip') - else: - raise ValueError('Required property \'local_gateway_ip\' not present in RedundantGRETunnelReference JSON') - if 'local_tunnel_ip' in _dict: - args['local_tunnel_ip'] = _dict.get('local_tunnel_ip') - else: - raise ValueError('Required property \'local_tunnel_ip\' not present in RedundantGRETunnelReference JSON') - if 'mtu' in _dict: - args['mtu'] = _dict.get('mtu') - else: - raise ValueError('Required property \'mtu\' not present in RedundantGRETunnelReference JSON') - if 'name' in _dict: - args['name'] = _dict.get('name') - else: - raise ValueError('Required property \'name\' not present in RedundantGRETunnelReference JSON') - if 'network_account_id' in _dict: - args['network_account_id'] = _dict.get('network_account_id') - if 'network_id' in _dict: - args['network_id'] = _dict.get('network_id') - if 'remote_bgp_asn' in _dict: - args['remote_bgp_asn'] = _dict.get('remote_bgp_asn') - else: - raise ValueError('Required property \'remote_bgp_asn\' not present in RedundantGRETunnelReference JSON') - if 'remote_gateway_ip' in _dict: - args['remote_gateway_ip'] = _dict.get('remote_gateway_ip') - else: - raise ValueError('Required property \'remote_gateway_ip\' not present in RedundantGRETunnelReference JSON') - if 'remote_tunnel_ip' in _dict: - args['remote_tunnel_ip'] = _dict.get('remote_tunnel_ip') - else: - raise ValueError('Required property \'remote_tunnel_ip\' not present in RedundantGRETunnelReference JSON') - if 'status' in _dict: - args['status'] = _dict.get('status') - else: - raise ValueError('Required property \'status\' not present in RedundantGRETunnelReference JSON') - if 'updated_at' in _dict: - args['updated_at'] = string_to_datetime(_dict.get('updated_at')) - else: - raise ValueError('Required property \'updated_at\' not present in RedundantGRETunnelReference JSON') - if 'zone' in _dict: - args['zone'] = RgreTunnelZoneReference.from_dict(_dict.get('zone')) - else: - raise ValueError('Required property \'zone\' not present in RedundantGRETunnelReference JSON') + raise ValueError('Required property \'id\' not present in ResourceGroupReference JSON') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a RedundantGRETunnelReference object from a json dictionary.""" + """Initialize a ResourceGroupReference 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, 'base_network_type') and self.base_network_type is not None: - _dict['base_network_type'] = self.base_network_type - 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, 'local_bgp_asn') and self.local_bgp_asn is not None: - _dict['local_bgp_asn'] = self.local_bgp_asn - if hasattr(self, 'local_gateway_ip') and self.local_gateway_ip is not None: - _dict['local_gateway_ip'] = self.local_gateway_ip - if hasattr(self, 'local_tunnel_ip') and self.local_tunnel_ip is not None: - _dict['local_tunnel_ip'] = self.local_tunnel_ip - if hasattr(self, 'mtu') and self.mtu is not None: - _dict['mtu'] = self.mtu - if hasattr(self, 'name') and self.name is not None: - _dict['name'] = self.name - if hasattr(self, 'network_account_id') and self.network_account_id is not None: - _dict['network_account_id'] = self.network_account_id - if hasattr(self, 'network_id') and self.network_id is not None: - _dict['network_id'] = self.network_id - if hasattr(self, 'remote_bgp_asn') and self.remote_bgp_asn is not None: - _dict['remote_bgp_asn'] = self.remote_bgp_asn - if hasattr(self, 'remote_gateway_ip') and self.remote_gateway_ip is not None: - _dict['remote_gateway_ip'] = self.remote_gateway_ip - if hasattr(self, 'remote_tunnel_ip') and self.remote_tunnel_ip is not None: - _dict['remote_tunnel_ip'] = self.remote_tunnel_ip - if hasattr(self, 'status') and self.status is not None: - _dict['status'] = self.status - if hasattr(self, 'updated_at') and self.updated_at is not None: - _dict['updated_at'] = datetime_to_string(self.updated_at) - if hasattr(self, 'zone') and self.zone is not None: - if isinstance(self.zone, dict): - _dict['zone'] = self.zone - else: - _dict['zone'] = self.zone.to_dict() - 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 RedundantGRETunnelReference object.""" - return json.dumps(self.to_dict(), indent=2) - - def __eq__(self, other: 'RedundantGRETunnelReference') -> 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: 'RedundantGRETunnelReference') -> bool: - """Return `true` when self and other are not equal, false otherwise.""" - return not self == other - - class BaseNetworkTypeEnum(str, Enum): - """ - The type of network the redundant GRE tunnel is targeting. - """ - - CLASSIC = 'classic' - VPC = 'vpc' - - - class StatusEnum(str, Enum): - """ - Tunnel's current configuration state. The list of enumerated values for this - property may expand in the future. Code and processes using this field must - tolerate unexpected values. - """ - - ATTACHED = 'attached' - FAILED = 'failed' - PENDING = 'pending' - DELETING = 'deleting' - DETACHING = 'detaching' - DETACHED = 'detached' - SUSPENDING = 'suspending' - SUSPENDED = 'suspended' - - - -class ResourceGroupIdentity: - """ - The resource group to use. If unspecified, the account's [default resource - group](https://console.bluemix.net/apidocs/resource-manager#introduction) is used. - - :attr str id: The unique identifier for this resource group. - """ - - def __init__( - self, - id: str, - ) -> None: - """ - Initialize a ResourceGroupIdentity object. - - :param str id: The unique identifier for this resource group. - """ - self.id = id - - @classmethod - def from_dict(cls, _dict: Dict) -> 'ResourceGroupIdentity': - """Initialize a ResourceGroupIdentity object from a json dictionary.""" - args = {} - if 'id' in _dict: - args['id'] = _dict.get('id') - else: - raise ValueError('Required property \'id\' not present in ResourceGroupIdentity JSON') - return cls(**args) - - @classmethod - def _from_dict(cls, _dict): - """Initialize a ResourceGroupIdentity 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, 'id') and self.id is not None: - _dict['id'] = self.id - 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 ResourceGroupIdentity object.""" - return json.dumps(self.to_dict(), indent=2) - - def __eq__(self, other: 'ResourceGroupIdentity') -> 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: 'ResourceGroupIdentity') -> bool: - """Return `true` when self and other are not equal, false otherwise.""" - return not self == other - - -class ResourceGroupReference: - """ - The resource group to use. If unspecified, the account's [default resource - group](https://console.bluemix.net/apidocs/resource-manager#introduction) is used. - - :attr str href: The URL for this resource group. - :attr str id: The unique identifier for this resource group. - """ - - def __init__( - self, - href: str, - id: str, - ) -> None: - """ - Initialize a ResourceGroupReference object. - - :param str href: The URL for this resource group. - :param str id: The unique identifier for this resource group. - """ - self.href = href - self.id = id - - @classmethod - def from_dict(cls, _dict: Dict) -> 'ResourceGroupReference': - """Initialize a ResourceGroupReference object from a json dictionary.""" - args = {} - if 'href' in _dict: - args['href'] = _dict.get('href') - else: - raise ValueError('Required property \'href\' not present in ResourceGroupReference JSON') - if 'id' in _dict: - args['id'] = _dict.get('id') - else: - raise ValueError('Required property \'id\' not present in ResourceGroupReference JSON') - return cls(**args) - - @classmethod - def _from_dict(cls, _dict): - """Initialize a ResourceGroupReference 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, 'href') and self.href is not None: - _dict['href'] = self.href + if hasattr(self, 'href') and self.href is not None: + _dict['href'] = self.href if hasattr(self, 'id') and self.id is not None: _dict['id'] = self.id return _dict @@ -3343,66 +2971,6 @@ def __ne__(self, other: 'ResourceGroupReference') -> bool: return not self == other -class RgreTunnelZoneReference: - """ - The tunnel's location. The specified availability zone must reside in the gateway's - region. Use the IBM Cloud global catalog to list zones within the desired region. - - :attr str name: Availability zone name. - """ - - def __init__( - self, - name: str, - ) -> None: - """ - Initialize a RgreTunnelZoneReference object. - - :param str name: Availability zone name. - """ - self.name = name - - @classmethod - def from_dict(cls, _dict: Dict) -> 'RgreTunnelZoneReference': - """Initialize a RgreTunnelZoneReference object from a json dictionary.""" - args = {} - if 'name' in _dict: - args['name'] = _dict.get('name') - else: - raise ValueError('Required property \'name\' not present in RgreTunnelZoneReference JSON') - return cls(**args) - - @classmethod - def _from_dict(cls, _dict): - """Initialize a RgreTunnelZoneReference 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 RgreTunnelZoneReference object.""" - return json.dumps(self.to_dict(), indent=2) - - def __eq__(self, other: 'RgreTunnelZoneReference') -> 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: 'RgreTunnelZoneReference') -> bool: - """Return `true` when self and other are not equal, false otherwise.""" - return not self == other - - class RouteReport: """ route report. @@ -3540,6 +3108,7 @@ class StatusEnum(str, Enum): COMPLETE = 'complete' PENDING = 'pending' + FAILED = 'failed' @@ -4172,7 +3741,7 @@ class TSLocation: region, a single data center, or a point of presence. :attr List[TSLocalLocation] local_connection_locations: The set of network locations that are considered local for this Transit Gateway location. - :attr List[ZoneReferenceCollection] zones: List of valid zones for GRE tunnels. + :attr List[ZoneReference] zones: List of valid zones for GRE tunnels. """ def __init__( @@ -4181,7 +3750,7 @@ def __init__( name: str, type: str, local_connection_locations: List['TSLocalLocation'], - zones: List['ZoneReferenceCollection'], + zones: List['ZoneReference'], ) -> None: """ Initialize a TSLocation object. @@ -4193,8 +3762,7 @@ def __init__( region, a single data center, or a point of presence. :param List[TSLocalLocation] local_connection_locations: The set of network locations that are considered local for this Transit Gateway location. - :param List[ZoneReferenceCollection] zones: List of valid zones for GRE - tunnels. + :param List[ZoneReference] zones: List of valid zones for GRE tunnels. """ self.billing_location = billing_location self.name = name @@ -4223,7 +3791,7 @@ def from_dict(cls, _dict: Dict) -> 'TSLocation': else: raise ValueError('Required property \'local_connection_locations\' not present in TSLocation JSON') if 'zones' in _dict: - args['zones'] = [ZoneReferenceCollection.from_dict(v) for v in _dict.get('zones')] + args['zones'] = [ZoneReference.from_dict(v) for v in _dict.get('zones')] else: raise ValueError('Required property \'zones\' not present in TSLocation JSON') return cls(**args) @@ -4370,30 +3938,30 @@ class TransitConnection: targeting. :attr str name: The user-defined name for this transit gateway connection. :attr str network_id: (optional) The ID of the network being connected via this - connection. This field is required for some types, such as 'vpc', - 'power_virtual_server', 'directlink' and 'redundant_gre'. For network types - 'vpc', 'redundant_gre', 'power_virtual_server' and 'directlink' this is the CRN - of the VPC / PowerVS / Direct Link gateway respectively. + 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. :attr str network_type: Defines what type of network is connected via this connection. The list of enumerated values for this property may expand in the future. Code and processes using this field must tolerate unexpected values. - :attr str id: The unique identifier for this Transit Gateway Connection. - :attr str base_connection_id: (optional) Deprecated: network_type 'gre_tunnel' - connections use 'base_connection_id' to specify the ID of a network_type - 'classic' connection the tunnel is configured over. The specified connection - must reside in the same transit gateway and be in an active state. The 'classic' - connection cannot be deleted until any 'gre_tunnel' connections using it are + :attr str id: The unique identifier for this Transit Gateway connection. + :attr str base_connection_id: (optional) Deprecated: network_type `gre_tunnel` + connections use `base_connection_id` to specify the ID of a network_type + `classic` connection the tunnel is configured over. The specified connection + must reside in the same transit gateway and be in an active state. The `classic` + connection cannot be deleted until any `gre_tunnel` connections using it are deleted. This field only applies to and is required for network type - 'gre_tunnel' connections. + `gre_tunnel` connections. :attr datetime created_at: The date and time that this connection was created. :attr int local_bgp_asn: (optional) Local network BGP ASN. This field only - applies to network type 'gre_tunnel' and 'unbound_gre_tunnel' connections. + applies to network type `gre_tunnel` and `unbound_gre_tunnel` connections. :attr str local_gateway_ip: (optional) Local gateway IP address. This field - only applies to network type 'gre_tunnel' and 'unbound_gre_tunnel' connections. + only applies to network type `gre_tunnel` and `unbound_gre_tunnel` connections. :attr str local_tunnel_ip: (optional) Local tunnel IP address. This field only - applies to network type 'gre_tunnel' and 'unbound_gre_tunnel' connections. + applies to network type `gre_tunnel` and `unbound_gre_tunnel` connections. :attr int mtu: (optional) GRE tunnel MTU. This field only applies to network - type 'gre_tunnel' and 'unbound_gre_tunnel' connections. + type `gre_tunnel` and `unbound_gre_tunnel` connections. :attr str network_account_id: (optional) The ID of the account which owns the connected network. Generally only used if the network is in a different IBM Cloud account than the gateway. @@ -4401,16 +3969,16 @@ class TransitConnection: (optional) Array of prefix route filters for a transit gateway connection. This is order dependent with those first in the array being applied first, and those at the end of the array is applied last, or just before the default. - This field does not apply to the 'redundant_gre' network type. + This field does not apply to the `redundant_gre` network types. :attr str prefix_filters_default: (optional) Default setting of permit or deny which applies to any routes that don't match a specified filter. - This field does not apply to the 'redundant_gre' network type. + This field does not apply to the `redundant_gre` network types. :attr int remote_bgp_asn: (optional) Remote network BGP ASN. This field only - applies to network type 'gre_tunnel' and 'unbound_gre_tunnel' connections. + applies to network type `gre_tunnel` and `unbound_gre_tunnel` connections. :attr str remote_gateway_ip: (optional) Remote gateway IP address. This field - only applies to network type 'gre_tunnel' and 'unbound_gre_tunnel' connections. + only applies to network type `gre_tunnel` and `unbound_gre_tunnel` connections. :attr str remote_tunnel_ip: (optional) Remote tunnel IP address. This field - only applies to network type 'gre_tunnel' and 'unbound_gre_tunnel' connections. + only applies to network type `gre_tunnel` and `unbound_gre_tunnel` connections. :attr str request_status: Only visible for cross account connections, this field represents the status of a connection request between IBM Cloud accounts. The list of enumerated values for this property may expand in the future. Code and @@ -4419,12 +3987,11 @@ class TransitConnection: enumerated values for this property may expand in the future. Code and processes using this field must tolerate unexpected values. :attr TransitGatewayReference transit_gateway: Transit gateway reference. - :attr List[TransitGatewayRedundantGRETunnelReference] tunnels: (optional) - Collection of all tunnels for 'redundant_gre' connection. + :attr List[TransitGatewayTunnel] tunnels: (optional) Collection of all tunnels + for `redundant_gre` and `vpn_gateway` connections. :attr datetime updated_at: The date and time that this connection was last updated. - :attr GreTunnelZoneReference zone: (optional) Location of GRE tunnel. This - field only applies to network type 'gre_tunnel' connections. + :attr ZoneReference zone: (optional) Availability zone reference. """ def __init__( @@ -4451,8 +4018,8 @@ def __init__( remote_bgp_asn: int = None, remote_gateway_ip: str = None, remote_tunnel_ip: str = None, - tunnels: List['TransitGatewayRedundantGRETunnelReference'] = None, - zone: 'GreTunnelZoneReference' = None, + tunnels: List['TransitGatewayTunnel'] = None, + zone: 'ZoneReference' = None, ) -> None: """ Initialize a TransitConnection object. @@ -4462,7 +4029,7 @@ def __init__( connection. The list of enumerated values for this property may expand in the future. Code and processes using this field must tolerate unexpected values. - :param str id: The unique identifier for this Transit Gateway Connection. + :param str id: The unique identifier for this Transit Gateway connection. :param datetime created_at: The date and time that this connection was created. :param str request_status: Only visible for cross account connections, this @@ -4479,28 +4046,29 @@ def __init__( :param str base_network_type: (optional) The type of network the GRE tunnel is targeting. :param str network_id: (optional) The ID of the network being connected via - this connection. This field is required for some types, such as 'vpc', - 'power_virtual_server', 'directlink' and 'redundant_gre'. For network types - 'vpc', 'redundant_gre', 'power_virtual_server' and 'directlink' this is the - CRN of the VPC / PowerVS / Direct Link gateway respectively. + this connection. This field is required for some types, such as `vpc`, + `power_virtual_server`, `directlink`, `vpn_gateway` and `redundant_gre`. + For network types `vpc`, `redundant_gre`, `power_virtual_server` and + `directlink` this is the CRN of the VPC / PowerVS / VDC / Direct Link + gateway respectively. :param str base_connection_id: (optional) Deprecated: network_type - 'gre_tunnel' connections use 'base_connection_id' to specify the ID of a - network_type 'classic' connection the tunnel is configured over. The + `gre_tunnel` connections use `base_connection_id` to specify the ID of a + network_type `classic` connection the tunnel is configured over. The specified connection must reside in the same transit gateway and be in an - active state. The 'classic' connection cannot be deleted until any - 'gre_tunnel' connections using it are deleted. This field only applies to - and is required for network type 'gre_tunnel' connections. + 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 int local_bgp_asn: (optional) Local network BGP ASN. This field - only applies to network type 'gre_tunnel' and 'unbound_gre_tunnel' + only applies to network type `gre_tunnel` and `unbound_gre_tunnel` connections. :param str local_gateway_ip: (optional) Local gateway IP address. This - field only applies to network type 'gre_tunnel' and 'unbound_gre_tunnel' + field only applies to network type `gre_tunnel` and `unbound_gre_tunnel` connections. :param str local_tunnel_ip: (optional) Local tunnel IP address. This field - only applies to network type 'gre_tunnel' and 'unbound_gre_tunnel' + only applies to network type `gre_tunnel` and `unbound_gre_tunnel` connections. :param int mtu: (optional) GRE tunnel MTU. This field only applies to - network type 'gre_tunnel' and 'unbound_gre_tunnel' connections. + network type `gre_tunnel` and `unbound_gre_tunnel` connections. :param str network_account_id: (optional) The ID of the account which owns the connected network. Generally only used if the network is in a different IBM Cloud account than the gateway. @@ -4509,23 +4077,22 @@ def __init__( This is order dependent with those first in the array being applied first, and those at the end of the array is applied last, or just before the default. - This field does not apply to the 'redundant_gre' network type. + This field does not apply to the `redundant_gre` network types. :param str prefix_filters_default: (optional) Default setting of permit or deny which applies to any routes that don't match a specified filter. - This field does not apply to the 'redundant_gre' network type. + This field does not apply to the `redundant_gre` network types. :param int remote_bgp_asn: (optional) Remote network BGP ASN. This field - only applies to network type 'gre_tunnel' and 'unbound_gre_tunnel' + only applies to network type `gre_tunnel` and `unbound_gre_tunnel` connections. :param str remote_gateway_ip: (optional) Remote gateway IP address. This - field only applies to network type 'gre_tunnel' and 'unbound_gre_tunnel' + field only applies to network type `gre_tunnel` and `unbound_gre_tunnel` connections. :param str remote_tunnel_ip: (optional) Remote tunnel IP address. This - field only applies to network type 'gre_tunnel' and 'unbound_gre_tunnel' + field only applies to network type `gre_tunnel` and `unbound_gre_tunnel` connections. - :param List[TransitGatewayRedundantGRETunnelReference] tunnels: (optional) - Collection of all tunnels for 'redundant_gre' connection. - :param GreTunnelZoneReference zone: (optional) Location of GRE tunnel. - This field only applies to network type 'gre_tunnel' connections. + :param List[TransitGatewayTunnel] tunnels: (optional) Collection of all + tunnels for `redundant_gre` and `vpn_gateway` connections. + :param ZoneReference zone: (optional) Availability zone reference. """ self.base_network_type = base_network_type self.name = name @@ -4610,13 +4177,13 @@ def from_dict(cls, _dict: Dict) -> 'TransitConnection': else: raise ValueError('Required property \'transit_gateway\' not present in TransitConnection JSON') if 'tunnels' in _dict: - args['tunnels'] = [TransitGatewayRedundantGRETunnelReference.from_dict(v) for v in _dict.get('tunnels')] + args['tunnels'] = [TransitGatewayTunnel.from_dict(v) for v in _dict.get('tunnels')] if 'updated_at' in _dict: args['updated_at'] = string_to_datetime(_dict.get('updated_at')) else: raise ValueError('Required property \'updated_at\' not present in TransitConnection JSON') if 'zone' in _dict: - args['zone'] = GreTunnelZoneReference.from_dict(_dict.get('zone')) + args['zone'] = ZoneReference.from_dict(_dict.get('zone')) return cls(**args) @classmethod @@ -4734,13 +4301,14 @@ class NetworkTypeEnum(str, Enum): VPC = 'vpc' POWER_VIRTUAL_SERVER = 'power_virtual_server' REDUNDANT_GRE = 'redundant_gre' + VPN_GATEWAY = 'vpn_gateway' class PrefixFiltersDefaultEnum(str, Enum): """ Default setting of permit or deny which applies to any routes that don't match a specified filter. - This field does not apply to the 'redundant_gre' network type. + This field does not apply to the `redundant_gre` network types. """ PERMIT = 'permit' @@ -4892,12 +4460,18 @@ class TransitGateway: """ Details of a Transit Gateway. - :attr str id: The unique identifier for this Transit Gateway. - :attr str crn: The CRN for this Transit Gateway. - :attr str name: A human readable name for the transit gateway. - :attr str location: Location of Transit Gateway Services. + :attr int connection_count: (optional) The number of connections associated with + this Transit Gateway. + :attr bool connection_needs_attention: (optional) Indicates if this Transit + Gateway has a connection that needs attention (Such as cross account approval). :attr datetime created_at: The date and time that this gateway was created. + :attr str crn: (optional) Cloud Resource Name of a transit gateway. :attr bool global_: Allow global routing for a Transit Gateway. + :attr bool gre_enhanced_route_propagation: (optional) Allow GRE Enhanced Route + Propagation on this gateway. + :attr str id: A unique identifier for this transit gateway. + :attr str location: Location of Transit Gateway Services. + :attr str name: A human readable name for the transit gateway. :attr 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 @@ -4911,30 +4485,40 @@ class TransitGateway: def __init__( self, - id: str, - crn: str, - name: str, - location: str, created_at: datetime, global_: bool, + id: str, + location: str, + name: str, status: str, *, + connection_count: int = None, + connection_needs_attention: bool = None, + crn: str = None, + gre_enhanced_route_propagation: bool = None, resource_group: 'ResourceGroupReference' = None, updated_at: datetime = None, ) -> None: """ Initialize a TransitGateway object. - :param str id: The unique identifier for this Transit Gateway. - :param str crn: The CRN for this Transit Gateway. - :param str name: A human readable name for the transit gateway. - :param str location: Location of Transit Gateway Services. :param datetime created_at: The date and time that this gateway was created. :param bool global_: Allow global routing for a Transit Gateway. + :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 status: The status of the Transit Gateway. The list of enumerated values for this property may expand in the future. Code and processes using this field must tolerate unexpected values. + :param int connection_count: (optional) The number of connections + associated with this Transit Gateway. + :param bool connection_needs_attention: (optional) Indicates if this + Transit Gateway has a connection that needs attention (Such as cross + account approval). + :param str crn: (optional) Cloud Resource Name of a transit gateway. + :param bool gre_enhanced_route_propagation: (optional) Allow GRE Enhanced + Route Propagation on this 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) @@ -4942,12 +4526,15 @@ def __init__( :param datetime updated_at: (optional) The date and time that this gateway was last updated. """ - self.id = id - self.crn = crn - self.name = name - self.location = location + self.connection_count = connection_count + self.connection_needs_attention = connection_needs_attention self.created_at = created_at + self.crn = crn self.global_ = global_ + self.gre_enhanced_route_propagation = gre_enhanced_route_propagation + self.id = id + self.location = location + self.name = name self.resource_group = resource_group self.status = status self.updated_at = updated_at @@ -4956,30 +4543,34 @@ def __init__( def from_dict(cls, _dict: Dict) -> 'TransitGateway': """Initialize a TransitGateway object from a json dictionary.""" args = {} - if 'id' in _dict: - args['id'] = _dict.get('id') + if 'connection_count' in _dict: + args['connection_count'] = _dict.get('connection_count') + if 'connection_needs_attention' in _dict: + args['connection_needs_attention'] = _dict.get('connection_needs_attention') + if 'created_at' in _dict: + args['created_at'] = string_to_datetime(_dict.get('created_at')) else: - raise ValueError('Required property \'id\' not present in TransitGateway JSON') + raise ValueError('Required property \'created_at\' not present in TransitGateway JSON') if 'crn' in _dict: args['crn'] = _dict.get('crn') + if 'global' in _dict: + args['global_'] = _dict.get('global') else: - raise ValueError('Required property \'crn\' not present in TransitGateway JSON') - if 'name' in _dict: - args['name'] = _dict.get('name') + raise ValueError('Required property \'global\' not present in TransitGateway JSON') + if 'gre_enhanced_route_propagation' in _dict: + args['gre_enhanced_route_propagation'] = _dict.get('gre_enhanced_route_propagation') + if 'id' in _dict: + args['id'] = _dict.get('id') else: - raise ValueError('Required property \'name\' not present in TransitGateway JSON') + raise ValueError('Required property \'id\' not present in TransitGateway JSON') if 'location' in _dict: args['location'] = _dict.get('location') else: raise ValueError('Required property \'location\' not present in TransitGateway JSON') - if 'created_at' in _dict: - args['created_at'] = string_to_datetime(_dict.get('created_at')) - else: - raise ValueError('Required property \'created_at\' not present in TransitGateway JSON') - if 'global' in _dict: - args['global_'] = _dict.get('global') + if 'name' in _dict: + args['name'] = _dict.get('name') else: - raise ValueError('Required property \'global\' not present in TransitGateway JSON') + raise ValueError('Required property \'name\' not present in TransitGateway JSON') if 'resource_group' in _dict: args['resource_group'] = ResourceGroupReference.from_dict(_dict.get('resource_group')) if 'status' in _dict: @@ -4998,18 +4589,24 @@ def _from_dict(cls, _dict): def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} - if hasattr(self, 'id') and self.id is not None: - _dict['id'] = self.id - if hasattr(self, 'crn') and self.crn is not None: - _dict['crn'] = self.crn - if hasattr(self, 'name') and self.name is not None: - _dict['name'] = self.name - if hasattr(self, 'location') and self.location is not None: - _dict['location'] = self.location + if hasattr(self, 'connection_count') and self.connection_count is not None: + _dict['connection_count'] = self.connection_count + if hasattr(self, 'connection_needs_attention') and self.connection_needs_attention is not None: + _dict['connection_needs_attention'] = self.connection_needs_attention if hasattr(self, 'created_at') and self.created_at is not None: _dict['created_at'] = datetime_to_string(self.created_at) + if hasattr(self, 'crn') and self.crn is not None: + _dict['crn'] = self.crn if hasattr(self, 'global_') and self.global_ is not None: _dict['global'] = self.global_ + if hasattr(self, 'gre_enhanced_route_propagation') and self.gre_enhanced_route_propagation is not None: + _dict['gre_enhanced_route_propagation'] = self.gre_enhanced_route_propagation + if hasattr(self, 'id') and self.id is not None: + _dict['id'] = self.id + if hasattr(self, 'location') and self.location is not None: + _dict['location'] = self.location + if hasattr(self, 'name') and self.name is not None: + _dict['name'] = self.name if hasattr(self, 'resource_group') and self.resource_group is not None: if isinstance(self.resource_group, dict): _dict['resource_group'] = self.resource_group @@ -5290,51 +4887,65 @@ class TransitGatewayConnectionCust: """ Connection included in transit gateway. - :attr str base_network_type: (optional) The type of network the GRE tunnel is - targeting. - :attr str name: The user-defined name for this transit gateway connection. - :attr str network_id: (optional) The ID of the network being connected via this - connection. This field is required for some types, such as 'vpc', - 'power_virtual_server', 'directlink' and 'redundant_gre'. For network types - 'vpc', 'redundant_gre', 'power_virtual_server' and 'directlink' this is the CRN - of the VPC / PowerVS / Direct Link gateway respectively. - :attr str network_type: Defines what type of network is connected via this - connection. The list of enumerated values for this property may expand in the - future. Code and processes using this field must tolerate unexpected values. - :attr str id: The unique identifier for this Transit Gateway Connection. - :attr str base_connection_id: (optional) Deprecated: network_type 'gre_tunnel' - connections use 'base_connection_id' to specify the ID of a network_type - 'classic' connection the tunnel is configured over. The specified connection - must reside in the same transit gateway and be in an active state. The 'classic' - connection cannot be deleted until any 'gre_tunnel' connections using it are + :attr str base_connection_id: (optional) Deprecated: network_type `gre_tunnel` + connections use `base_connection_id` to specify the ID of a network_type + `classic` connection the tunnel is configured over. The specified connection + must reside in the same transit gateway and be in an active state. The `classic` + connection cannot be deleted until any `gre_tunnel` connections using it are deleted. This field only applies to and is required for network type - 'gre_tunnel' connections. + `gre_tunnel` connections. + :attr str base_network_type: (optional) The type of network the Unbound GRE + tunnel is targeting. This field is required for network type + `unbound_gre_tunnel` and must be set to `classic`. For a `redundant_gre` + network type, the value is required and can be either VPC or Classic. This field + is required to be unspecified for network type `classic`, `directlink`, `vpc`, + `power_virtual_server`, `vpn_gateway` and `gre_tunnel` connections. + :attr str cidr: (optional) network_type 'vpn_gateway' connections use 'cidr' to + specify the CIDR to use for the VPN GRE tunnels. :attr datetime created_at: The date and time that this connection was created. + :attr str id: The unique identifier for this Transit Gateway connection. :attr int local_bgp_asn: (optional) Local network BGP ASN. This field only - applies to network type 'gre_tunnel' and 'unbound_gre_tunnel' connections. + applies to network type `gre_tunnel` and `unbound_gre_tunnel` connections. :attr str local_gateway_ip: (optional) Local gateway IP address. This field - only applies to network type 'gre_tunnel' and 'unbound_gre_tunnel' connections. + only applies to network type `gre_tunnel` and `unbound_gre_tunnel` connections. :attr str local_tunnel_ip: (optional) Local tunnel IP address. This field only - applies to network type 'gre_tunnel' and 'unbound_gre_tunnel' connections. + applies to network type `gre_tunnel` and `unbound_gre_tunnel` connections. :attr int mtu: (optional) GRE tunnel MTU. This field only applies to network - type 'gre_tunnel' and 'unbound_gre_tunnel' connections. + type `gre_tunnel` and `unbound_gre_tunnel` connections. + :attr str name: (optional) The user-defined name for this transit gateway + connection. Network type `vpc` connections are defaulted to the name of the + VPC. Network type `classic` connections are named `classic`. + This field is required for network type `power_virtual_server`, `directlink`, + `gre_tunnel`, `unbound_gre_tunnel`, `vpn_gateway` and `redundant_gre` + connections. + This field is optional for network type `classic`, `vpc` connections. :attr str network_account_id: (optional) The ID of the account which owns the connected network. Generally only used if the network is in a different IBM Cloud account than the gateway. + :attr str network_id: (optional) The ID of the network being connected via this + connection. For network types `vpc`,`power_virtual_server`, `directlink` and + `vpn_gateway` this is the CRN of the VPC / PowerVS / VDC / Direct Link / VPN + gateway respectively. This field is required for network type `vpc`, + `power_virtual_server`, `vpn_gateway`, and `directlink` connections. It is also + required for `redundant_gre` connections when the base_network_type is set to + VPC. This field is required to be unspecified for network type `classic`, + `gre_tunnel` and `unbound_gre_tunnel` connections. + :attr str network_type: (optional) Defines what type of network is connected via + this connection. :attr List[TransitGatewayConnectionPrefixFilterReference] prefix_filters: (optional) Array of prefix route filters for a transit gateway connection. This is order dependent with those first in the array being applied first, and those at the end of the array is applied last, or just before the default. This field - does not apply to the 'redundant_gre' network type. + does not apply to the `redundant_gre` network type. :attr str prefix_filters_default: (optional) Default setting of permit or deny which applies to any routes that don't match a specified filter. This field does - not apply to the 'redundant_gre' network type. + not apply to the `redundant_gre` network type. :attr int remote_bgp_asn: (optional) Remote network BGP ASN. This field only - applies to network type 'gre_tunnel' and 'unbound_gre_tunnel' connections. + applies to network type `gre_tunnel` and `unbound_gre_tunnel` connections. :attr str remote_gateway_ip: (optional) Remote gateway IP address. This field - only applies to network type 'gre_tunnel' and 'unbound_gre_tunnel' connections. + only applies to network type `gre_tunnel` and `unbound_gre_tunnel` connections. :attr str remote_tunnel_ip: (optional) Remote tunnel IP address. This field - only applies to network type 'gre_tunnel' and 'unbound_gre_tunnel' connections. + only applies to network type `gre_tunnel` and `unbound_gre_tunnel` connections. :attr str request_status: Only visible for cross account connections, this field represents the status of a connection request between IBM Cloud accounts. The list of enumerated values for this property may expand in the future. Code and @@ -5342,51 +4953,47 @@ class TransitGatewayConnectionCust: :attr str status: Connection's current configuration state. The list of enumerated values for this property may expand in the future. Code and processes using this field must tolerate unexpected values. - :attr List[TransitGatewayRedundantGRETunnelReference] tunnels: (optional) - Collection of all tunnels for 'redundant_gre' connection. + :attr List[TransitGatewayTunnel] tunnels: (optional) Collection of all tunnels + for `redundant_gre` and `vpn_gateway` connections. :attr datetime updated_at: The date and time that this connection was last updated. - :attr GreTunnelZoneReference zone: (optional) Location of GRE tunnel. This - field only applies to network type 'gre_tunnel' connections. + :attr ZoneReference zone: (optional) Location of GRE tunnel. This field is + required for network type `gre_tunnel` and `vpn_gateway` connections. """ def __init__( self, - name: str, - network_type: str, - id: str, created_at: datetime, + id: str, request_status: str, status: str, updated_at: datetime, *, - base_network_type: str = None, - network_id: str = None, base_connection_id: str = None, + base_network_type: str = None, + cidr: str = None, local_bgp_asn: int = None, local_gateway_ip: str = None, local_tunnel_ip: str = None, mtu: int = None, + name: str = None, network_account_id: str = None, + network_id: str = None, + network_type: str = None, prefix_filters: List['TransitGatewayConnectionPrefixFilterReference'] = None, prefix_filters_default: str = None, remote_bgp_asn: int = None, remote_gateway_ip: str = None, remote_tunnel_ip: str = None, - tunnels: List['TransitGatewayRedundantGRETunnelReference'] = None, - zone: 'GreTunnelZoneReference' = None, + tunnels: List['TransitGatewayTunnel'] = None, + zone: 'ZoneReference' = None, ) -> None: """ Initialize a TransitGatewayConnectionCust object. - :param str name: The user-defined name for this transit gateway connection. - :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. - :param str id: The unique identifier for this Transit Gateway Connection. :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 str request_status: Only visible for cross account connections, this field represents the status of a connection request between IBM Cloud accounts. The list of enumerated values for this property may expand in the @@ -5397,68 +5004,89 @@ def __init__( processes using this field must tolerate unexpected values. :param datetime updated_at: The date and time that this connection was last updated. - :param str base_network_type: (optional) The type of network the GRE tunnel - is targeting. - :param str network_id: (optional) The ID of the network being connected via - this connection. This field is required for some types, such as 'vpc', - 'power_virtual_server', 'directlink' and 'redundant_gre'. For network types - 'vpc', 'redundant_gre', 'power_virtual_server' and 'directlink' this is the - CRN of the VPC / PowerVS / Direct Link gateway respectively. :param str base_connection_id: (optional) Deprecated: network_type - 'gre_tunnel' connections use 'base_connection_id' to specify the ID of a - network_type 'classic' connection the tunnel is configured over. The + `gre_tunnel` connections use `base_connection_id` to specify the ID of a + network_type `classic` connection the tunnel is configured over. The specified connection must reside in the same transit gateway and be in an - active state. The 'classic' connection cannot be deleted until any - 'gre_tunnel' connections using it are deleted. This field only applies to - and is required for network type 'gre_tunnel' connections. + active state. The `classic` connection cannot be deleted until any + `gre_tunnel` connections using it are deleted. This field only applies to + and is required for network type `gre_tunnel` connections. + :param str base_network_type: (optional) The type of network the Unbound + GRE tunnel is targeting. This field is required for network type + `unbound_gre_tunnel` and must be set to `classic`. For a `redundant_gre` + network type, the value is required and can be either VPC or Classic. This + field is required to be unspecified for network type `classic`, + `directlink`, `vpc`, `power_virtual_server`, `vpn_gateway` and `gre_tunnel` + connections. + :param str cidr: (optional) network_type 'vpn_gateway' connections use + 'cidr' to specify the CIDR to use for the VPN GRE tunnels. :param int local_bgp_asn: (optional) Local network BGP ASN. This field - only applies to network type 'gre_tunnel' and 'unbound_gre_tunnel' + only applies to network type `gre_tunnel` and `unbound_gre_tunnel` connections. :param str local_gateway_ip: (optional) Local gateway IP address. This - field only applies to network type 'gre_tunnel' and 'unbound_gre_tunnel' + field only applies to network type `gre_tunnel` and `unbound_gre_tunnel` connections. :param str local_tunnel_ip: (optional) Local tunnel IP address. This field - only applies to network type 'gre_tunnel' and 'unbound_gre_tunnel' + only applies to network type `gre_tunnel` and `unbound_gre_tunnel` connections. :param int mtu: (optional) GRE tunnel MTU. This field only applies to - network type 'gre_tunnel' and 'unbound_gre_tunnel' connections. + network type `gre_tunnel` and `unbound_gre_tunnel` connections. + :param str name: (optional) The user-defined name for this transit gateway + connection. Network type `vpc` connections are defaulted to the name of + the VPC. Network type `classic` connections are named `classic`. + This field is required for network type `power_virtual_server`, + `directlink`, `gre_tunnel`, `unbound_gre_tunnel`, `vpn_gateway` and + `redundant_gre` connections. + This field is optional for network type `classic`, `vpc` connections. :param str network_account_id: (optional) The ID of the account which owns the connected network. Generally only used if the network is in a different IBM Cloud account than the gateway. + :param str network_id: (optional) The ID of the network being connected via + this connection. For network types `vpc`,`power_virtual_server`, + `directlink` and `vpn_gateway` this is the CRN of the VPC / PowerVS / VDC / + Direct Link / VPN gateway respectively. This field is required for network + type `vpc`, `power_virtual_server`, `vpn_gateway`, and `directlink` + connections. It is also required for `redundant_gre` connections when the + base_network_type is set to VPC. This field is required to be unspecified + for network type `classic`, `gre_tunnel` and `unbound_gre_tunnel` + connections. + :param str network_type: (optional) Defines what type of network is + connected via this connection. :param List[TransitGatewayConnectionPrefixFilterReference] prefix_filters: (optional) Array of prefix route filters for a transit gateway connection. This is order dependent with those first in the array being applied first, and those at the end of the array is applied last, or just before the - default. This field does not apply to the 'redundant_gre' network type. + default. This field does not apply to the `redundant_gre` network type. :param str prefix_filters_default: (optional) Default setting of permit or deny which applies to any routes that don't match a specified filter. This - field does not apply to the 'redundant_gre' network type. + field does not apply to the `redundant_gre` network type. :param int remote_bgp_asn: (optional) Remote network BGP ASN. This field - only applies to network type 'gre_tunnel' and 'unbound_gre_tunnel' + only applies to network type `gre_tunnel` and `unbound_gre_tunnel` connections. :param str remote_gateway_ip: (optional) Remote gateway IP address. This - field only applies to network type 'gre_tunnel' and 'unbound_gre_tunnel' + field only applies to network type `gre_tunnel` and `unbound_gre_tunnel` connections. :param str remote_tunnel_ip: (optional) Remote tunnel IP address. This - field only applies to network type 'gre_tunnel' and 'unbound_gre_tunnel' + field only applies to network type `gre_tunnel` and `unbound_gre_tunnel` connections. - :param List[TransitGatewayRedundantGRETunnelReference] tunnels: (optional) - Collection of all tunnels for 'redundant_gre' connection. - :param GreTunnelZoneReference zone: (optional) Location of GRE tunnel. - This field only applies to network type 'gre_tunnel' connections. + :param List[TransitGatewayTunnel] tunnels: (optional) Collection of all + tunnels for `redundant_gre` and `vpn_gateway` connections. + :param ZoneReference zone: (optional) Location of GRE tunnel. This field is + required for network type `gre_tunnel` and `vpn_gateway` connections. """ - self.base_network_type = base_network_type - self.name = name - self.network_id = network_id - self.network_type = network_type - self.id = id self.base_connection_id = base_connection_id + self.base_network_type = base_network_type + self.cidr = cidr self.created_at = created_at + self.id = id self.local_bgp_asn = local_bgp_asn self.local_gateway_ip = local_gateway_ip self.local_tunnel_ip = local_tunnel_ip self.mtu = mtu + self.name = name self.network_account_id = network_account_id + self.network_id = network_id + self.network_type = network_type self.prefix_filters = prefix_filters self.prefix_filters_default = prefix_filters_default self.remote_bgp_asn = remote_bgp_asn @@ -5474,28 +5102,20 @@ def __init__( def from_dict(cls, _dict: Dict) -> 'TransitGatewayConnectionCust': """Initialize a TransitGatewayConnectionCust object from a json dictionary.""" args = {} + if 'base_connection_id' in _dict: + args['base_connection_id'] = _dict.get('base_connection_id') if 'base_network_type' in _dict: args['base_network_type'] = _dict.get('base_network_type') - if 'name' in _dict: - args['name'] = _dict.get('name') - else: - raise ValueError('Required property \'name\' not present in TransitGatewayConnectionCust JSON') - if 'network_id' in _dict: - args['network_id'] = _dict.get('network_id') - if 'network_type' in _dict: - args['network_type'] = _dict.get('network_type') + if 'cidr' in _dict: + args['cidr'] = _dict.get('cidr') + if 'created_at' in _dict: + args['created_at'] = string_to_datetime(_dict.get('created_at')) else: - raise ValueError('Required property \'network_type\' not present in TransitGatewayConnectionCust JSON') + raise ValueError('Required property \'created_at\' not present in TransitGatewayConnectionCust JSON') if 'id' in _dict: args['id'] = _dict.get('id') else: raise ValueError('Required property \'id\' not present in TransitGatewayConnectionCust JSON') - if 'base_connection_id' in _dict: - args['base_connection_id'] = _dict.get('base_connection_id') - if 'created_at' in _dict: - args['created_at'] = string_to_datetime(_dict.get('created_at')) - else: - raise ValueError('Required property \'created_at\' not present in TransitGatewayConnectionCust JSON') if 'local_bgp_asn' in _dict: args['local_bgp_asn'] = _dict.get('local_bgp_asn') if 'local_gateway_ip' in _dict: @@ -5504,8 +5124,14 @@ def from_dict(cls, _dict: Dict) -> 'TransitGatewayConnectionCust': args['local_tunnel_ip'] = _dict.get('local_tunnel_ip') if 'mtu' in _dict: args['mtu'] = _dict.get('mtu') + if 'name' in _dict: + args['name'] = _dict.get('name') if 'network_account_id' in _dict: args['network_account_id'] = _dict.get('network_account_id') + if 'network_id' in _dict: + args['network_id'] = _dict.get('network_id') + if 'network_type' in _dict: + args['network_type'] = _dict.get('network_type') if 'prefix_filters' in _dict: args['prefix_filters'] = [TransitGatewayConnectionPrefixFilterReference.from_dict(v) for v in _dict.get('prefix_filters')] if 'prefix_filters_default' in _dict: @@ -5525,13 +5151,13 @@ def from_dict(cls, _dict: Dict) -> 'TransitGatewayConnectionCust': else: raise ValueError('Required property \'status\' not present in TransitGatewayConnectionCust JSON') if 'tunnels' in _dict: - args['tunnels'] = [TransitGatewayRedundantGRETunnelReference.from_dict(v) for v in _dict.get('tunnels')] + args['tunnels'] = [TransitGatewayTunnel.from_dict(v) for v in _dict.get('tunnels')] if 'updated_at' in _dict: args['updated_at'] = string_to_datetime(_dict.get('updated_at')) else: raise ValueError('Required property \'updated_at\' not present in TransitGatewayConnectionCust JSON') if 'zone' in _dict: - args['zone'] = GreTunnelZoneReference.from_dict(_dict.get('zone')) + args['zone'] = ZoneReference.from_dict(_dict.get('zone')) return cls(**args) @classmethod @@ -5542,20 +5168,16 @@ def _from_dict(cls, _dict): def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} - if hasattr(self, 'base_network_type') and self.base_network_type is not None: - _dict['base_network_type'] = self.base_network_type - if hasattr(self, 'name') and self.name is not None: - _dict['name'] = self.name - if hasattr(self, 'network_id') and self.network_id is not None: - _dict['network_id'] = self.network_id - if hasattr(self, 'network_type') and self.network_type is not None: - _dict['network_type'] = self.network_type - if hasattr(self, 'id') and self.id is not None: - _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, 'base_network_type') and self.base_network_type is not None: + _dict['base_network_type'] = self.base_network_type + 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, 'id') and self.id is not None: + _dict['id'] = self.id if hasattr(self, 'local_bgp_asn') and self.local_bgp_asn is not None: _dict['local_bgp_asn'] = self.local_bgp_asn if hasattr(self, 'local_gateway_ip') and self.local_gateway_ip is not None: @@ -5564,8 +5186,14 @@ def to_dict(self) -> Dict: _dict['local_tunnel_ip'] = self.local_tunnel_ip if hasattr(self, 'mtu') and self.mtu is not None: _dict['mtu'] = self.mtu + if hasattr(self, 'name') and self.name is not None: + _dict['name'] = self.name if hasattr(self, 'network_account_id') and self.network_account_id is not None: _dict['network_account_id'] = self.network_account_id + if hasattr(self, 'network_id') and self.network_id is not None: + _dict['network_id'] = self.network_id + if hasattr(self, 'network_type') and self.network_type is not None: + _dict['network_type'] = self.network_type if hasattr(self, 'prefix_filters') and self.prefix_filters is not None: prefix_filters_list = [] for v in self.prefix_filters: @@ -5623,7 +5251,12 @@ def __ne__(self, other: 'TransitGatewayConnectionCust') -> bool: class BaseNetworkTypeEnum(str, Enum): """ - The type of network the GRE tunnel is targeting. + The type of network the Unbound GRE tunnel is targeting. This field is required + for network type `unbound_gre_tunnel` and must be set to `classic`. For a + `redundant_gre` network type, the value is required and can be either VPC or + Classic. This field is required to be unspecified for network type `classic`, + `directlink`, `vpc`, `power_virtual_server`, `vpn_gateway` and `gre_tunnel` + connections. """ CLASSIC = 'classic' @@ -5632,9 +5265,7 @@ class BaseNetworkTypeEnum(str, Enum): class NetworkTypeEnum(str, Enum): """ - 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. + Defines what type of network is connected via this connection. """ CLASSIC = 'classic' @@ -5644,12 +5275,13 @@ class NetworkTypeEnum(str, Enum): VPC = 'vpc' POWER_VIRTUAL_SERVER = 'power_virtual_server' REDUNDANT_GRE = 'redundant_gre' + VPN_GATEWAY = 'vpn_gateway' class PrefixFiltersDefaultEnum(str, Enum): """ Default setting of permit or deny which applies to any routes that don't match a - specified filter. This field does not apply to the 'redundant_gre' network type. + specified filter. This field does not apply to the `redundant_gre` network type. """ PERMIT = 'permit' @@ -5954,10 +5586,91 @@ class ActionEnum(str, Enum): -class TransitGatewayRedundantGRETunnelReference: +class TransitGatewayReference: + """ + Transit gateway reference. + + :attr str crn: gateway CRN. + :attr str id: gateway ID. + :attr str name: transit gateway name. + """ + + def __init__( + self, + crn: str, + id: str, + name: str, + ) -> None: + """ + Initialize a TransitGatewayReference object. + + :param str crn: gateway CRN. + :param str id: gateway ID. + :param str name: transit gateway name. + """ + self.crn = crn + self.id = id + self.name = name + + @classmethod + def from_dict(cls, _dict: Dict) -> 'TransitGatewayReference': + """Initialize a TransitGatewayReference object from a json dictionary.""" + args = {} + if 'crn' in _dict: + args['crn'] = _dict.get('crn') + else: + raise ValueError('Required property \'crn\' not present in TransitGatewayReference JSON') + if 'id' in _dict: + args['id'] = _dict.get('id') + else: + raise ValueError('Required property \'id\' not present in TransitGatewayReference JSON') + if 'name' in _dict: + args['name'] = _dict.get('name') + else: + raise ValueError('Required property \'name\' not present in TransitGatewayReference JSON') + return cls(**args) + + @classmethod + def _from_dict(cls, _dict): + """Initialize a TransitGatewayReference 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, 'crn') and self.crn is not None: + _dict['crn'] = self.crn + 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 + 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 TransitGatewayReference object.""" + return json.dumps(self.to_dict(), indent=2) + + def __eq__(self, other: 'TransitGatewayReference') -> 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: 'TransitGatewayReference') -> bool: + """Return `true` when self and other are not equal, false otherwise.""" + return not self == other + + +class TransitGatewayTunnel: """ Details for a redundant GRE tunnel. + :attr str base_network_type: The type of network the redundant GRE tunnel is + targeting. :attr datetime created_at: The date and time that this GRE tunnel was created. :attr str id: The unique identifier for this redundant GRE tunnel. :attr int local_bgp_asn: Local network BGP ASN. It is assigned by IBM when the @@ -5968,9 +5681,14 @@ class TransitGatewayRedundantGRETunnelReference: network nor broadcast addresses. :attr int mtu: GRE tunnel MTU. :attr str name: The user-defined name for this tunnel. + :attr str network_account_id: (optional) The ID of the account for cross account + Classic connections. This field is required when the GRE tunnel is in a + different account than the gateway and the base network is Classic. + :attr str network_id: (optional) The ID of the network VPC being connected via + this connection. :attr int remote_bgp_asn: Remote network BGP ASN. The following ASN values are reserved and unavailable 0, 13884, 36351, 64512-64513, 65100, 65200-65234, - 65402-65433, 65500 and 4201065000-4201065999. If 'remote_bgp_asn' is omitted on + 65402-65433, 65500 and 4201065000-4201065999. If `remote_bgp_asn` is omitted on create requests, IBM will assign an ASN. :attr str remote_gateway_ip: Remote gateway IP address. :attr str remote_tunnel_ip: Remote tunnel IP address. The local_tunnel_ip and @@ -5980,13 +5698,12 @@ class TransitGatewayRedundantGRETunnelReference: values for this property may expand in the future. Code and processes using this field must tolerate unexpected values. :attr datetime updated_at: The date and time that this tunnel was last updated. - :attr RgreTunnelZoneReference zone: The tunnel's location. The specified - availability zone must reside in the gateway's region. Use the IBM Cloud global - catalog to list zones within the desired region. + :attr ZoneReference zone: Availability zone reference. """ def __init__( self, + base_network_type: str, created_at: datetime, id: str, local_bgp_asn: int, @@ -5999,11 +5716,16 @@ def __init__( remote_tunnel_ip: str, status: str, updated_at: datetime, - zone: 'RgreTunnelZoneReference', + zone: 'ZoneReference', + *, + network_account_id: str = None, + network_id: str = None, ) -> None: """ - Initialize a TransitGatewayRedundantGRETunnelReference object. + Initialize a TransitGatewayTunnel object. + :param str base_network_type: The type of network the redundant GRE tunnel + is targeting. :param datetime created_at: The date and time that this GRE tunnel was created. :param str id: The unique identifier for this redundant GRE tunnel. @@ -6018,7 +5740,7 @@ def __init__( :param int remote_bgp_asn: Remote network BGP ASN. The following ASN values are reserved and unavailable 0, 13884, 36351, 64512-64513, 65100, 65200-65234, 65402-65433, 65500 and 4201065000-4201065999. If - 'remote_bgp_asn' is omitted on create requests, IBM will assign an ASN. + `remote_bgp_asn` is omitted on create requests, IBM will assign an ASN. :param str remote_gateway_ip: Remote gateway IP address. :param str remote_tunnel_ip: Remote tunnel IP address. The local_tunnel_ip and remote_tunnel_ip addresses must be in the same /30 network. Neither can @@ -6028,10 +5750,14 @@ def __init__( processes using this field must tolerate unexpected values. :param datetime updated_at: The date and time that this tunnel was last updated. - :param RgreTunnelZoneReference zone: The tunnel's location. The specified - availability zone must reside in the gateway's region. Use the IBM Cloud - global catalog to list zones within the desired region. + :param ZoneReference zone: Availability zone reference. + :param str network_account_id: (optional) The ID of the account for cross + account Classic connections. This field is required when the GRE tunnel is + in a different account than the gateway and the base network is Classic. + :param str network_id: (optional) The ID of the network VPC being connected + via this connection. """ + self.base_network_type = base_network_type self.created_at = created_at self.id = id self.local_bgp_asn = local_bgp_asn @@ -6039,6 +5765,8 @@ def __init__( self.local_tunnel_ip = local_tunnel_ip self.mtu = mtu self.name = name + self.network_account_id = network_account_id + self.network_id = network_id self.remote_bgp_asn = remote_bgp_asn self.remote_gateway_ip = remote_gateway_ip self.remote_tunnel_ip = remote_tunnel_ip @@ -6047,71 +5775,81 @@ def __init__( self.zone = zone @classmethod - def from_dict(cls, _dict: Dict) -> 'TransitGatewayRedundantGRETunnelReference': - """Initialize a TransitGatewayRedundantGRETunnelReference object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'TransitGatewayTunnel': + """Initialize a TransitGatewayTunnel object from a json dictionary.""" args = {} + if 'base_network_type' in _dict: + args['base_network_type'] = _dict.get('base_network_type') + else: + raise ValueError('Required property \'base_network_type\' not present in TransitGatewayTunnel JSON') if 'created_at' in _dict: args['created_at'] = string_to_datetime(_dict.get('created_at')) else: - raise ValueError('Required property \'created_at\' not present in TransitGatewayRedundantGRETunnelReference JSON') + raise ValueError('Required property \'created_at\' not present in TransitGatewayTunnel JSON') if 'id' in _dict: args['id'] = _dict.get('id') else: - raise ValueError('Required property \'id\' not present in TransitGatewayRedundantGRETunnelReference JSON') + raise ValueError('Required property \'id\' not present in TransitGatewayTunnel JSON') if 'local_bgp_asn' in _dict: args['local_bgp_asn'] = _dict.get('local_bgp_asn') else: - raise ValueError('Required property \'local_bgp_asn\' not present in TransitGatewayRedundantGRETunnelReference JSON') + raise ValueError('Required property \'local_bgp_asn\' not present in TransitGatewayTunnel JSON') if 'local_gateway_ip' in _dict: args['local_gateway_ip'] = _dict.get('local_gateway_ip') else: - raise ValueError('Required property \'local_gateway_ip\' not present in TransitGatewayRedundantGRETunnelReference JSON') + raise ValueError('Required property \'local_gateway_ip\' not present in TransitGatewayTunnel JSON') if 'local_tunnel_ip' in _dict: args['local_tunnel_ip'] = _dict.get('local_tunnel_ip') else: - raise ValueError('Required property \'local_tunnel_ip\' not present in TransitGatewayRedundantGRETunnelReference JSON') + raise ValueError('Required property \'local_tunnel_ip\' not present in TransitGatewayTunnel JSON') if 'mtu' in _dict: args['mtu'] = _dict.get('mtu') else: - raise ValueError('Required property \'mtu\' not present in TransitGatewayRedundantGRETunnelReference JSON') + raise ValueError('Required property \'mtu\' not present in TransitGatewayTunnel JSON') if 'name' in _dict: args['name'] = _dict.get('name') else: - raise ValueError('Required property \'name\' not present in TransitGatewayRedundantGRETunnelReference JSON') + raise ValueError('Required property \'name\' not present in TransitGatewayTunnel JSON') + if 'network_account_id' in _dict: + args['network_account_id'] = _dict.get('network_account_id') + if 'network_id' in _dict: + args['network_id'] = _dict.get('network_id') if 'remote_bgp_asn' in _dict: args['remote_bgp_asn'] = _dict.get('remote_bgp_asn') else: - raise ValueError('Required property \'remote_bgp_asn\' not present in TransitGatewayRedundantGRETunnelReference JSON') + raise ValueError('Required property \'remote_bgp_asn\' not present in TransitGatewayTunnel JSON') if 'remote_gateway_ip' in _dict: args['remote_gateway_ip'] = _dict.get('remote_gateway_ip') else: - raise ValueError('Required property \'remote_gateway_ip\' not present in TransitGatewayRedundantGRETunnelReference JSON') + raise ValueError('Required property \'remote_gateway_ip\' not present in TransitGatewayTunnel JSON') if 'remote_tunnel_ip' in _dict: args['remote_tunnel_ip'] = _dict.get('remote_tunnel_ip') else: - raise ValueError('Required property \'remote_tunnel_ip\' not present in TransitGatewayRedundantGRETunnelReference JSON') + raise ValueError('Required property \'remote_tunnel_ip\' not present in TransitGatewayTunnel JSON') if 'status' in _dict: args['status'] = _dict.get('status') else: - raise ValueError('Required property \'status\' not present in TransitGatewayRedundantGRETunnelReference JSON') + raise ValueError('Required property \'status\' not present in TransitGatewayTunnel JSON') if 'updated_at' in _dict: args['updated_at'] = string_to_datetime(_dict.get('updated_at')) else: - raise ValueError('Required property \'updated_at\' not present in TransitGatewayRedundantGRETunnelReference JSON') + raise ValueError('Required property \'updated_at\' not present in TransitGatewayTunnel JSON') if 'zone' in _dict: - args['zone'] = RgreTunnelZoneReference.from_dict(_dict.get('zone')) + args['zone'] = ZoneReference.from_dict(_dict.get('zone')) else: - raise ValueError('Required property \'zone\' not present in TransitGatewayRedundantGRETunnelReference JSON') + raise ValueError('Required property \'zone\' not present in TransitGatewayTunnel JSON') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a TransitGatewayRedundantGRETunnelReference object from a json dictionary.""" + """Initialize a TransitGatewayTunnel 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, 'base_network_type') and self.base_network_type is not None: + _dict['base_network_type'] = self.base_network_type 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: @@ -6126,6 +5864,10 @@ def to_dict(self) -> Dict: _dict['mtu'] = self.mtu if hasattr(self, 'name') and self.name is not None: _dict['name'] = self.name + if hasattr(self, 'network_account_id') and self.network_account_id is not None: + _dict['network_account_id'] = self.network_account_id + if hasattr(self, 'network_id') and self.network_id is not None: + _dict['network_id'] = self.network_id if hasattr(self, 'remote_bgp_asn') and self.remote_bgp_asn is not None: _dict['remote_bgp_asn'] = self.remote_bgp_asn if hasattr(self, 'remote_gateway_ip') and self.remote_gateway_ip is not None: @@ -6148,19 +5890,28 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this TransitGatewayRedundantGRETunnelReference object.""" + """Return a `str` version of this TransitGatewayTunnel object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'TransitGatewayRedundantGRETunnelReference') -> bool: + def __eq__(self, other: 'TransitGatewayTunnel') -> 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: 'TransitGatewayRedundantGRETunnelReference') -> bool: + def __ne__(self, other: 'TransitGatewayTunnel') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other + class BaseNetworkTypeEnum(str, Enum): + """ + The type of network the redundant GRE tunnel is targeting. + """ + + CLASSIC = 'classic' + VPC = 'vpc' + + class StatusEnum(str, Enum): """ Tunnel's current configuration state. The list of enumerated values for this @@ -6179,7 +5930,133 @@ class StatusEnum(str, Enum): -class TransitGatewayRedundantGRETunnelTemplate: +class TransitGatewayTunnelCollection: + """ + Collection of all tunnels for `redundant_gre` and `vpn_gateway` connections. + + :attr List[TransitGatewayTunnel] tunnels: Collection of all tunnels for + `redundant_gre` and `vpn_gateway` connections. + """ + + def __init__( + self, + tunnels: List['TransitGatewayTunnel'], + ) -> None: + """ + Initialize a TransitGatewayTunnelCollection object. + + :param List[TransitGatewayTunnel] tunnels: Collection of all tunnels for + `redundant_gre` and `vpn_gateway` connections. + """ + self.tunnels = tunnels + + @classmethod + def from_dict(cls, _dict: Dict) -> 'TransitGatewayTunnelCollection': + """Initialize a TransitGatewayTunnelCollection object from a json dictionary.""" + args = {} + if 'tunnels' in _dict: + args['tunnels'] = [TransitGatewayTunnel.from_dict(v) for v in _dict.get('tunnels')] + else: + raise ValueError('Required property \'tunnels\' not present in TransitGatewayTunnelCollection JSON') + return cls(**args) + + @classmethod + def _from_dict(cls, _dict): + """Initialize a TransitGatewayTunnelCollection 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, 'tunnels') and self.tunnels is not None: + tunnels_list = [] + for v in self.tunnels: + if isinstance(v, dict): + tunnels_list.append(v) + else: + tunnels_list.append(v.to_dict()) + _dict['tunnels'] = tunnels_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 TransitGatewayTunnelCollection object.""" + return json.dumps(self.to_dict(), indent=2) + + def __eq__(self, other: 'TransitGatewayTunnelCollection') -> 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: 'TransitGatewayTunnelCollection') -> bool: + """Return `true` when self and other are not equal, false otherwise.""" + return not self == other + + +class TransitGatewayTunnelPatch: + """ + An update template for a Transit Gateway connection tunnel. + + :attr str name: (optional) The user-defined name for this connection tunnel. + """ + + def __init__( + self, + *, + name: str = None, + ) -> None: + """ + Initialize a TransitGatewayTunnelPatch object. + + :param str name: (optional) The user-defined name for this connection + tunnel. + """ + self.name = name + + @classmethod + def from_dict(cls, _dict: Dict) -> 'TransitGatewayTunnelPatch': + """Initialize a TransitGatewayTunnelPatch object from a json dictionary.""" + args = {} + if 'name' in _dict: + args['name'] = _dict.get('name') + return cls(**args) + + @classmethod + def _from_dict(cls, _dict): + """Initialize a TransitGatewayTunnelPatch 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 TransitGatewayTunnelPatch object.""" + return json.dumps(self.to_dict(), indent=2) + + def __eq__(self, other: 'TransitGatewayTunnelPatch') -> 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: 'TransitGatewayTunnelPatch') -> bool: + """Return `true` when self and other are not equal, false otherwise.""" + return not self == other + + +class TransitGatewayTunnelTemplate: """ A create template with information for redundant GRE tunnel. @@ -6190,7 +6067,7 @@ class TransitGatewayRedundantGRETunnelTemplate: :attr str name: The user-defined name for this tunnel connection. :attr int remote_bgp_asn: (optional) Remote network BGP ASN. The following ASN values are reserved and unavailable 0, 13884, 36351, 64512-64513, 65100, - 65200-65234, 65402-65433, 65500 and 4201065000-4201065999. If 'remote_bgp_asn' + 65200-65234, 65402-65433, 65500 and 4201065000-4201065999. If `remote_bgp_asn` is omitted on create requests, IBM will assign an ASN. :attr str remote_gateway_ip: Remote gateway IP address. :attr str remote_tunnel_ip: Remote tunnel IP address. The local_tunnel_ip and @@ -6213,7 +6090,7 @@ def __init__( remote_bgp_asn: int = None, ) -> None: """ - Initialize a TransitGatewayRedundantGRETunnelTemplate object. + Initialize a TransitGatewayTunnelTemplate object. :param str local_gateway_ip: Local gateway IP address. :param str local_tunnel_ip: Local tunnel IP address. The local_tunnel_ip @@ -6230,7 +6107,7 @@ def __init__( :param int remote_bgp_asn: (optional) Remote network BGP ASN. The following ASN values are reserved and unavailable 0, 13884, 36351, 64512-64513, 65100, 65200-65234, 65402-65433, 65500 and 4201065000-4201065999. If - 'remote_bgp_asn' is omitted on create requests, IBM will assign an ASN. + `remote_bgp_asn` is omitted on create requests, IBM will assign an ASN. """ self.local_gateway_ip = local_gateway_ip self.local_tunnel_ip = local_tunnel_ip @@ -6241,40 +6118,40 @@ def __init__( self.zone = zone @classmethod - def from_dict(cls, _dict: Dict) -> 'TransitGatewayRedundantGRETunnelTemplate': - """Initialize a TransitGatewayRedundantGRETunnelTemplate object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'TransitGatewayTunnelTemplate': + """Initialize a TransitGatewayTunnelTemplate object from a json dictionary.""" args = {} if 'local_gateway_ip' in _dict: args['local_gateway_ip'] = _dict.get('local_gateway_ip') else: - raise ValueError('Required property \'local_gateway_ip\' not present in TransitGatewayRedundantGRETunnelTemplate JSON') + raise ValueError('Required property \'local_gateway_ip\' not present in TransitGatewayTunnelTemplate JSON') if 'local_tunnel_ip' in _dict: args['local_tunnel_ip'] = _dict.get('local_tunnel_ip') else: - raise ValueError('Required property \'local_tunnel_ip\' not present in TransitGatewayRedundantGRETunnelTemplate JSON') + raise ValueError('Required property \'local_tunnel_ip\' not present in TransitGatewayTunnelTemplate JSON') if 'name' in _dict: args['name'] = _dict.get('name') else: - raise ValueError('Required property \'name\' not present in TransitGatewayRedundantGRETunnelTemplate JSON') + raise ValueError('Required property \'name\' not present in TransitGatewayTunnelTemplate JSON') if 'remote_bgp_asn' in _dict: args['remote_bgp_asn'] = _dict.get('remote_bgp_asn') if 'remote_gateway_ip' in _dict: args['remote_gateway_ip'] = _dict.get('remote_gateway_ip') else: - raise ValueError('Required property \'remote_gateway_ip\' not present in TransitGatewayRedundantGRETunnelTemplate JSON') + raise ValueError('Required property \'remote_gateway_ip\' not present in TransitGatewayTunnelTemplate JSON') if 'remote_tunnel_ip' in _dict: args['remote_tunnel_ip'] = _dict.get('remote_tunnel_ip') else: - raise ValueError('Required property \'remote_tunnel_ip\' not present in TransitGatewayRedundantGRETunnelTemplate JSON') + raise ValueError('Required property \'remote_tunnel_ip\' not present in TransitGatewayTunnelTemplate JSON') if 'zone' in _dict: args['zone'] = _dict.get('zone') else: - raise ValueError('Required property \'zone\' not present in TransitGatewayRedundantGRETunnelTemplate JSON') + raise ValueError('Required property \'zone\' not present in TransitGatewayTunnelTemplate JSON') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a TransitGatewayRedundantGRETunnelTemplate object from a json dictionary.""" + """Initialize a TransitGatewayTunnelTemplate object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: @@ -6304,95 +6181,16 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this TransitGatewayRedundantGRETunnelTemplate object.""" - return json.dumps(self.to_dict(), indent=2) - - def __eq__(self, other: 'TransitGatewayRedundantGRETunnelTemplate') -> 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: 'TransitGatewayRedundantGRETunnelTemplate') -> bool: - """Return `true` when self and other are not equal, false otherwise.""" - return not self == other - - -class TransitGatewayReference: - """ - Transit gateway reference. - - :attr str crn: gateway CRN. - :attr str id: gateway ID. - :attr str name: transit gateway name. - """ - - def __init__( - self, - crn: str, - id: str, - name: str, - ) -> None: - """ - Initialize a TransitGatewayReference object. - - :param str crn: gateway CRN. - :param str id: gateway ID. - :param str name: transit gateway name. - """ - self.crn = crn - self.id = id - self.name = name - - @classmethod - def from_dict(cls, _dict: Dict) -> 'TransitGatewayReference': - """Initialize a TransitGatewayReference object from a json dictionary.""" - args = {} - if 'crn' in _dict: - args['crn'] = _dict.get('crn') - else: - raise ValueError('Required property \'crn\' not present in TransitGatewayReference JSON') - if 'id' in _dict: - args['id'] = _dict.get('id') - else: - raise ValueError('Required property \'id\' not present in TransitGatewayReference JSON') - if 'name' in _dict: - args['name'] = _dict.get('name') - else: - raise ValueError('Required property \'name\' not present in TransitGatewayReference JSON') - return cls(**args) - - @classmethod - def _from_dict(cls, _dict): - """Initialize a TransitGatewayReference 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, 'crn') and self.crn is not None: - _dict['crn'] = self.crn - 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 - 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 TransitGatewayReference object.""" + """Return a `str` version of this TransitGatewayTunnelTemplate object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'TransitGatewayReference') -> bool: + def __eq__(self, other: 'TransitGatewayTunnelTemplate') -> 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: 'TransitGatewayReference') -> bool: + def __ne__(self, other: 'TransitGatewayTunnelTemplate') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other @@ -6475,71 +6273,6 @@ def __ne__(self, other: 'ZoneReference') -> bool: return not self == other -class ZoneReferenceCollection: - """ - Collection of availability zones. - - :attr List[ZoneReference] zones: Array of valid zones for GRE tunnels. - """ - - def __init__( - self, - zones: List['ZoneReference'], - ) -> None: - """ - Initialize a ZoneReferenceCollection object. - - :param List[ZoneReference] zones: Array of valid zones for GRE tunnels. - """ - self.zones = zones - - @classmethod - def from_dict(cls, _dict: Dict) -> 'ZoneReferenceCollection': - """Initialize a ZoneReferenceCollection object from a json dictionary.""" - args = {} - if 'zones' in _dict: - args['zones'] = [ZoneReference.from_dict(v) for v in _dict.get('zones')] - else: - raise ValueError('Required property \'zones\' not present in ZoneReferenceCollection JSON') - return cls(**args) - - @classmethod - def _from_dict(cls, _dict): - """Initialize a ZoneReferenceCollection 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, 'zones') and self.zones is not None: - zones_list = [] - for v in self.zones: - if isinstance(v, dict): - zones_list.append(v) - else: - zones_list.append(v.to_dict()) - _dict['zones'] = zones_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 ZoneReferenceCollection object.""" - return json.dumps(self.to_dict(), indent=2) - - def __eq__(self, other: 'ZoneReferenceCollection') -> 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: 'ZoneReferenceCollection') -> bool: - """Return `true` when self and other are not equal, false otherwise.""" - return not self == other - - class ZoneIdentityByName(ZoneIdentity): """ Availability zone. @@ -6679,6 +6412,7 @@ def __init__( client: TransitGatewayApisV1, limit: int = None, network_id: str = None, + network_type: str = None, ) -> None: """ Initialize a ConnectionsPager object. @@ -6686,12 +6420,15 @@ def __init__( page. :param str network_id: (optional) Search for connections with the given network_id value. + :param str network_type: (optional) Search for connections with the given + network_type value. """ self._has_next = True self._client = client self._page_context = {'next': None} self._limit = limit self._network_id = network_id + self._network_type = network_type def has_next(self) -> bool: """ @@ -6711,6 +6448,7 @@ def get_next(self) -> List[dict]: result = self._client.list_connections( limit=self._limit, network_id=self._network_id, + network_type=self._network_type, 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 0fe4446..1c5401c 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. 2024. +# (C) Copyright IBM Corp. 2025. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -131,7 +131,7 @@ def test_list_transit_gateways_all_params(self): """ # Set up mock url = preprocess_url('/transit_gateways') - mock_response = '{"first": {"href": "https://transit.cloud.ibm.com/v1/transit_gateways?limit=50"}, "limit": 50, "next": {"href": "https://transit.cloud.ibm.com/v1/transit_gateways?start=MjAyMC0wNS0wOFQxNDoxNzowMy45NzQ5NzNa&limit=50", "start": "MjAyMC0wNS0wOFQxNDoxNzowMy45NzQ5NzNa"}, "transit_gateways": [{"id": "ef4dcb1a-fee4-41c7-9e11-9cd99e65c1f4", "crn": "crn:v1:bluemix:public:transit:dal03:a/57a7d05f36894e3cb9b46a43556d903e::gateway:ef4dcb1a-fee4-41c7-9e11-9cd99e65c1f4", "name": "my-transit-gateway-in-TransitGateway", "location": "us-south", "created_at": "2019-01-01T12:00:00.000Z", "global": true, "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", "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, @@ -176,7 +176,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": [{"id": "ef4dcb1a-fee4-41c7-9e11-9cd99e65c1f4", "crn": "crn:v1:bluemix:public:transit:dal03:a/57a7d05f36894e3cb9b46a43556d903e::gateway:ef4dcb1a-fee4-41c7-9e11-9cd99e65c1f4", "name": "my-transit-gateway-in-TransitGateway", "location": "us-south", "created_at": "2019-01-01T12:00:00.000Z", "global": true, "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", "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, @@ -208,7 +208,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": [{"id": "ef4dcb1a-fee4-41c7-9e11-9cd99e65c1f4", "crn": "crn:v1:bluemix:public:transit:dal03:a/57a7d05f36894e3cb9b46a43556d903e::gateway:ef4dcb1a-fee4-41c7-9e11-9cd99e65c1f4", "name": "my-transit-gateway-in-TransitGateway", "location": "us-south", "created_at": "2019-01-01T12:00:00.000Z", "global": true, "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", "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, @@ -241,8 +241,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":[{"id":"ef4dcb1a-fee4-41c7-9e11-9cd99e65c1f4","crn":"crn:v1:bluemix:public:transit:dal03:a/57a7d05f36894e3cb9b46a43556d903e::gateway:ef4dcb1a-fee4-41c7-9e11-9cd99e65c1f4","name":"my-transit-gateway-in-TransitGateway","location":"us-south","created_at":"2019-01-01T12:00:00.000Z","global":true,"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":[{"id":"ef4dcb1a-fee4-41c7-9e11-9cd99e65c1f4","crn":"crn:v1:bluemix:public:transit:dal03:a/57a7d05f36894e3cb9b46a43556d903e::gateway:ef4dcb1a-fee4-41c7-9e11-9cd99e65c1f4","name":"my-transit-gateway-in-TransitGateway","location":"us-south","created_at":"2019-01-01T12:00:00.000Z","global":true,"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","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}' responses.add( responses.GET, url, @@ -277,8 +277,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":[{"id":"ef4dcb1a-fee4-41c7-9e11-9cd99e65c1f4","crn":"crn:v1:bluemix:public:transit:dal03:a/57a7d05f36894e3cb9b46a43556d903e::gateway:ef4dcb1a-fee4-41c7-9e11-9cd99e65c1f4","name":"my-transit-gateway-in-TransitGateway","location":"us-south","created_at":"2019-01-01T12:00:00.000Z","global":true,"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":[{"id":"ef4dcb1a-fee4-41c7-9e11-9cd99e65c1f4","crn":"crn:v1:bluemix:public:transit:dal03:a/57a7d05f36894e3cb9b46a43556d903e::gateway:ef4dcb1a-fee4-41c7-9e11-9cd99e65c1f4","name":"my-transit-gateway-in-TransitGateway","location":"us-south","created_at":"2019-01-01T12:00:00.000Z","global":true,"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","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}' responses.add( responses.GET, url, @@ -316,7 +316,7 @@ def test_create_transit_gateway_all_params(self): """ # Set up mock url = preprocess_url('/transit_gateways') - mock_response = '{"id": "ef4dcb1a-fee4-41c7-9e11-9cd99e65c1f4", "crn": "crn:v1:bluemix:public:transit:dal03:a/57a7d05f36894e3cb9b46a43556d903e::gateway:ef4dcb1a-fee4-41c7-9e11-9cd99e65c1f4", "name": "my-transit-gateway-in-TransitGateway", "location": "us-south", "created_at": "2019-01-01T12:00:00.000Z", "global": true, "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", "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, @@ -331,8 +331,9 @@ def test_create_transit_gateway_all_params(self): # Set up parameter values location = 'us-south' - name = 'Transit_Service_BWTN_SJ_DL' + name = 'my-transit-gateway-in-TransitGateway' global_ = True + gre_enhanced_route_propagation = True resource_group = resource_group_identity_model # Invoke method @@ -340,6 +341,7 @@ def test_create_transit_gateway_all_params(self): location, name, global_=global_, + gre_enhanced_route_propagation=gre_enhanced_route_propagation, resource_group=resource_group, headers={}, ) @@ -350,8 +352,9 @@ def test_create_transit_gateway_all_params(self): # Validate body params req_body = json.loads(str(responses.calls[0].request.body, 'utf-8')) assert req_body['location'] == 'us-south' - assert req_body['name'] == 'Transit_Service_BWTN_SJ_DL' + 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['resource_group'] == resource_group_identity_model def test_create_transit_gateway_all_params_with_retries(self): @@ -370,7 +373,7 @@ def test_create_transit_gateway_value_error(self): """ # Set up mock url = preprocess_url('/transit_gateways') - mock_response = '{"id": "ef4dcb1a-fee4-41c7-9e11-9cd99e65c1f4", "crn": "crn:v1:bluemix:public:transit:dal03:a/57a7d05f36894e3cb9b46a43556d903e::gateway:ef4dcb1a-fee4-41c7-9e11-9cd99e65c1f4", "name": "my-transit-gateway-in-TransitGateway", "location": "us-south", "created_at": "2019-01-01T12:00:00.000Z", "global": true, "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", "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, @@ -385,8 +388,9 @@ def test_create_transit_gateway_value_error(self): # Set up parameter values location = 'us-south' - name = 'Transit_Service_BWTN_SJ_DL' + name = 'my-transit-gateway-in-TransitGateway' global_ = True + gre_enhanced_route_propagation = True resource_group = resource_group_identity_model # Pass in all but one required param and check for a ValueError @@ -496,7 +500,7 @@ def test_get_transit_gateway_all_params(self): """ # Set up mock url = preprocess_url('/transit_gateways/testString') - mock_response = '{"id": "ef4dcb1a-fee4-41c7-9e11-9cd99e65c1f4", "crn": "crn:v1:bluemix:public:transit:dal03:a/57a7d05f36894e3cb9b46a43556d903e::gateway:ef4dcb1a-fee4-41c7-9e11-9cd99e65c1f4", "name": "my-transit-gateway-in-TransitGateway", "location": "us-south", "created_at": "2019-01-01T12:00:00.000Z", "global": true, "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", "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, @@ -534,7 +538,7 @@ def test_get_transit_gateway_value_error(self): """ # Set up mock url = preprocess_url('/transit_gateways/testString') - mock_response = '{"id": "ef4dcb1a-fee4-41c7-9e11-9cd99e65c1f4", "crn": "crn:v1:bluemix:public:transit:dal03:a/57a7d05f36894e3cb9b46a43556d903e::gateway:ef4dcb1a-fee4-41c7-9e11-9cd99e65c1f4", "name": "my-transit-gateway-in-TransitGateway", "location": "us-south", "created_at": "2019-01-01T12:00:00.000Z", "global": true, "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", "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, @@ -577,7 +581,7 @@ def test_update_transit_gateway_all_params(self): """ # Set up mock url = preprocess_url('/transit_gateways/testString') - mock_response = '{"id": "ef4dcb1a-fee4-41c7-9e11-9cd99e65c1f4", "crn": "crn:v1:bluemix:public:transit:dal03:a/57a7d05f36894e3cb9b46a43556d903e::gateway:ef4dcb1a-fee4-41c7-9e11-9cd99e65c1f4", "name": "my-transit-gateway-in-TransitGateway", "location": "us-south", "created_at": "2019-01-01T12:00:00.000Z", "global": true, "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", "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, @@ -589,12 +593,14 @@ def test_update_transit_gateway_all_params(self): # Set up parameter values id = 'testString' global_ = True - name = 'my-transit-gateway' + gre_enhanced_route_propagation = True + name = 'my-resource' # Invoke method response = _service.update_transit_gateway( id, global_=global_, + gre_enhanced_route_propagation=gre_enhanced_route_propagation, name=name, headers={}, ) @@ -605,7 +611,8 @@ def test_update_transit_gateway_all_params(self): # Validate body params req_body = json.loads(str(responses.calls[0].request.body, 'utf-8')) assert req_body['global'] == True - assert req_body['name'] == 'my-transit-gateway' + assert req_body['gre_enhanced_route_propagation'] == True + assert req_body['name'] == 'my-resource' def test_update_transit_gateway_all_params_with_retries(self): # Enable retries and run test_update_transit_gateway_all_params. @@ -623,7 +630,7 @@ def test_update_transit_gateway_value_error(self): """ # Set up mock url = preprocess_url('/transit_gateways/testString') - mock_response = '{"id": "ef4dcb1a-fee4-41c7-9e11-9cd99e65c1f4", "crn": "crn:v1:bluemix:public:transit:dal03:a/57a7d05f36894e3cb9b46a43556d903e::gateway:ef4dcb1a-fee4-41c7-9e11-9cd99e65c1f4", "name": "my-transit-gateway-in-TransitGateway", "location": "us-south", "created_at": "2019-01-01T12:00:00.000Z", "global": true, "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", "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, @@ -635,7 +642,8 @@ def test_update_transit_gateway_value_error(self): # Set up parameter values id = 'testString' global_ = True - name = 'my-transit-gateway' + gre_enhanced_route_propagation = True + name = 'my-resource' # Pass in all but one required param and check for a ValueError req_param_dict = { @@ -725,7 +733,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": [{"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", "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", "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"}}' responses.add( responses.GET, url, @@ -738,12 +746,14 @@ def test_list_connections_all_params(self): limit = 50 start = 'testString' network_id = 'testString' + network_type = 'testString' # Invoke method response = _service.list_connections( limit=limit, start=start, network_id=network_id, + network_type=network_type, headers={}, ) @@ -756,6 +766,7 @@ def test_list_connections_all_params(self): assert 'limit={}'.format(limit) in query_string assert 'start={}'.format(start) in query_string assert 'network_id={}'.format(network_id) in query_string + assert 'network_type={}'.format(network_type) in query_string def test_list_connections_all_params_with_retries(self): # Enable retries and run test_list_connections_all_params. @@ -773,7 +784,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": [{"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", "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", "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"}}' responses.add( responses.GET, url, @@ -805,7 +816,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": [{"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", "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", "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"}}' responses.add( responses.GET, url, @@ -838,8 +849,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":[{"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","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":[{"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","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","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"}}]}' responses.add( responses.GET, url, @@ -861,6 +872,7 @@ def test_list_connections_with_pager_get_next(self): client=_service, limit=10, network_id='testString', + network_type='testString', ) while pager.has_next(): next_page = pager.get_next() @@ -875,8 +887,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":[{"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","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":[{"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","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","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"}}]}' responses.add( responses.GET, url, @@ -897,6 +909,7 @@ def test_list_connections_with_pager_get_all(self): client=_service, limit=10, network_id='testString', + network_type='testString', ) all_results = pager.get_all() assert all_results is not None @@ -972,7 +985,7 @@ def test_list_transit_gateway_connections_all_params(self): """ # Set up mock url = preprocess_url('/transit_gateways/testString/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", "tunnels": [{"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", "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": "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}' responses.add( responses.GET, url, @@ -1022,7 +1035,7 @@ def test_list_transit_gateway_connections_required_params(self): """ # Set up mock url = preprocess_url('/transit_gateways/testString/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", "tunnels": [{"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", "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": "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}' responses.add( responses.GET, url, @@ -1060,7 +1073,7 @@ def test_list_transit_gateway_connections_value_error(self): """ # Set up mock url = preprocess_url('/transit_gateways/testString/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", "tunnels": [{"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", "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": "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}' responses.add( responses.GET, url, @@ -1097,8 +1110,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_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","tunnels":[{"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","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","tunnels":[{"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","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":"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"}}]}' responses.add( responses.GET, url, @@ -1135,8 +1148,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_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","tunnels":[{"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","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","tunnels":[{"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","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":"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"}}]}' responses.add( responses.GET, url, @@ -1176,7 +1189,7 @@ def test_create_transit_gateway_connection_all_params(self): """ # Set up mock url = preprocess_url('/transit_gateways/testString/connections') - mock_response = '{"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", "tunnels": [{"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", "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": "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"}}' responses.add( responses.POST, url, @@ -1196,21 +1209,22 @@ def test_create_transit_gateway_connection_all_params(self): zone_identity_model = {} zone_identity_model['name'] = 'us-south-1' - # Construct a dict representation of a TransitGatewayRedundantGRETunnelTemplate model - transit_gateway_redundant_gre_tunnel_template_model = {} - transit_gateway_redundant_gre_tunnel_template_model['local_gateway_ip'] = '10.242.63.12' - transit_gateway_redundant_gre_tunnel_template_model['local_tunnel_ip'] = '192.168.100.20' - transit_gateway_redundant_gre_tunnel_template_model['name'] = 'gre1' - transit_gateway_redundant_gre_tunnel_template_model['remote_bgp_asn'] = 65010 - transit_gateway_redundant_gre_tunnel_template_model['remote_gateway_ip'] = '10.242.33.22' - transit_gateway_redundant_gre_tunnel_template_model['remote_tunnel_ip'] = '192.168.129.1' - transit_gateway_redundant_gre_tunnel_template_model['zone'] = zone_identity_model + # Construct a dict representation of a TransitGatewayTunnelTemplate model + transit_gateway_tunnel_template_model = {} + transit_gateway_tunnel_template_model['local_gateway_ip'] = '10.242.63.12' + transit_gateway_tunnel_template_model['local_tunnel_ip'] = '192.168.100.20' + transit_gateway_tunnel_template_model['name'] = 'gre1' + transit_gateway_tunnel_template_model['remote_bgp_asn'] = 65010 + transit_gateway_tunnel_template_model['remote_gateway_ip'] = '10.242.33.22' + transit_gateway_tunnel_template_model['remote_tunnel_ip'] = '192.168.129.1' + transit_gateway_tunnel_template_model['zone'] = zone_identity_model # Set up parameter values transit_gateway_id = 'testString' network_type = 'vpc' base_connection_id = '975f58c1-afe7-469a-9727-7f3d720f2d32' base_network_type = 'classic' + cidr = '192.168.0.0/24' local_gateway_ip = '192.168.100.1' local_tunnel_ip = '192.168.129.2' name = 'Transit_Service_BWTN_SJ_DL' @@ -1221,7 +1235,7 @@ def test_create_transit_gateway_connection_all_params(self): remote_bgp_asn = 65010 remote_gateway_ip = '10.242.63.12' remote_tunnel_ip = '192.168.129.1' - tunnels = [transit_gateway_redundant_gre_tunnel_template_model] + tunnels = [transit_gateway_tunnel_template_model] zone = zone_identity_model # Invoke method @@ -1230,6 +1244,7 @@ def test_create_transit_gateway_connection_all_params(self): network_type, base_connection_id=base_connection_id, base_network_type=base_network_type, + cidr=cidr, local_gateway_ip=local_gateway_ip, local_tunnel_ip=local_tunnel_ip, name=name, @@ -1253,6 +1268,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['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' @@ -1263,7 +1279,7 @@ def test_create_transit_gateway_connection_all_params(self): assert req_body['remote_bgp_asn'] == 65010 assert req_body['remote_gateway_ip'] == '10.242.63.12' assert req_body['remote_tunnel_ip'] == '192.168.129.1' - assert req_body['tunnels'] == [transit_gateway_redundant_gre_tunnel_template_model] + assert req_body['tunnels'] == [transit_gateway_tunnel_template_model] assert req_body['zone'] == zone_identity_model def test_create_transit_gateway_connection_all_params_with_retries(self): @@ -1282,7 +1298,7 @@ def test_create_transit_gateway_connection_value_error(self): """ # Set up mock url = preprocess_url('/transit_gateways/testString/connections') - mock_response = '{"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", "tunnels": [{"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", "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": "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"}}' responses.add( responses.POST, url, @@ -1302,21 +1318,22 @@ def test_create_transit_gateway_connection_value_error(self): zone_identity_model = {} zone_identity_model['name'] = 'us-south-1' - # Construct a dict representation of a TransitGatewayRedundantGRETunnelTemplate model - transit_gateway_redundant_gre_tunnel_template_model = {} - transit_gateway_redundant_gre_tunnel_template_model['local_gateway_ip'] = '10.242.63.12' - transit_gateway_redundant_gre_tunnel_template_model['local_tunnel_ip'] = '192.168.100.20' - transit_gateway_redundant_gre_tunnel_template_model['name'] = 'gre1' - transit_gateway_redundant_gre_tunnel_template_model['remote_bgp_asn'] = 65010 - transit_gateway_redundant_gre_tunnel_template_model['remote_gateway_ip'] = '10.242.33.22' - transit_gateway_redundant_gre_tunnel_template_model['remote_tunnel_ip'] = '192.168.129.1' - transit_gateway_redundant_gre_tunnel_template_model['zone'] = zone_identity_model + # Construct a dict representation of a TransitGatewayTunnelTemplate model + transit_gateway_tunnel_template_model = {} + transit_gateway_tunnel_template_model['local_gateway_ip'] = '10.242.63.12' + transit_gateway_tunnel_template_model['local_tunnel_ip'] = '192.168.100.20' + transit_gateway_tunnel_template_model['name'] = 'gre1' + transit_gateway_tunnel_template_model['remote_bgp_asn'] = 65010 + transit_gateway_tunnel_template_model['remote_gateway_ip'] = '10.242.33.22' + transit_gateway_tunnel_template_model['remote_tunnel_ip'] = '192.168.129.1' + transit_gateway_tunnel_template_model['zone'] = zone_identity_model # Set up parameter values transit_gateway_id = 'testString' network_type = 'vpc' base_connection_id = '975f58c1-afe7-469a-9727-7f3d720f2d32' base_network_type = 'classic' + cidr = '192.168.0.0/24' local_gateway_ip = '192.168.100.1' local_tunnel_ip = '192.168.129.2' name = 'Transit_Service_BWTN_SJ_DL' @@ -1327,7 +1344,7 @@ def test_create_transit_gateway_connection_value_error(self): remote_bgp_asn = 65010 remote_gateway_ip = '10.242.63.12' remote_tunnel_ip = '192.168.129.1' - tunnels = [transit_gateway_redundant_gre_tunnel_template_model] + tunnels = [transit_gateway_tunnel_template_model] zone = zone_identity_model # Pass in all but one required param and check for a ValueError @@ -1441,7 +1458,7 @@ def test_get_transit_gateway_connection_all_params(self): """ # Set up mock url = preprocess_url('/transit_gateways/testString/connections/testString') - mock_response = '{"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", "tunnels": [{"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", "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": "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"}}' responses.add( responses.GET, url, @@ -1481,7 +1498,7 @@ def test_get_transit_gateway_connection_value_error(self): """ # Set up mock url = preprocess_url('/transit_gateways/testString/connections/testString') - mock_response = '{"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", "tunnels": [{"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", "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": "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"}}' responses.add( responses.GET, url, @@ -1526,7 +1543,7 @@ def test_update_transit_gateway_connection_all_params(self): """ # Set up mock url = preprocess_url('/transit_gateways/testString/connections/testString') - mock_response = '{"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", "tunnels": [{"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", "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": "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"}}' responses.add( responses.PATCH, url, @@ -1574,7 +1591,7 @@ def test_update_transit_gateway_connection_value_error(self): """ # Set up mock url = preprocess_url('/transit_gateways/testString/connections/testString') - mock_response = '{"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", "tunnels": [{"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", "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": "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"}}' responses.add( responses.PATCH, url, @@ -1695,15 +1712,15 @@ def test_create_transit_gateway_connection_actions_value_error_with_retries(self self.test_create_transit_gateway_connection_actions_value_error() -class TestGetTransitGatewayGreTunnel: +class TestListTransitGatewayGreTunnel: """ - Test Class for get_transit_gateway_gre_tunnel + Test Class for list_transit_gateway_gre_tunnel """ @responses.activate - def test_get_transit_gateway_gre_tunnel_all_params(self): + def test_list_transit_gateway_gre_tunnel_all_params(self): """ - get_transit_gateway_gre_tunnel() + list_transit_gateway_gre_tunnel() """ # Set up mock url = preprocess_url('/transit_gateways/testString/connections/testString/tunnels') @@ -1721,7 +1738,7 @@ def test_get_transit_gateway_gre_tunnel_all_params(self): id = 'testString' # Invoke method - response = _service.get_transit_gateway_gre_tunnel( + response = _service.list_transit_gateway_gre_tunnel( transit_gateway_id, id, headers={}, @@ -1731,19 +1748,19 @@ def test_get_transit_gateway_gre_tunnel_all_params(self): assert len(responses.calls) == 1 assert response.status_code == 200 - def test_get_transit_gateway_gre_tunnel_all_params_with_retries(self): - # Enable retries and run test_get_transit_gateway_gre_tunnel_all_params. + def test_list_transit_gateway_gre_tunnel_all_params_with_retries(self): + # Enable retries and run test_list_transit_gateway_gre_tunnel_all_params. _service.enable_retries() - self.test_get_transit_gateway_gre_tunnel_all_params() + self.test_list_transit_gateway_gre_tunnel_all_params() - # Disable retries and run test_get_transit_gateway_gre_tunnel_all_params. + # Disable retries and run test_list_transit_gateway_gre_tunnel_all_params. _service.disable_retries() - self.test_get_transit_gateway_gre_tunnel_all_params() + self.test_list_transit_gateway_gre_tunnel_all_params() @responses.activate - def test_get_transit_gateway_gre_tunnel_value_error(self): + def test_list_transit_gateway_gre_tunnel_value_error(self): """ - test_get_transit_gateway_gre_tunnel_value_error() + test_list_transit_gateway_gre_tunnel_value_error() """ # Set up mock url = preprocess_url('/transit_gateways/testString/connections/testString/tunnels') @@ -1768,16 +1785,16 @@ def test_get_transit_gateway_gre_tunnel_value_error(self): 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_transit_gateway_gre_tunnel(**req_copy) + _service.list_transit_gateway_gre_tunnel(**req_copy) - def test_get_transit_gateway_gre_tunnel_value_error_with_retries(self): - # Enable retries and run test_get_transit_gateway_gre_tunnel_value_error. + def test_list_transit_gateway_gre_tunnel_value_error_with_retries(self): + # Enable retries and run test_list_transit_gateway_gre_tunnel_value_error. _service.enable_retries() - self.test_get_transit_gateway_gre_tunnel_value_error() + self.test_list_transit_gateway_gre_tunnel_value_error() - # Disable retries and run test_get_transit_gateway_gre_tunnel_value_error. + # Disable retries and run test_list_transit_gateway_gre_tunnel_value_error. _service.disable_retries() - self.test_get_transit_gateway_gre_tunnel_value_error() + self.test_list_transit_gateway_gre_tunnel_value_error() class TestCreateTransitGatewayGreTunnel: @@ -2102,18 +2119,22 @@ def test_update_transit_gateway_connection_tunnels_all_params(self): status=200, ) + # Construct a dict representation of a TransitGatewayTunnelPatch model + transit_gateway_tunnel_patch_model = {} + transit_gateway_tunnel_patch_model['name'] = 'gre2' + # Set up parameter values transit_gateway_id = 'testString' id = 'testString' gre_tunnel_id = 'testString' - name = 'gre2' + transit_gateway_tunnel_patch = transit_gateway_tunnel_patch_model # Invoke method response = _service.update_transit_gateway_connection_tunnels( transit_gateway_id, id, gre_tunnel_id, - name=name, + transit_gateway_tunnel_patch, headers={}, ) @@ -2122,7 +2143,7 @@ def test_update_transit_gateway_connection_tunnels_all_params(self): assert response.status_code == 200 # Validate body params req_body = json.loads(str(responses.calls[0].request.body, 'utf-8')) - assert req_body['name'] == 'gre2' + assert req_body == transit_gateway_tunnel_patch def test_update_transit_gateway_connection_tunnels_all_params_with_retries(self): # Enable retries and run test_update_transit_gateway_connection_tunnels_all_params. @@ -2149,17 +2170,22 @@ def test_update_transit_gateway_connection_tunnels_value_error(self): status=200, ) + # Construct a dict representation of a TransitGatewayTunnelPatch model + transit_gateway_tunnel_patch_model = {} + transit_gateway_tunnel_patch_model['name'] = 'gre2' + # Set up parameter values transit_gateway_id = 'testString' id = 'testString' gre_tunnel_id = 'testString' - name = 'gre2' + transit_gateway_tunnel_patch = transit_gateway_tunnel_patch_model # Pass in all but one required param and check for a ValueError req_param_dict = { "transit_gateway_id": transit_gateway_id, "id": id, "gre_tunnel_id": gre_tunnel_id, + "transit_gateway_tunnel_patch": transit_gateway_tunnel_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()} @@ -2182,7 +2208,7 @@ def test_update_transit_gateway_connection_tunnels_value_error_with_retries(self ############################################################################## ############################################################################## -# Start of Service: TransitLocation +# Start of Service: TransitLocations ############################################################################## # region @@ -2316,7 +2342,7 @@ def test_get_gateway_location_all_params(self): """ # Set up mock url = preprocess_url('/locations/testString') - mock_response = '{"billing_location": "us", "name": "us-south", "type": "region", "local_connection_locations": [{"display_name": "Dallas", "name": "us-south", "supported_connection_types": ["supported_connection_types"], "type": "region"}], "zones": [{"zones": [{"name": "us-south-1"}]}]}' + mock_response = '{"billing_location": "us", "name": "us-south", "type": "region", "local_connection_locations": [{"display_name": "Dallas", "name": "us-south", "supported_connection_types": ["supported_connection_types"], "type": "region"}], "zones": [{"name": "us-south-1"}]}' responses.add( responses.GET, url, @@ -2354,7 +2380,7 @@ def test_get_gateway_location_value_error(self): """ # Set up mock url = preprocess_url('/locations/testString') - mock_response = '{"billing_location": "us", "name": "us-south", "type": "region", "local_connection_locations": [{"display_name": "Dallas", "name": "us-south", "supported_connection_types": ["supported_connection_types"], "type": "region"}], "zones": [{"zones": [{"name": "us-south-1"}]}]}' + mock_response = '{"billing_location": "us", "name": "us-south", "type": "region", "local_connection_locations": [{"display_name": "Dallas", "name": "us-south", "supported_connection_types": ["supported_connection_types"], "type": "region"}], "zones": [{"name": "us-south-1"}]}' responses.add( responses.GET, url, @@ -2387,7 +2413,7 @@ def test_get_gateway_location_value_error_with_retries(self): # endregion ############################################################################## -# End of Service: TransitLocation +# End of Service: TransitLocations ############################################################################## ############################################################################## @@ -3420,36 +3446,6 @@ def test_get_transit_gateway_route_report_value_error_with_retries(self): # region -class TestModel_GreTunnelZoneReference: - """ - Test Class for GreTunnelZoneReference - """ - - def test_gre_tunnel_zone_reference_serialization(self): - """ - Test serialization/deserialization for GreTunnelZoneReference - """ - - # Construct a json representation of a GreTunnelZoneReference model - gre_tunnel_zone_reference_model_json = {} - gre_tunnel_zone_reference_model_json['name'] = 'us-south-1' - - # Construct a model instance of GreTunnelZoneReference by calling from_dict on the json representation - gre_tunnel_zone_reference_model = GreTunnelZoneReference.from_dict(gre_tunnel_zone_reference_model_json) - assert gre_tunnel_zone_reference_model != False - - # Construct a model instance of GreTunnelZoneReference by calling from_dict on the json representation - gre_tunnel_zone_reference_model_dict = GreTunnelZoneReference.from_dict(gre_tunnel_zone_reference_model_json).__dict__ - gre_tunnel_zone_reference_model2 = GreTunnelZoneReference(**gre_tunnel_zone_reference_model_dict) - - # Verify the model instances are equivalent - assert gre_tunnel_zone_reference_model == gre_tunnel_zone_reference_model2 - - # Convert model instance back to dict and verify no loss of data - gre_tunnel_zone_reference_model_json2 = gre_tunnel_zone_reference_model.to_dict() - assert gre_tunnel_zone_reference_model_json2 == gre_tunnel_zone_reference_model_json - - class TestModel_PaginationFirstConnection: """ Test Class for PaginationFirstConnection @@ -3745,109 +3741,6 @@ def test_prefix_filter_put_serialization(self): assert prefix_filter_put_model_json2 == prefix_filter_put_model_json -class TestModel_RedundantGRETunnelCollection: - """ - Test Class for RedundantGRETunnelCollection - """ - - def test_redundant_gre_tunnel_collection_serialization(self): - """ - Test serialization/deserialization for RedundantGRETunnelCollection - """ - - # Construct dict forms of any model objects needed in order to build this model. - - rgre_tunnel_zone_reference_model = {} # RgreTunnelZoneReference - rgre_tunnel_zone_reference_model['name'] = 'us-south-1' - - redundant_gre_tunnel_reference_model = {} # RedundantGRETunnelReference - redundant_gre_tunnel_reference_model['base_network_type'] = 'classic' - redundant_gre_tunnel_reference_model['created_at'] = '2019-01-01T12:00:00Z' - redundant_gre_tunnel_reference_model['id'] = '1a15dca5-7e33-45e1-b7c5-bc690e569531' - redundant_gre_tunnel_reference_model['local_bgp_asn'] = 38 - redundant_gre_tunnel_reference_model['local_gateway_ip'] = '10.242.63.12' - redundant_gre_tunnel_reference_model['local_tunnel_ip'] = '192.168.100.20' - redundant_gre_tunnel_reference_model['mtu'] = 9000 - redundant_gre_tunnel_reference_model['name'] = 'gre1' - redundant_gre_tunnel_reference_model['network_account_id'] = 'testString' - redundant_gre_tunnel_reference_model['network_id'] = 'crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b' - redundant_gre_tunnel_reference_model['remote_bgp_asn'] = 65010 - redundant_gre_tunnel_reference_model['remote_gateway_ip'] = '10.242.33.22' - redundant_gre_tunnel_reference_model['remote_tunnel_ip'] = '192.168.129.1' - redundant_gre_tunnel_reference_model['status'] = 'attached' - redundant_gre_tunnel_reference_model['updated_at'] = '2019-01-01T12:00:00Z' - redundant_gre_tunnel_reference_model['zone'] = rgre_tunnel_zone_reference_model - - # Construct a json representation of a RedundantGRETunnelCollection model - redundant_gre_tunnel_collection_model_json = {} - redundant_gre_tunnel_collection_model_json['tunnels'] = [redundant_gre_tunnel_reference_model] - - # Construct a model instance of RedundantGRETunnelCollection by calling from_dict on the json representation - redundant_gre_tunnel_collection_model = RedundantGRETunnelCollection.from_dict(redundant_gre_tunnel_collection_model_json) - assert redundant_gre_tunnel_collection_model != False - - # Construct a model instance of RedundantGRETunnelCollection by calling from_dict on the json representation - redundant_gre_tunnel_collection_model_dict = RedundantGRETunnelCollection.from_dict(redundant_gre_tunnel_collection_model_json).__dict__ - redundant_gre_tunnel_collection_model2 = RedundantGRETunnelCollection(**redundant_gre_tunnel_collection_model_dict) - - # Verify the model instances are equivalent - assert redundant_gre_tunnel_collection_model == redundant_gre_tunnel_collection_model2 - - # Convert model instance back to dict and verify no loss of data - redundant_gre_tunnel_collection_model_json2 = redundant_gre_tunnel_collection_model.to_dict() - assert redundant_gre_tunnel_collection_model_json2 == redundant_gre_tunnel_collection_model_json - - -class TestModel_RedundantGRETunnelReference: - """ - Test Class for RedundantGRETunnelReference - """ - - def test_redundant_gre_tunnel_reference_serialization(self): - """ - Test serialization/deserialization for RedundantGRETunnelReference - """ - - # Construct dict forms of any model objects needed in order to build this model. - - rgre_tunnel_zone_reference_model = {} # RgreTunnelZoneReference - rgre_tunnel_zone_reference_model['name'] = 'us-south-1' - - # Construct a json representation of a RedundantGRETunnelReference model - redundant_gre_tunnel_reference_model_json = {} - redundant_gre_tunnel_reference_model_json['base_network_type'] = 'classic' - redundant_gre_tunnel_reference_model_json['created_at'] = '2019-01-01T12:00:00Z' - redundant_gre_tunnel_reference_model_json['id'] = '1a15dca5-7e33-45e1-b7c5-bc690e569531' - redundant_gre_tunnel_reference_model_json['local_bgp_asn'] = 38 - redundant_gre_tunnel_reference_model_json['local_gateway_ip'] = '10.242.63.12' - redundant_gre_tunnel_reference_model_json['local_tunnel_ip'] = '192.168.100.20' - redundant_gre_tunnel_reference_model_json['mtu'] = 9000 - redundant_gre_tunnel_reference_model_json['name'] = 'gre1' - redundant_gre_tunnel_reference_model_json['network_account_id'] = 'testString' - redundant_gre_tunnel_reference_model_json['network_id'] = 'crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b' - redundant_gre_tunnel_reference_model_json['remote_bgp_asn'] = 65010 - redundant_gre_tunnel_reference_model_json['remote_gateway_ip'] = '10.242.33.22' - redundant_gre_tunnel_reference_model_json['remote_tunnel_ip'] = '192.168.129.1' - redundant_gre_tunnel_reference_model_json['status'] = 'attached' - redundant_gre_tunnel_reference_model_json['updated_at'] = '2019-01-01T12:00:00Z' - redundant_gre_tunnel_reference_model_json['zone'] = rgre_tunnel_zone_reference_model - - # Construct a model instance of RedundantGRETunnelReference by calling from_dict on the json representation - redundant_gre_tunnel_reference_model = RedundantGRETunnelReference.from_dict(redundant_gre_tunnel_reference_model_json) - assert redundant_gre_tunnel_reference_model != False - - # Construct a model instance of RedundantGRETunnelReference by calling from_dict on the json representation - redundant_gre_tunnel_reference_model_dict = RedundantGRETunnelReference.from_dict(redundant_gre_tunnel_reference_model_json).__dict__ - redundant_gre_tunnel_reference_model2 = RedundantGRETunnelReference(**redundant_gre_tunnel_reference_model_dict) - - # Verify the model instances are equivalent - assert redundant_gre_tunnel_reference_model == redundant_gre_tunnel_reference_model2 - - # Convert model instance back to dict and verify no loss of data - redundant_gre_tunnel_reference_model_json2 = redundant_gre_tunnel_reference_model.to_dict() - assert redundant_gre_tunnel_reference_model_json2 == redundant_gre_tunnel_reference_model_json - - class TestModel_ResourceGroupIdentity: """ Test Class for ResourceGroupIdentity @@ -3909,36 +3802,6 @@ def test_resource_group_reference_serialization(self): assert resource_group_reference_model_json2 == resource_group_reference_model_json -class TestModel_RgreTunnelZoneReference: - """ - Test Class for RgreTunnelZoneReference - """ - - def test_rgre_tunnel_zone_reference_serialization(self): - """ - Test serialization/deserialization for RgreTunnelZoneReference - """ - - # Construct a json representation of a RgreTunnelZoneReference model - rgre_tunnel_zone_reference_model_json = {} - rgre_tunnel_zone_reference_model_json['name'] = 'us-south-1' - - # Construct a model instance of RgreTunnelZoneReference by calling from_dict on the json representation - rgre_tunnel_zone_reference_model = RgreTunnelZoneReference.from_dict(rgre_tunnel_zone_reference_model_json) - assert rgre_tunnel_zone_reference_model != False - - # Construct a model instance of RgreTunnelZoneReference by calling from_dict on the json representation - rgre_tunnel_zone_reference_model_dict = RgreTunnelZoneReference.from_dict(rgre_tunnel_zone_reference_model_json).__dict__ - rgre_tunnel_zone_reference_model2 = RgreTunnelZoneReference(**rgre_tunnel_zone_reference_model_dict) - - # Verify the model instances are equivalent - assert rgre_tunnel_zone_reference_model == rgre_tunnel_zone_reference_model2 - - # Convert model instance back to dict and verify no loss of data - rgre_tunnel_zone_reference_model_json2 = rgre_tunnel_zone_reference_model.to_dict() - assert rgre_tunnel_zone_reference_model_json2 == rgre_tunnel_zone_reference_model_json - - class TestModel_RouteReport: """ Test Class for RouteReport @@ -4328,16 +4191,13 @@ def test_ts_location_serialization(self): zone_reference_model = {} # ZoneReference zone_reference_model['name'] = 'us-south-1' - zone_reference_collection_model = {} # ZoneReferenceCollection - zone_reference_collection_model['zones'] = [zone_reference_model] - # Construct a json representation of a TSLocation model ts_location_model_json = {} ts_location_model_json['billing_location'] = 'us' ts_location_model_json['name'] = 'us-south' ts_location_model_json['type'] = 'region' ts_location_model_json['local_connection_locations'] = [ts_local_location_model] - ts_location_model_json['zones'] = [zone_reference_collection_model] + ts_location_model_json['zones'] = [zone_reference_model] # Construct a model instance of TSLocation by calling from_dict on the json representation ts_location_model = TSLocation.from_dict(ts_location_model_json) @@ -4414,26 +4274,26 @@ def test_transit_connection_serialization(self): transit_gateway_reference_model['id'] = '456f58c1-afe7-123a-0a0a-7f3d720f1a44' transit_gateway_reference_model['name'] = 'my-transit-gw100' - rgre_tunnel_zone_reference_model = {} # RgreTunnelZoneReference - rgre_tunnel_zone_reference_model['name'] = 'us-south-1' - - transit_gateway_redundant_gre_tunnel_reference_model = {} # TransitGatewayRedundantGRETunnelReference - transit_gateway_redundant_gre_tunnel_reference_model['created_at'] = '2019-01-01T12:00:00Z' - transit_gateway_redundant_gre_tunnel_reference_model['id'] = '1a15dca5-7e33-45e1-b7c5-bc690e569531' - transit_gateway_redundant_gre_tunnel_reference_model['local_bgp_asn'] = 38 - transit_gateway_redundant_gre_tunnel_reference_model['local_gateway_ip'] = '10.242.63.12' - transit_gateway_redundant_gre_tunnel_reference_model['local_tunnel_ip'] = '192.168.100.20' - transit_gateway_redundant_gre_tunnel_reference_model['mtu'] = 9000 - transit_gateway_redundant_gre_tunnel_reference_model['name'] = 'gre1' - transit_gateway_redundant_gre_tunnel_reference_model['remote_bgp_asn'] = 65010 - transit_gateway_redundant_gre_tunnel_reference_model['remote_gateway_ip'] = '10.242.33.22' - transit_gateway_redundant_gre_tunnel_reference_model['remote_tunnel_ip'] = '192.168.129.1' - transit_gateway_redundant_gre_tunnel_reference_model['status'] = 'attached' - transit_gateway_redundant_gre_tunnel_reference_model['updated_at'] = '2019-01-01T12:00:00Z' - transit_gateway_redundant_gre_tunnel_reference_model['zone'] = rgre_tunnel_zone_reference_model - - gre_tunnel_zone_reference_model = {} # GreTunnelZoneReference - gre_tunnel_zone_reference_model['name'] = 'us-south-1' + zone_reference_model = {} # ZoneReference + zone_reference_model['name'] = 'us-south-1' + + transit_gateway_tunnel_model = {} # TransitGatewayTunnel + 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_gateway_ip'] = '10.242.63.12' + transit_gateway_tunnel_model['local_tunnel_ip'] = '192.168.100.20' + transit_gateway_tunnel_model['mtu'] = 9000 + transit_gateway_tunnel_model['name'] = 'gre1' + transit_gateway_tunnel_model['network_account_id'] = 'testString' + transit_gateway_tunnel_model['network_id'] = 'crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b' + transit_gateway_tunnel_model['remote_bgp_asn'] = 65010 + transit_gateway_tunnel_model['remote_gateway_ip'] = '10.242.33.22' + transit_gateway_tunnel_model['remote_tunnel_ip'] = '192.168.129.1' + transit_gateway_tunnel_model['status'] = 'attached' + transit_gateway_tunnel_model['updated_at'] = '2019-01-01T12:00:00Z' + transit_gateway_tunnel_model['zone'] = zone_reference_model # Construct a json representation of a TransitConnection model transit_connection_model_json = {} @@ -4457,9 +4317,9 @@ def test_transit_connection_serialization(self): transit_connection_model_json['request_status'] = 'pending' transit_connection_model_json['status'] = 'attached' transit_connection_model_json['transit_gateway'] = transit_gateway_reference_model - transit_connection_model_json['tunnels'] = [transit_gateway_redundant_gre_tunnel_reference_model] + transit_connection_model_json['tunnels'] = [transit_gateway_tunnel_model] transit_connection_model_json['updated_at'] = '2019-01-01T12:00:00Z' - transit_connection_model_json['zone'] = gre_tunnel_zone_reference_model + transit_connection_model_json['zone'] = zone_reference_model # Construct a model instance of TransitConnection by calling from_dict on the json representation transit_connection_model = TransitConnection.from_dict(transit_connection_model_json) @@ -4504,26 +4364,26 @@ def test_transit_connection_collection_serialization(self): transit_gateway_reference_model['id'] = '456f58c1-afe7-123a-0a0a-7f3d720f1a44' transit_gateway_reference_model['name'] = 'my-transit-gw100' - rgre_tunnel_zone_reference_model = {} # RgreTunnelZoneReference - rgre_tunnel_zone_reference_model['name'] = 'us-south-1' - - transit_gateway_redundant_gre_tunnel_reference_model = {} # TransitGatewayRedundantGRETunnelReference - transit_gateway_redundant_gre_tunnel_reference_model['created_at'] = '2019-01-01T12:00:00Z' - transit_gateway_redundant_gre_tunnel_reference_model['id'] = '1a15dca5-7e33-45e1-b7c5-bc690e569531' - transit_gateway_redundant_gre_tunnel_reference_model['local_bgp_asn'] = 38 - transit_gateway_redundant_gre_tunnel_reference_model['local_gateway_ip'] = '10.242.63.12' - transit_gateway_redundant_gre_tunnel_reference_model['local_tunnel_ip'] = '192.168.100.20' - transit_gateway_redundant_gre_tunnel_reference_model['mtu'] = 9000 - transit_gateway_redundant_gre_tunnel_reference_model['name'] = 'gre1' - transit_gateway_redundant_gre_tunnel_reference_model['remote_bgp_asn'] = 65010 - transit_gateway_redundant_gre_tunnel_reference_model['remote_gateway_ip'] = '10.242.33.22' - transit_gateway_redundant_gre_tunnel_reference_model['remote_tunnel_ip'] = '192.168.129.1' - transit_gateway_redundant_gre_tunnel_reference_model['status'] = 'attached' - transit_gateway_redundant_gre_tunnel_reference_model['updated_at'] = '2019-01-01T12:00:00Z' - transit_gateway_redundant_gre_tunnel_reference_model['zone'] = rgre_tunnel_zone_reference_model - - gre_tunnel_zone_reference_model = {} # GreTunnelZoneReference - gre_tunnel_zone_reference_model['name'] = 'us-south-1' + zone_reference_model = {} # ZoneReference + zone_reference_model['name'] = 'us-south-1' + + transit_gateway_tunnel_model = {} # TransitGatewayTunnel + 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_gateway_ip'] = '10.242.63.12' + transit_gateway_tunnel_model['local_tunnel_ip'] = '192.168.100.20' + transit_gateway_tunnel_model['mtu'] = 9000 + transit_gateway_tunnel_model['name'] = 'gre1' + transit_gateway_tunnel_model['network_account_id'] = 'testString' + transit_gateway_tunnel_model['network_id'] = 'crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b' + transit_gateway_tunnel_model['remote_bgp_asn'] = 65010 + transit_gateway_tunnel_model['remote_gateway_ip'] = '10.242.33.22' + transit_gateway_tunnel_model['remote_tunnel_ip'] = '192.168.129.1' + transit_gateway_tunnel_model['status'] = 'attached' + transit_gateway_tunnel_model['updated_at'] = '2019-01-01T12:00:00Z' + transit_gateway_tunnel_model['zone'] = zone_reference_model transit_connection_model = {} # TransitConnection transit_connection_model['base_network_type'] = 'classic' @@ -4546,9 +4406,9 @@ def test_transit_connection_collection_serialization(self): transit_connection_model['request_status'] = 'pending' transit_connection_model['status'] = 'attached' transit_connection_model['transit_gateway'] = transit_gateway_reference_model - transit_connection_model['tunnels'] = [transit_gateway_redundant_gre_tunnel_reference_model] + transit_connection_model['tunnels'] = [transit_gateway_tunnel_model] transit_connection_model['updated_at'] = '2019-01-01T12:00:00Z' - transit_connection_model['zone'] = gre_tunnel_zone_reference_model + transit_connection_model['zone'] = zone_reference_model pagination_first_connection_model = {} # PaginationFirstConnection pagination_first_connection_model['href'] = 'https://transit.cloud.ibm.com/v1/connections?limit=50' @@ -4598,12 +4458,15 @@ def test_transit_gateway_serialization(self): # Construct a json representation of a TransitGateway model transit_gateway_model_json = {} - transit_gateway_model_json['id'] = 'ef4dcb1a-fee4-41c7-9e11-9cd99e65c1f4' - transit_gateway_model_json['crn'] = 'crn:v1:bluemix:public:transit:dal03:a/57a7d05f36894e3cb9b46a43556d903e::gateway:ef4dcb1a-fee4-41c7-9e11-9cd99e65c1f4' - transit_gateway_model_json['name'] = 'my-transit-gateway-in-TransitGateway' - transit_gateway_model_json['location'] = 'us-south' + transit_gateway_model_json['connection_count'] = 5 + transit_gateway_model_json['connection_needs_attention'] = True transit_gateway_model_json['created_at'] = '2019-01-01T12:00:00Z' + transit_gateway_model_json['crn'] = 'crn:v1:bluemix:public:transit:dal03:a/57a7d05f36894e3cb9b46a43556d903e::gateway:ef4dcb1a-fee4-41c7-9e11-9cd99e65c1f4' transit_gateway_model_json['global'] = True + transit_gateway_model_json['gre_enhanced_route_propagation'] = True + 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['resource_group'] = resource_group_reference_model transit_gateway_model_json['status'] = 'available' transit_gateway_model_json['updated_at'] = '2019-01-01T12:00:00Z' @@ -4648,12 +4511,15 @@ def test_transit_gateway_collection_serialization(self): resource_group_reference_model['id'] = '56969d6043e9465c883cb9f7363e78e8' transit_gateway_model = {} # TransitGateway - transit_gateway_model['id'] = 'ef4dcb1a-fee4-41c7-9e11-9cd99e65c1f4' - transit_gateway_model['crn'] = 'crn:v1:bluemix:public:transit:dal03:a/57a7d05f36894e3cb9b46a43556d903e::gateway:ef4dcb1a-fee4-41c7-9e11-9cd99e65c1f4' - transit_gateway_model['name'] = 'my-transit-gateway-in-TransitGateway' - transit_gateway_model['location'] = 'us-south' + transit_gateway_model['connection_count'] = 5 + transit_gateway_model['connection_needs_attention'] = True transit_gateway_model['created_at'] = '2019-01-01T12:00:00Z' + transit_gateway_model['crn'] = 'crn:v1:bluemix:public:transit:dal03:a/57a7d05f36894e3cb9b46a43556d903e::gateway:ef4dcb1a-fee4-41c7-9e11-9cd99e65c1f4' transit_gateway_model['global'] = True + transit_gateway_model['gre_enhanced_route_propagation'] = True + 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['resource_group'] = resource_group_reference_model transit_gateway_model['status'] = 'available' transit_gateway_model['updated_at'] = '2019-01-01T12:00:00Z' @@ -4703,40 +4569,41 @@ def test_transit_gateway_connection_collection_serialization(self): transit_gateway_connection_prefix_filter_reference_model['prefix'] = '192.168.100.0/24' transit_gateway_connection_prefix_filter_reference_model['updated_at'] = '2019-01-01T12:00:00Z' - rgre_tunnel_zone_reference_model = {} # RgreTunnelZoneReference - rgre_tunnel_zone_reference_model['name'] = 'us-south-1' - - transit_gateway_redundant_gre_tunnel_reference_model = {} # TransitGatewayRedundantGRETunnelReference - transit_gateway_redundant_gre_tunnel_reference_model['created_at'] = '2019-01-01T12:00:00Z' - transit_gateway_redundant_gre_tunnel_reference_model['id'] = '1a15dca5-7e33-45e1-b7c5-bc690e569531' - transit_gateway_redundant_gre_tunnel_reference_model['local_bgp_asn'] = 38 - transit_gateway_redundant_gre_tunnel_reference_model['local_gateway_ip'] = '10.242.63.12' - transit_gateway_redundant_gre_tunnel_reference_model['local_tunnel_ip'] = '192.168.100.20' - transit_gateway_redundant_gre_tunnel_reference_model['mtu'] = 9000 - transit_gateway_redundant_gre_tunnel_reference_model['name'] = 'gre1' - transit_gateway_redundant_gre_tunnel_reference_model['remote_bgp_asn'] = 65010 - transit_gateway_redundant_gre_tunnel_reference_model['remote_gateway_ip'] = '10.242.33.22' - transit_gateway_redundant_gre_tunnel_reference_model['remote_tunnel_ip'] = '192.168.129.1' - transit_gateway_redundant_gre_tunnel_reference_model['status'] = 'attached' - transit_gateway_redundant_gre_tunnel_reference_model['updated_at'] = '2019-01-01T12:00:00Z' - transit_gateway_redundant_gre_tunnel_reference_model['zone'] = rgre_tunnel_zone_reference_model - - gre_tunnel_zone_reference_model = {} # GreTunnelZoneReference - gre_tunnel_zone_reference_model['name'] = 'us-south-1' + zone_reference_model = {} # ZoneReference + zone_reference_model['name'] = 'us-south-1' + + transit_gateway_tunnel_model = {} # TransitGatewayTunnel + 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_gateway_ip'] = '10.242.63.12' + transit_gateway_tunnel_model['local_tunnel_ip'] = '192.168.100.20' + transit_gateway_tunnel_model['mtu'] = 9000 + transit_gateway_tunnel_model['name'] = 'gre1' + transit_gateway_tunnel_model['network_account_id'] = 'testString' + transit_gateway_tunnel_model['network_id'] = 'crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b' + transit_gateway_tunnel_model['remote_bgp_asn'] = 65010 + transit_gateway_tunnel_model['remote_gateway_ip'] = '10.242.33.22' + transit_gateway_tunnel_model['remote_tunnel_ip'] = '192.168.129.1' + transit_gateway_tunnel_model['status'] = 'attached' + transit_gateway_tunnel_model['updated_at'] = '2019-01-01T12:00:00Z' + transit_gateway_tunnel_model['zone'] = zone_reference_model transit_gateway_connection_cust_model = {} # TransitGatewayConnectionCust - transit_gateway_connection_cust_model['base_network_type'] = 'classic' - transit_gateway_connection_cust_model['name'] = 'Transit_Service_BWTN_SJ_DL' - transit_gateway_connection_cust_model['network_id'] = 'crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b' - transit_gateway_connection_cust_model['network_type'] = 'vpc' - transit_gateway_connection_cust_model['id'] = '1a15dca5-7e33-45e1-b7c5-bc690e569531' 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['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 transit_gateway_connection_cust_model['local_gateway_ip'] = '192.168.100.1' transit_gateway_connection_cust_model['local_tunnel_ip'] = '192.168.129.2' transit_gateway_connection_cust_model['mtu'] = 9000 + transit_gateway_connection_cust_model['name'] = 'Transit_Service_BWTN_SJ_DL' transit_gateway_connection_cust_model['network_account_id'] = 'testString' + transit_gateway_connection_cust_model['network_id'] = 'crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b' + transit_gateway_connection_cust_model['network_type'] = 'vpc' transit_gateway_connection_cust_model['prefix_filters'] = [transit_gateway_connection_prefix_filter_reference_model] transit_gateway_connection_cust_model['prefix_filters_default'] = 'permit' transit_gateway_connection_cust_model['remote_bgp_asn'] = 65010 @@ -4744,9 +4611,9 @@ def test_transit_gateway_connection_collection_serialization(self): transit_gateway_connection_cust_model['remote_tunnel_ip'] = '192.168.129.1' transit_gateway_connection_cust_model['request_status'] = 'pending' transit_gateway_connection_cust_model['status'] = 'attached' - transit_gateway_connection_cust_model['tunnels'] = [transit_gateway_redundant_gre_tunnel_reference_model] + transit_gateway_connection_cust_model['tunnels'] = [transit_gateway_tunnel_model] transit_gateway_connection_cust_model['updated_at'] = '2019-01-01T12:00:00Z' - transit_gateway_connection_cust_model['zone'] = gre_tunnel_zone_reference_model + transit_gateway_connection_cust_model['zone'] = zone_reference_model pagination_first_tgw_connection_model = {} # PaginationFirstTGWConnection pagination_first_tgw_connection_model['href'] = 'https://transit.cloud.ibm.com/v1/transit_gateways/{transit_gateway_id}/connections?limit=50' @@ -4801,41 +4668,42 @@ def test_transit_gateway_connection_cust_serialization(self): transit_gateway_connection_prefix_filter_reference_model['prefix'] = '192.168.100.0/24' transit_gateway_connection_prefix_filter_reference_model['updated_at'] = '2019-01-01T12:00:00Z' - rgre_tunnel_zone_reference_model = {} # RgreTunnelZoneReference - rgre_tunnel_zone_reference_model['name'] = 'us-south-1' - - transit_gateway_redundant_gre_tunnel_reference_model = {} # TransitGatewayRedundantGRETunnelReference - transit_gateway_redundant_gre_tunnel_reference_model['created_at'] = '2019-01-01T12:00:00Z' - transit_gateway_redundant_gre_tunnel_reference_model['id'] = '1a15dca5-7e33-45e1-b7c5-bc690e569531' - transit_gateway_redundant_gre_tunnel_reference_model['local_bgp_asn'] = 38 - transit_gateway_redundant_gre_tunnel_reference_model['local_gateway_ip'] = '10.242.63.12' - transit_gateway_redundant_gre_tunnel_reference_model['local_tunnel_ip'] = '192.168.100.20' - transit_gateway_redundant_gre_tunnel_reference_model['mtu'] = 9000 - transit_gateway_redundant_gre_tunnel_reference_model['name'] = 'gre1' - transit_gateway_redundant_gre_tunnel_reference_model['remote_bgp_asn'] = 65010 - transit_gateway_redundant_gre_tunnel_reference_model['remote_gateway_ip'] = '10.242.33.22' - transit_gateway_redundant_gre_tunnel_reference_model['remote_tunnel_ip'] = '192.168.129.1' - transit_gateway_redundant_gre_tunnel_reference_model['status'] = 'attached' - transit_gateway_redundant_gre_tunnel_reference_model['updated_at'] = '2019-01-01T12:00:00Z' - transit_gateway_redundant_gre_tunnel_reference_model['zone'] = rgre_tunnel_zone_reference_model - - gre_tunnel_zone_reference_model = {} # GreTunnelZoneReference - gre_tunnel_zone_reference_model['name'] = 'us-south-1' + zone_reference_model = {} # ZoneReference + zone_reference_model['name'] = 'us-south-1' + + transit_gateway_tunnel_model = {} # TransitGatewayTunnel + 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_gateway_ip'] = '10.242.63.12' + transit_gateway_tunnel_model['local_tunnel_ip'] = '192.168.100.20' + transit_gateway_tunnel_model['mtu'] = 9000 + transit_gateway_tunnel_model['name'] = 'gre1' + transit_gateway_tunnel_model['network_account_id'] = 'testString' + transit_gateway_tunnel_model['network_id'] = 'crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b' + transit_gateway_tunnel_model['remote_bgp_asn'] = 65010 + transit_gateway_tunnel_model['remote_gateway_ip'] = '10.242.33.22' + transit_gateway_tunnel_model['remote_tunnel_ip'] = '192.168.129.1' + transit_gateway_tunnel_model['status'] = 'attached' + transit_gateway_tunnel_model['updated_at'] = '2019-01-01T12:00:00Z' + transit_gateway_tunnel_model['zone'] = zone_reference_model # Construct a json representation of a TransitGatewayConnectionCust model transit_gateway_connection_cust_model_json = {} - transit_gateway_connection_cust_model_json['base_network_type'] = 'classic' - transit_gateway_connection_cust_model_json['name'] = 'Transit_Service_BWTN_SJ_DL' - transit_gateway_connection_cust_model_json['network_id'] = 'crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b' - transit_gateway_connection_cust_model_json['network_type'] = 'vpc' - transit_gateway_connection_cust_model_json['id'] = '1a15dca5-7e33-45e1-b7c5-bc690e569531' 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['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 transit_gateway_connection_cust_model_json['local_gateway_ip'] = '192.168.100.1' transit_gateway_connection_cust_model_json['local_tunnel_ip'] = '192.168.129.2' transit_gateway_connection_cust_model_json['mtu'] = 9000 + transit_gateway_connection_cust_model_json['name'] = 'Transit_Service_BWTN_SJ_DL' transit_gateway_connection_cust_model_json['network_account_id'] = 'testString' + transit_gateway_connection_cust_model_json['network_id'] = 'crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b' + transit_gateway_connection_cust_model_json['network_type'] = 'vpc' transit_gateway_connection_cust_model_json['prefix_filters'] = [transit_gateway_connection_prefix_filter_reference_model] transit_gateway_connection_cust_model_json['prefix_filters_default'] = 'permit' transit_gateway_connection_cust_model_json['remote_bgp_asn'] = 65010 @@ -4843,9 +4711,9 @@ def test_transit_gateway_connection_cust_serialization(self): transit_gateway_connection_cust_model_json['remote_tunnel_ip'] = '192.168.129.1' transit_gateway_connection_cust_model_json['request_status'] = 'pending' transit_gateway_connection_cust_model_json['status'] = 'attached' - transit_gateway_connection_cust_model_json['tunnels'] = [transit_gateway_redundant_gre_tunnel_reference_model] + transit_gateway_connection_cust_model_json['tunnels'] = [transit_gateway_tunnel_model] transit_gateway_connection_cust_model_json['updated_at'] = '2019-01-01T12:00:00Z' - transit_gateway_connection_cust_model_json['zone'] = gre_tunnel_zone_reference_model + transit_gateway_connection_cust_model_json['zone'] = zone_reference_model # Construct a model instance of TransitGatewayConnectionCust by calling from_dict on the json representation transit_gateway_connection_cust_model = TransitGatewayConnectionCust.from_dict(transit_gateway_connection_cust_model_json) @@ -4933,124 +4801,210 @@ def test_transit_gateway_connection_prefix_filter_reference_serialization(self): assert transit_gateway_connection_prefix_filter_reference_model_json2 == transit_gateway_connection_prefix_filter_reference_model_json -class TestModel_TransitGatewayRedundantGRETunnelReference: +class TestModel_TransitGatewayReference: + """ + Test Class for TransitGatewayReference + """ + + def test_transit_gateway_reference_serialization(self): + """ + Test serialization/deserialization for TransitGatewayReference + """ + + # Construct a json representation of a TransitGatewayReference model + transit_gateway_reference_model_json = {} + transit_gateway_reference_model_json['crn'] = 'crn:v1:bluemix:public:transit:us-south:a/123456::gateway:456f58c1-afe7-123a-0a0a-7f3d720f1a44' + transit_gateway_reference_model_json['id'] = '456f58c1-afe7-123a-0a0a-7f3d720f1a44' + transit_gateway_reference_model_json['name'] = 'my-transit-gw100' + + # Construct a model instance of TransitGatewayReference by calling from_dict on the json representation + transit_gateway_reference_model = TransitGatewayReference.from_dict(transit_gateway_reference_model_json) + assert transit_gateway_reference_model != False + + # Construct a model instance of TransitGatewayReference by calling from_dict on the json representation + transit_gateway_reference_model_dict = TransitGatewayReference.from_dict(transit_gateway_reference_model_json).__dict__ + transit_gateway_reference_model2 = TransitGatewayReference(**transit_gateway_reference_model_dict) + + # Verify the model instances are equivalent + assert transit_gateway_reference_model == transit_gateway_reference_model2 + + # Convert model instance back to dict and verify no loss of data + transit_gateway_reference_model_json2 = transit_gateway_reference_model.to_dict() + assert transit_gateway_reference_model_json2 == transit_gateway_reference_model_json + + +class TestModel_TransitGatewayTunnel: """ - Test Class for TransitGatewayRedundantGRETunnelReference + Test Class for TransitGatewayTunnel """ - def test_transit_gateway_redundant_gre_tunnel_reference_serialization(self): + def test_transit_gateway_tunnel_serialization(self): """ - Test serialization/deserialization for TransitGatewayRedundantGRETunnelReference + Test serialization/deserialization for TransitGatewayTunnel """ # Construct dict forms of any model objects needed in order to build this model. - rgre_tunnel_zone_reference_model = {} # RgreTunnelZoneReference - rgre_tunnel_zone_reference_model['name'] = 'us-south-1' - - # Construct a json representation of a TransitGatewayRedundantGRETunnelReference model - transit_gateway_redundant_gre_tunnel_reference_model_json = {} - transit_gateway_redundant_gre_tunnel_reference_model_json['created_at'] = '2019-01-01T12:00:00Z' - transit_gateway_redundant_gre_tunnel_reference_model_json['id'] = '1a15dca5-7e33-45e1-b7c5-bc690e569531' - transit_gateway_redundant_gre_tunnel_reference_model_json['local_bgp_asn'] = 38 - transit_gateway_redundant_gre_tunnel_reference_model_json['local_gateway_ip'] = '10.242.63.12' - transit_gateway_redundant_gre_tunnel_reference_model_json['local_tunnel_ip'] = '192.168.100.20' - transit_gateway_redundant_gre_tunnel_reference_model_json['mtu'] = 9000 - transit_gateway_redundant_gre_tunnel_reference_model_json['name'] = 'gre1' - transit_gateway_redundant_gre_tunnel_reference_model_json['remote_bgp_asn'] = 65010 - transit_gateway_redundant_gre_tunnel_reference_model_json['remote_gateway_ip'] = '10.242.33.22' - transit_gateway_redundant_gre_tunnel_reference_model_json['remote_tunnel_ip'] = '192.168.129.1' - transit_gateway_redundant_gre_tunnel_reference_model_json['status'] = 'attached' - transit_gateway_redundant_gre_tunnel_reference_model_json['updated_at'] = '2019-01-01T12:00:00Z' - transit_gateway_redundant_gre_tunnel_reference_model_json['zone'] = rgre_tunnel_zone_reference_model - - # Construct a model instance of TransitGatewayRedundantGRETunnelReference by calling from_dict on the json representation - transit_gateway_redundant_gre_tunnel_reference_model = TransitGatewayRedundantGRETunnelReference.from_dict(transit_gateway_redundant_gre_tunnel_reference_model_json) - assert transit_gateway_redundant_gre_tunnel_reference_model != False - - # Construct a model instance of TransitGatewayRedundantGRETunnelReference by calling from_dict on the json representation - transit_gateway_redundant_gre_tunnel_reference_model_dict = TransitGatewayRedundantGRETunnelReference.from_dict(transit_gateway_redundant_gre_tunnel_reference_model_json).__dict__ - transit_gateway_redundant_gre_tunnel_reference_model2 = TransitGatewayRedundantGRETunnelReference(**transit_gateway_redundant_gre_tunnel_reference_model_dict) + zone_reference_model = {} # ZoneReference + zone_reference_model['name'] = 'us-south-1' + + # Construct a json representation of a TransitGatewayTunnel model + transit_gateway_tunnel_model_json = {} + 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_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 + transit_gateway_tunnel_model_json['name'] = 'gre1' + transit_gateway_tunnel_model_json['network_account_id'] = 'testString' + transit_gateway_tunnel_model_json['network_id'] = 'crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b' + transit_gateway_tunnel_model_json['remote_bgp_asn'] = 65010 + transit_gateway_tunnel_model_json['remote_gateway_ip'] = '10.242.33.22' + transit_gateway_tunnel_model_json['remote_tunnel_ip'] = '192.168.129.1' + transit_gateway_tunnel_model_json['status'] = 'attached' + transit_gateway_tunnel_model_json['updated_at'] = '2019-01-01T12:00:00Z' + transit_gateway_tunnel_model_json['zone'] = zone_reference_model + + # Construct a model instance of TransitGatewayTunnel by calling from_dict on the json representation + transit_gateway_tunnel_model = TransitGatewayTunnel.from_dict(transit_gateway_tunnel_model_json) + assert transit_gateway_tunnel_model != False + + # Construct a model instance of TransitGatewayTunnel by calling from_dict on the json representation + transit_gateway_tunnel_model_dict = TransitGatewayTunnel.from_dict(transit_gateway_tunnel_model_json).__dict__ + transit_gateway_tunnel_model2 = TransitGatewayTunnel(**transit_gateway_tunnel_model_dict) # Verify the model instances are equivalent - assert transit_gateway_redundant_gre_tunnel_reference_model == transit_gateway_redundant_gre_tunnel_reference_model2 + assert transit_gateway_tunnel_model == transit_gateway_tunnel_model2 # Convert model instance back to dict and verify no loss of data - transit_gateway_redundant_gre_tunnel_reference_model_json2 = transit_gateway_redundant_gre_tunnel_reference_model.to_dict() - assert transit_gateway_redundant_gre_tunnel_reference_model_json2 == transit_gateway_redundant_gre_tunnel_reference_model_json + transit_gateway_tunnel_model_json2 = transit_gateway_tunnel_model.to_dict() + assert transit_gateway_tunnel_model_json2 == transit_gateway_tunnel_model_json -class TestModel_TransitGatewayRedundantGRETunnelTemplate: +class TestModel_TransitGatewayTunnelCollection: """ - Test Class for TransitGatewayRedundantGRETunnelTemplate + Test Class for TransitGatewayTunnelCollection """ - def test_transit_gateway_redundant_gre_tunnel_template_serialization(self): + def test_transit_gateway_tunnel_collection_serialization(self): """ - Test serialization/deserialization for TransitGatewayRedundantGRETunnelTemplate + Test serialization/deserialization for TransitGatewayTunnelCollection """ # Construct dict forms of any model objects needed in order to build this model. - zone_identity_model = {} # ZoneIdentityByName - zone_identity_model['name'] = 'us-south-1' + zone_reference_model = {} # ZoneReference + zone_reference_model['name'] = 'us-south-1' + + transit_gateway_tunnel_model = {} # TransitGatewayTunnel + 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_gateway_ip'] = '10.242.63.12' + transit_gateway_tunnel_model['local_tunnel_ip'] = '192.168.100.20' + transit_gateway_tunnel_model['mtu'] = 9000 + transit_gateway_tunnel_model['name'] = 'gre1' + transit_gateway_tunnel_model['network_account_id'] = 'testString' + transit_gateway_tunnel_model['network_id'] = 'crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b' + transit_gateway_tunnel_model['remote_bgp_asn'] = 65010 + transit_gateway_tunnel_model['remote_gateway_ip'] = '10.242.33.22' + transit_gateway_tunnel_model['remote_tunnel_ip'] = '192.168.129.1' + transit_gateway_tunnel_model['status'] = 'attached' + transit_gateway_tunnel_model['updated_at'] = '2019-01-01T12:00:00Z' + transit_gateway_tunnel_model['zone'] = zone_reference_model + + # Construct a json representation of a TransitGatewayTunnelCollection model + transit_gateway_tunnel_collection_model_json = {} + transit_gateway_tunnel_collection_model_json['tunnels'] = [transit_gateway_tunnel_model] + + # Construct a model instance of TransitGatewayTunnelCollection by calling from_dict on the json representation + transit_gateway_tunnel_collection_model = TransitGatewayTunnelCollection.from_dict(transit_gateway_tunnel_collection_model_json) + assert transit_gateway_tunnel_collection_model != False + + # Construct a model instance of TransitGatewayTunnelCollection by calling from_dict on the json representation + transit_gateway_tunnel_collection_model_dict = TransitGatewayTunnelCollection.from_dict(transit_gateway_tunnel_collection_model_json).__dict__ + transit_gateway_tunnel_collection_model2 = TransitGatewayTunnelCollection(**transit_gateway_tunnel_collection_model_dict) + + # Verify the model instances are equivalent + assert transit_gateway_tunnel_collection_model == transit_gateway_tunnel_collection_model2 + + # Convert model instance back to dict and verify no loss of data + transit_gateway_tunnel_collection_model_json2 = transit_gateway_tunnel_collection_model.to_dict() + assert transit_gateway_tunnel_collection_model_json2 == transit_gateway_tunnel_collection_model_json + - # Construct a json representation of a TransitGatewayRedundantGRETunnelTemplate model - transit_gateway_redundant_gre_tunnel_template_model_json = {} - transit_gateway_redundant_gre_tunnel_template_model_json['local_gateway_ip'] = '10.242.63.12' - transit_gateway_redundant_gre_tunnel_template_model_json['local_tunnel_ip'] = '192.168.100.20' - transit_gateway_redundant_gre_tunnel_template_model_json['name'] = 'gre1' - transit_gateway_redundant_gre_tunnel_template_model_json['remote_bgp_asn'] = 65010 - transit_gateway_redundant_gre_tunnel_template_model_json['remote_gateway_ip'] = '10.242.33.22' - transit_gateway_redundant_gre_tunnel_template_model_json['remote_tunnel_ip'] = '192.168.129.1' - transit_gateway_redundant_gre_tunnel_template_model_json['zone'] = zone_identity_model +class TestModel_TransitGatewayTunnelPatch: + """ + Test Class for TransitGatewayTunnelPatch + """ + + def test_transit_gateway_tunnel_patch_serialization(self): + """ + Test serialization/deserialization for TransitGatewayTunnelPatch + """ - # Construct a model instance of TransitGatewayRedundantGRETunnelTemplate by calling from_dict on the json representation - transit_gateway_redundant_gre_tunnel_template_model = TransitGatewayRedundantGRETunnelTemplate.from_dict(transit_gateway_redundant_gre_tunnel_template_model_json) - assert transit_gateway_redundant_gre_tunnel_template_model != False + # Construct a json representation of a TransitGatewayTunnelPatch model + transit_gateway_tunnel_patch_model_json = {} + transit_gateway_tunnel_patch_model_json['name'] = 'gre2' - # Construct a model instance of TransitGatewayRedundantGRETunnelTemplate by calling from_dict on the json representation - transit_gateway_redundant_gre_tunnel_template_model_dict = TransitGatewayRedundantGRETunnelTemplate.from_dict(transit_gateway_redundant_gre_tunnel_template_model_json).__dict__ - transit_gateway_redundant_gre_tunnel_template_model2 = TransitGatewayRedundantGRETunnelTemplate(**transit_gateway_redundant_gre_tunnel_template_model_dict) + # Construct a model instance of TransitGatewayTunnelPatch by calling from_dict on the json representation + transit_gateway_tunnel_patch_model = TransitGatewayTunnelPatch.from_dict(transit_gateway_tunnel_patch_model_json) + assert transit_gateway_tunnel_patch_model != False + + # Construct a model instance of TransitGatewayTunnelPatch by calling from_dict on the json representation + transit_gateway_tunnel_patch_model_dict = TransitGatewayTunnelPatch.from_dict(transit_gateway_tunnel_patch_model_json).__dict__ + transit_gateway_tunnel_patch_model2 = TransitGatewayTunnelPatch(**transit_gateway_tunnel_patch_model_dict) # Verify the model instances are equivalent - assert transit_gateway_redundant_gre_tunnel_template_model == transit_gateway_redundant_gre_tunnel_template_model2 + assert transit_gateway_tunnel_patch_model == transit_gateway_tunnel_patch_model2 # Convert model instance back to dict and verify no loss of data - transit_gateway_redundant_gre_tunnel_template_model_json2 = transit_gateway_redundant_gre_tunnel_template_model.to_dict() - assert transit_gateway_redundant_gre_tunnel_template_model_json2 == transit_gateway_redundant_gre_tunnel_template_model_json + transit_gateway_tunnel_patch_model_json2 = transit_gateway_tunnel_patch_model.to_dict() + assert transit_gateway_tunnel_patch_model_json2 == transit_gateway_tunnel_patch_model_json -class TestModel_TransitGatewayReference: +class TestModel_TransitGatewayTunnelTemplate: """ - Test Class for TransitGatewayReference + Test Class for TransitGatewayTunnelTemplate """ - def test_transit_gateway_reference_serialization(self): + def test_transit_gateway_tunnel_template_serialization(self): """ - Test serialization/deserialization for TransitGatewayReference + Test serialization/deserialization for TransitGatewayTunnelTemplate """ - # Construct a json representation of a TransitGatewayReference model - transit_gateway_reference_model_json = {} - transit_gateway_reference_model_json['crn'] = 'crn:v1:bluemix:public:transit:us-south:a/123456::gateway:456f58c1-afe7-123a-0a0a-7f3d720f1a44' - transit_gateway_reference_model_json['id'] = '456f58c1-afe7-123a-0a0a-7f3d720f1a44' - transit_gateway_reference_model_json['name'] = 'my-transit-gw100' + # Construct dict forms of any model objects needed in order to build this model. - # Construct a model instance of TransitGatewayReference by calling from_dict on the json representation - transit_gateway_reference_model = TransitGatewayReference.from_dict(transit_gateway_reference_model_json) - assert transit_gateway_reference_model != False + zone_identity_model = {} # ZoneIdentityByName + zone_identity_model['name'] = 'us-south-1' - # Construct a model instance of TransitGatewayReference by calling from_dict on the json representation - transit_gateway_reference_model_dict = TransitGatewayReference.from_dict(transit_gateway_reference_model_json).__dict__ - transit_gateway_reference_model2 = TransitGatewayReference(**transit_gateway_reference_model_dict) + # Construct a json representation of a TransitGatewayTunnelTemplate model + transit_gateway_tunnel_template_model_json = {} + transit_gateway_tunnel_template_model_json['local_gateway_ip'] = '10.242.63.12' + transit_gateway_tunnel_template_model_json['local_tunnel_ip'] = '192.168.100.20' + transit_gateway_tunnel_template_model_json['name'] = 'gre1' + transit_gateway_tunnel_template_model_json['remote_bgp_asn'] = 65010 + transit_gateway_tunnel_template_model_json['remote_gateway_ip'] = '10.242.33.22' + transit_gateway_tunnel_template_model_json['remote_tunnel_ip'] = '192.168.129.1' + transit_gateway_tunnel_template_model_json['zone'] = zone_identity_model + + # Construct a model instance of TransitGatewayTunnelTemplate by calling from_dict on the json representation + transit_gateway_tunnel_template_model = TransitGatewayTunnelTemplate.from_dict(transit_gateway_tunnel_template_model_json) + assert transit_gateway_tunnel_template_model != False + + # Construct a model instance of TransitGatewayTunnelTemplate by calling from_dict on the json representation + transit_gateway_tunnel_template_model_dict = TransitGatewayTunnelTemplate.from_dict(transit_gateway_tunnel_template_model_json).__dict__ + transit_gateway_tunnel_template_model2 = TransitGatewayTunnelTemplate(**transit_gateway_tunnel_template_model_dict) # Verify the model instances are equivalent - assert transit_gateway_reference_model == transit_gateway_reference_model2 + assert transit_gateway_tunnel_template_model == transit_gateway_tunnel_template_model2 # Convert model instance back to dict and verify no loss of data - transit_gateway_reference_model_json2 = transit_gateway_reference_model.to_dict() - assert transit_gateway_reference_model_json2 == transit_gateway_reference_model_json + transit_gateway_tunnel_template_model_json2 = transit_gateway_tunnel_template_model.to_dict() + assert transit_gateway_tunnel_template_model_json2 == transit_gateway_tunnel_template_model_json class TestModel_ZoneReference: @@ -5083,41 +5037,6 @@ def test_zone_reference_serialization(self): assert zone_reference_model_json2 == zone_reference_model_json -class TestModel_ZoneReferenceCollection: - """ - Test Class for ZoneReferenceCollection - """ - - def test_zone_reference_collection_serialization(self): - """ - Test serialization/deserialization for ZoneReferenceCollection - """ - - # Construct dict forms of any model objects needed in order to build this model. - - zone_reference_model = {} # ZoneReference - zone_reference_model['name'] = 'us-south-1' - - # Construct a json representation of a ZoneReferenceCollection model - zone_reference_collection_model_json = {} - zone_reference_collection_model_json['zones'] = [zone_reference_model] - - # Construct a model instance of ZoneReferenceCollection by calling from_dict on the json representation - zone_reference_collection_model = ZoneReferenceCollection.from_dict(zone_reference_collection_model_json) - assert zone_reference_collection_model != False - - # Construct a model instance of ZoneReferenceCollection by calling from_dict on the json representation - zone_reference_collection_model_dict = ZoneReferenceCollection.from_dict(zone_reference_collection_model_json).__dict__ - zone_reference_collection_model2 = ZoneReferenceCollection(**zone_reference_collection_model_dict) - - # Verify the model instances are equivalent - assert zone_reference_collection_model == zone_reference_collection_model2 - - # Convert model instance back to dict and verify no loss of data - zone_reference_collection_model_json2 = zone_reference_collection_model.to_dict() - assert zone_reference_collection_model_json2 == zone_reference_collection_model_json - - class TestModel_ZoneIdentityByName: """ Test Class for ZoneIdentityByName