diff --git a/ibm_cloud_networking_services/transit_gateway_apis_v1.py b/ibm_cloud_networking_services/transit_gateway_apis_v1.py index 5f29f60..f44c195 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. 2023. +# (C) Copyright IBM Corp. 2024. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -523,6 +523,7 @@ def create_transit_gateway_connection( remote_bgp_asn: int = None, remote_gateway_ip: str = None, remote_tunnel_ip: str = None, + tunnels: List['TransitGatewayRedundantGRETunnelTemplate'] = None, zone: 'ZoneIdentity' = None, **kwargs, ) -> DetailedResponse: @@ -533,51 +534,56 @@ def create_transit_gateway_connection( :param str transit_gateway_id: The Transit Gateway identifier. :param str network_type: Defines what type of network is connected via this - connection. For access to gre_tunnel or unbound_gre_tunnel connections - contact IBM support. + 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' and 'unbound_gre_tunnel' + 'directlink', 'vpc', + 'power_virtual_server', 'unbound_gre_tunnel' 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' connections. This field is required to be unspecified - for network type 'classic', 'directlink', 'vpc', 'power_virtual_server' and - 'gre_tunnel' connections. + '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. :param str local_gateway_ip: (optional) Local gateway IP address. This field is required for network type 'gre_tunnel' and 'unbound_gre_tunnel' connections. This field is required to be unspecified for network type - 'classic', 'directlink', 'vpc' and 'power_virtual_server' connections. + 'classic', 'directlink', 'vpc', 'power_virtual_server' and 'redundant_gre' + connections. :param str local_tunnel_ip: (optional) Local tunnel IP address. The local_tunnel_ip and remote_tunnel_ip addresses must be in the same /30 network. Neither can be the network nor broadcast addresses. This field is required for network type 'gre_tunnel' and 'unbound_gre_tunnel' connections. This field is required to be unspecified for network type 'classic', - 'directlink', 'vpc' and 'power_virtual_server' connections. + 'directlink', 'vpc', 'power_virtual_server' and 'redundant_gre' + connections. :param str name: (optional) The user-defined name for this transit gateway connection. Network type 'vpc' connections are defaulted to the name of the VPC. Network type 'classic' connections are named 'Classic'. - This field is required for network type 'gre_tunnel' and - 'unbound_gre_tunnel' connections. + 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. :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' and the - GRE tunnel is in a different account than the gateway. + '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. This field is required - to be unspecified for network type 'classic', 'gre_tunnel' and - 'unbound_gre_tunnel' connections. + '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. :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', @@ -587,13 +593,13 @@ def create_transit_gateway_connection( applied last, or just before applying the default. This field is optional for network type 'classic', 'vpc', 'directlink', and 'power_virtual_server' connections. This field is required to be unspecified for network type - 'gre_tunnel' and 'unbound_gre_tunnel' connections. + 'gre_tunnel', 'unbound_gre_tunnel' 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' and 'unbound_gre_tunnel' - connections. + unspecified for network type 'gre_tunnel', 'unbound_gre_tunnel' 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 @@ -602,25 +608,31 @@ def create_transit_gateway_connection( This field is optional for network type 'gre_tunnel' and 'unbound_gre_tunnel' connections. This field is required to be unspecified for network type 'classic', - 'directlink', 'vpc' and 'power_virtual_server' connections. + 'directlink', 'vpc', 'power_virtual_server' and 'gre_tunnel' connections. :param str remote_gateway_ip: (optional) Remote gateway IP address. This field is required for network type 'gre_tunnel' and 'unbound_gre_tunnel' connections. This field is required to be unspecified for network type - 'classic', 'directlink', 'vpc' and 'power_virtual_server' connections. + 'classic', 'directlink', 'vpc', 'power_virtual_server' and 'redundant_gre' + connections. :param str remote_tunnel_ip: (optional) Remote tunnel IP address. The local_tunnel_ip and remote_tunnel_ip addresses must be in the same /30 network. Neither can be the network nor broadcast addresses. This field is required for network type 'gre_tunnel' and 'unbound_gre_tunnel' connections. This field is required to be unspecified for network type 'classic', - 'directlink', 'vpc' and 'power_virtual_server' connections. + 'directlink', 'vpc', 'power_virtual_server' and 'redundant_gre' + 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' and 'power_virtual_server' connections. + 'directlink', 'vpc', 'power_virtual_server' and 'redundant_gre' + connections. :param dict headers: A `dict` containing the request headers :return: A `DetailedResponse` containing the result, headers and HTTP status code. :rtype: DetailedResponse with `dict` result representing a `TransitGatewayConnectionCust` object @@ -632,6 +644,8 @@ def create_transit_gateway_connection( raise ValueError('network_type must be provided') if prefix_filters is not None: prefix_filters = [convert_model(x) for x in prefix_filters] + if tunnels is not None: + tunnels = [convert_model(x) for x in tunnels] if zone is not None: zone = convert_model(zone) headers = {} @@ -660,6 +674,7 @@ def create_transit_gateway_connection( 'remote_bgp_asn': remote_bgp_asn, 'remote_gateway_ip': remote_gateway_ip, 'remote_tunnel_ip': remote_tunnel_ip, + 'tunnels': tunnels, 'zone': zone, } data = {k: v for (k, v) in data.items() if v is not None} @@ -929,29 +944,33 @@ def create_transit_gateway_connection_actions( response = self.send(request, **kwargs) return response - ######################### - # Transit Location - ######################### - - def list_gateway_locations( + def get_transit_gateway_gre_tunnel( self, + transit_gateway_id: str, + id: str, **kwargs, ) -> DetailedResponse: """ - List all locations that support Transit Gateways. + Retrieves specified Transit Gateway redundant gre connection tunnels. - List all locations that support Transit Gateways. + This request retrieves a list of all the tunnels for the redundant gre conneciton. + :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 `TSCollection` object + :rtype: DetailedResponse with `dict` result representing a `RedundantGRETunnelCollection` object """ + if not transit_gateway_id: + raise ValueError('transit_gateway_id must be provided') + if not id: + raise ValueError('id must be provided') headers = {} sdk_headers = get_sdk_headers( service_name=self.DEFAULT_SERVICE_NAME, service_version='V1', - operation_id='list_gateway_locations', + operation_id='get_transit_gateway_gre_tunnel', ) headers.update(sdk_headers) @@ -964,7 +983,10 @@ def list_gateway_locations( del kwargs['headers'] headers['Accept'] = 'application/json' - url = '/locations' + path_param_keys = ['transit_gateway_id', 'id'] + path_param_values = self.encode_path_vars(transit_gateway_id, id) + path_param_dict = dict(zip(path_param_keys, path_param_values)) + url = '/transit_gateways/{transit_gateway_id}/connections/{id}/tunnels'.format(**path_param_dict) request = self.prepare_request( method='GET', url=url, @@ -975,29 +997,70 @@ def list_gateway_locations( response = self.send(request, **kwargs) return response - def get_gateway_location( + def create_transit_gateway_gre_tunnel( self, + transit_gateway_id: str, + id: str, + local_gateway_ip: str, + local_tunnel_ip: str, name: str, + remote_gateway_ip: str, + remote_tunnel_ip: str, + zone: 'ZoneIdentity', + *, + remote_bgp_asn: int = None, **kwargs, ) -> DetailedResponse: """ - Show the details of a given Transit Gateway location. + Create Transit Gateway redundant GRE tunnel. - Get the details of a Transit Gateway Location. + Add a tunnel to an existing Redundant GRE connection. - :param str name: The Transit Gateway location Name. + :param str transit_gateway_id: The Transit Gateway identifier. + :param str id: The connection identifier. + :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 str name: The user-defined name for this tunnel connection. + :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 ZoneIdentity zone: Specify the connection's location. The specified + availability zone must reside in the gateway's region. + Use the IBM Cloud global catalog to list zones within the desired region. + :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. :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 `TSLocation` object + :rtype: DetailedResponse with `dict` result representing a `RedundantGRETunnelReference` object """ - if not name: + if not transit_gateway_id: + raise ValueError('transit_gateway_id must be provided') + if not id: + raise ValueError('id must be provided') + if local_gateway_ip is None: + raise ValueError('local_gateway_ip must be provided') + if local_tunnel_ip is None: + raise ValueError('local_tunnel_ip must be provided') + if name is None: raise ValueError('name must be provided') + if remote_gateway_ip is None: + raise ValueError('remote_gateway_ip must be provided') + if remote_tunnel_ip is None: + raise ValueError('remote_tunnel_ip must be provided') + if zone is None: + raise ValueError('zone must be provided') + zone = convert_model(zone) headers = {} sdk_headers = get_sdk_headers( service_name=self.DEFAULT_SERVICE_NAME, service_version='V1', - operation_id='get_gateway_location', + operation_id='create_transit_gateway_gre_tunnel', ) headers.update(sdk_headers) @@ -1005,56 +1068,70 @@ def get_gateway_location( 'version': self.version, } + data = { + 'local_gateway_ip': local_gateway_ip, + 'local_tunnel_ip': local_tunnel_ip, + 'name': name, + 'remote_gateway_ip': remote_gateway_ip, + 'remote_tunnel_ip': remote_tunnel_ip, + 'zone': zone, + 'remote_bgp_asn': remote_bgp_asn, + } + data = {k: v for (k, v) in data.items() if v is not None} + data = json.dumps(data) + headers['content-type'] = 'application/json' + if 'headers' in kwargs: headers.update(kwargs.get('headers')) del kwargs['headers'] headers['Accept'] = 'application/json' - path_param_keys = ['name'] - path_param_values = self.encode_path_vars(name) + path_param_keys = ['transit_gateway_id', 'id'] + path_param_values = self.encode_path_vars(transit_gateway_id, id) path_param_dict = dict(zip(path_param_keys, path_param_values)) - url = '/locations/{name}'.format(**path_param_dict) + url = '/transit_gateways/{transit_gateway_id}/connections/{id}/tunnels'.format(**path_param_dict) request = self.prepare_request( - method='GET', + method='POST', url=url, headers=headers, params=params, + data=data, ) response = self.send(request, **kwargs) return response - ######################### - # Transit Gateway Connection Prefix Filters - ######################### - - def list_transit_gateway_connection_prefix_filters( + def delete_transit_gateway_connection_tunnels( self, transit_gateway_id: str, id: str, + gre_tunnel_id: str, **kwargs, ) -> DetailedResponse: """ - Retrieves all prefix filters in a Transit Gateway connection. + Delete specified Transit Gateway redundant GRE tunnel. - This request retrieves all prefix filters in a Transit Gateway connection. + Remove a tunnel from a redundant GRE 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 `PrefixFilterCollection` object + :rtype: DetailedResponse """ if not transit_gateway_id: raise ValueError('transit_gateway_id must be provided') if not id: raise ValueError('id must be provided') + if not gre_tunnel_id: + raise ValueError('gre_tunnel_id must be provided') headers = {} sdk_headers = get_sdk_headers( service_name=self.DEFAULT_SERVICE_NAME, service_version='V1', - operation_id='list_transit_gateway_connection_prefix_filters', + operation_id='delete_transit_gateway_connection_tunnels', ) headers.update(sdk_headers) @@ -1065,14 +1142,13 @@ def list_transit_gateway_connection_prefix_filters( if 'headers' in kwargs: headers.update(kwargs.get('headers')) del kwargs['headers'] - headers['Accept'] = 'application/json' - path_param_keys = ['transit_gateway_id', 'id'] - path_param_values = self.encode_path_vars(transit_gateway_id, id) + path_param_keys = ['transit_gateway_id', 'id', 'gre_tunnel_id'] + path_param_values = self.encode_path_vars(transit_gateway_id, id, gre_tunnel_id) path_param_dict = dict(zip(path_param_keys, path_param_values)) - url = '/transit_gateways/{transit_gateway_id}/connections/{id}/prefix_filters'.format(**path_param_dict) + url = '/transit_gateways/{transit_gateway_id}/connections/{id}/tunnels/{gre_tunnel_id}'.format(**path_param_dict) request = self.prepare_request( - method='GET', + method='DELETE', url=url, headers=headers, params=params, @@ -1081,75 +1157,37 @@ def list_transit_gateway_connection_prefix_filters( response = self.send(request, **kwargs) return response - def create_transit_gateway_connection_prefix_filter( + def get_transit_gateway_connection_tunnels( self, transit_gateway_id: str, id: str, - action: str, - prefix: str, - *, - before: str = None, - ge: int = None, - le: int = None, + gre_tunnel_id: str, **kwargs, ) -> DetailedResponse: """ - Add a prefix filter to a Transit Gateway Connection. + Retrieves specified Transit Gateway connection tunnel. - Add a prefix filter to a 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 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', - this filter can apply to multiple routes with different prefix lengths, but - will still only apply to prefixes contained in the address space defined by - 'prefix'. - :param str before: (optional) A reference to the prefix filter that will be - the next filter applied to the Transit Gateway connection. - If this field is blank, this prefix filter will be the last rule applied - before the connection's default rule. - When a prefix filter is created with the same before field as an existing - prefix filter, the existing filter will be applied before the new filter, - and the existing filter's before field will be updated accordingly. - :param 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. - 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. - :param int le: (optional) Defines the maximum matched prefix precision. If - this field is non-zero then the filter will match all routes within the - 'prefix' that have a prefix length less than or equal to this value. - This value can be zero, or a non-negative number greater than or equal to - the 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. + :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 `PrefixFilterCust` object + :rtype: DetailedResponse with `dict` result representing a `RedundantGRETunnelReference` object """ if not transit_gateway_id: raise ValueError('transit_gateway_id must be provided') if not id: raise ValueError('id must be provided') - if action is None: - raise ValueError('action must be provided') - if prefix is None: - raise ValueError('prefix must be provided') + if not gre_tunnel_id: + raise ValueError('gre_tunnel_id must be provided') headers = {} sdk_headers = get_sdk_headers( service_name=self.DEFAULT_SERVICE_NAME, service_version='V1', - operation_id='create_transit_gateway_connection_prefix_filter', + operation_id='get_transit_gateway_connection_tunnels', ) headers.update(sdk_headers) @@ -1157,69 +1195,60 @@ def create_transit_gateway_connection_prefix_filter( 'version': self.version, } - data = { - 'action': action, - 'prefix': prefix, - 'before': before, - 'ge': ge, - 'le': le, - } - data = {k: v for (k, v) in data.items() if v is not None} - data = json.dumps(data) - headers['content-type'] = 'application/json' - if 'headers' in kwargs: headers.update(kwargs.get('headers')) del kwargs['headers'] headers['Accept'] = 'application/json' - path_param_keys = ['transit_gateway_id', 'id'] - path_param_values = self.encode_path_vars(transit_gateway_id, id) + path_param_keys = ['transit_gateway_id', 'id', 'gre_tunnel_id'] + path_param_values = self.encode_path_vars(transit_gateway_id, id, gre_tunnel_id) path_param_dict = dict(zip(path_param_keys, path_param_values)) - url = '/transit_gateways/{transit_gateway_id}/connections/{id}/prefix_filters'.format(**path_param_dict) + url = '/transit_gateways/{transit_gateway_id}/connections/{id}/tunnels/{gre_tunnel_id}'.format(**path_param_dict) request = self.prepare_request( - method='POST', + method='GET', url=url, headers=headers, params=params, - data=data, ) response = self.send(request, **kwargs) return response - def replace_transit_gateway_connection_prefix_filter( + def update_transit_gateway_connection_tunnels( self, transit_gateway_id: str, id: str, - prefix_filters: List['PrefixFilterPut'], + gre_tunnel_id: str, + *, + name: str = None, **kwargs, ) -> DetailedResponse: """ - Replaces the prefix filters of the Transit Gateway Connection. + Updates specified Transit Gateway redundant GRE tunnel. - Replaces the prefix filters of the Transit Gateway Connection. + Update the name of a connection tunnel. :param str transit_gateway_id: The Transit Gateway identifier. :param str id: The connection identifier. - :param List[PrefixFilterPut] prefix_filters: Array of prefix filters. + :param str gre_tunnel_id: The tunnel identifier. + :param str name: (optional) The user-defined name for this connection + tunnel. :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 `PrefixFilterCollection` object + :rtype: DetailedResponse with `dict` result representing a `RedundantGRETunnelReference` object """ if not transit_gateway_id: raise ValueError('transit_gateway_id must be provided') if not id: raise ValueError('id must be provided') - if prefix_filters is None: - raise ValueError('prefix_filters must be provided') - prefix_filters = [convert_model(x) for x in prefix_filters] + if not gre_tunnel_id: + raise ValueError('gre_tunnel_id must be provided') headers = {} sdk_headers = get_sdk_headers( service_name=self.DEFAULT_SERVICE_NAME, service_version='V1', - operation_id='replace_transit_gateway_connection_prefix_filter', + operation_id='update_transit_gateway_connection_tunnels', ) headers.update(sdk_headers) @@ -1228,7 +1257,7 @@ def replace_transit_gateway_connection_prefix_filter( } data = { - 'prefix_filters': prefix_filters, + 'name': name, } data = {k: v for (k, v) in data.items() if v is not None} data = json.dumps(data) @@ -1239,12 +1268,12 @@ def replace_transit_gateway_connection_prefix_filter( del kwargs['headers'] headers['Accept'] = 'application/json' - path_param_keys = ['transit_gateway_id', 'id'] - path_param_values = self.encode_path_vars(transit_gateway_id, id) + path_param_keys = ['transit_gateway_id', 'id', 'gre_tunnel_id'] + path_param_values = self.encode_path_vars(transit_gateway_id, id, gre_tunnel_id) path_param_dict = dict(zip(path_param_keys, path_param_values)) - url = '/transit_gateways/{transit_gateway_id}/connections/{id}/prefix_filters'.format(**path_param_dict) + url = '/transit_gateways/{transit_gateway_id}/connections/{id}/tunnels/{gre_tunnel_id}'.format(**path_param_dict) request = self.prepare_request( - method='PUT', + method='PATCH', url=url, headers=headers, params=params, @@ -1254,37 +1283,29 @@ def replace_transit_gateway_connection_prefix_filter( response = self.send(request, **kwargs) return response - def delete_transit_gateway_connection_prefix_filter( + ######################### + # Transit Location + ######################### + + def list_gateway_locations( self, - transit_gateway_id: str, - id: str, - filter_id: str, **kwargs, ) -> DetailedResponse: """ - Remove prefix filter from Transit Gateway Connection. + List all locations that support Transit Gateways. - Delete a prefix filter. + List all locations that support Transit Gateways. - :param str transit_gateway_id: The Transit Gateway identifier. - :param str id: The connection identifier. - :param str filter_id: Prefix filter identifier. :param dict headers: A `dict` containing the request headers :return: A `DetailedResponse` containing the result, headers and HTTP status code. - :rtype: DetailedResponse + :rtype: DetailedResponse with `dict` result representing a `TSCollection` object """ - if not transit_gateway_id: - raise ValueError('transit_gateway_id must be provided') - if not id: - raise ValueError('id must be provided') - if not filter_id: - raise ValueError('filter_id must be provided') headers = {} sdk_headers = get_sdk_headers( service_name=self.DEFAULT_SERVICE_NAME, service_version='V1', - operation_id='delete_transit_gateway_connection_prefix_filter', + operation_id='list_gateway_locations', ) headers.update(sdk_headers) @@ -1295,13 +1316,11 @@ def delete_transit_gateway_connection_prefix_filter( if 'headers' in kwargs: headers.update(kwargs.get('headers')) del kwargs['headers'] + headers['Accept'] = 'application/json' - path_param_keys = ['transit_gateway_id', 'id', 'filter_id'] - path_param_values = self.encode_path_vars(transit_gateway_id, id, filter_id) - path_param_dict = dict(zip(path_param_keys, path_param_values)) - url = '/transit_gateways/{transit_gateway_id}/connections/{id}/prefix_filters/{filter_id}'.format(**path_param_dict) + url = '/locations' request = self.prepare_request( - method='DELETE', + method='GET', url=url, headers=headers, params=params, @@ -1310,37 +1329,29 @@ def delete_transit_gateway_connection_prefix_filter( response = self.send(request, **kwargs) return response - def get_transit_gateway_connection_prefix_filter( + def get_gateway_location( self, - transit_gateway_id: str, - id: str, - filter_id: str, + name: str, **kwargs, ) -> DetailedResponse: """ - Retrieves specified Transit Gateway connection prefix filter. + Show the details of a given Transit Gateway location. - This request retrieves a prefix filter from the Transit Gateway Connection. + Get the details of a Transit Gateway Location. - :param str transit_gateway_id: The Transit Gateway identifier. - :param str id: The connection identifier. - :param str filter_id: Prefix filter identifier. + :param str name: The Transit Gateway location Name. :param dict headers: A `dict` containing the request headers :return: A `DetailedResponse` containing the result, headers and HTTP status code. - :rtype: DetailedResponse with `dict` result representing a `PrefixFilterCust` object + :rtype: DetailedResponse with `dict` result representing a `TSLocation` object """ - if not transit_gateway_id: - raise ValueError('transit_gateway_id must be provided') - if not id: - raise ValueError('id must be provided') - if not filter_id: - raise ValueError('filter_id must be provided') + if not name: + raise ValueError('name must be provided') headers = {} sdk_headers = get_sdk_headers( service_name=self.DEFAULT_SERVICE_NAME, service_version='V1', - operation_id='get_transit_gateway_connection_prefix_filter', + operation_id='get_gateway_location', ) headers.update(sdk_headers) @@ -1353,10 +1364,10 @@ def get_transit_gateway_connection_prefix_filter( del kwargs['headers'] headers['Accept'] = 'application/json' - path_param_keys = ['transit_gateway_id', 'id', 'filter_id'] - path_param_values = self.encode_path_vars(transit_gateway_id, id, filter_id) + path_param_keys = ['name'] + path_param_values = self.encode_path_vars(name) path_param_dict = dict(zip(path_param_keys, path_param_values)) - url = '/transit_gateways/{transit_gateway_id}/connections/{id}/prefix_filters/{filter_id}'.format(**path_param_dict) + url = '/locations/{name}'.format(**path_param_dict) request = self.prepare_request( method='GET', url=url, @@ -1367,29 +1378,90 @@ def get_transit_gateway_connection_prefix_filter( response = self.send(request, **kwargs) return response - def update_transit_gateway_connection_prefix_filter( + ######################### + # Transit Gateway Connection Prefix Filters + ######################### + + def list_transit_gateway_connection_prefix_filters( self, transit_gateway_id: str, id: str, - filter_id: str, - *, - action: str = None, - before: str = None, - ge: int = None, - le: int = None, - prefix: str = None, **kwargs, ) -> DetailedResponse: """ - Updates specified Transit Gateway connection prefix filter. + Retrieves all prefix filters in a Transit Gateway connection. - Update prefix filter for a Transit Gateway Connection. + This request retrieves all prefix filters in a Transit Gateway connection. :param str transit_gateway_id: The Transit Gateway identifier. :param str id: The connection identifier. - :param str filter_id: Prefix filter identifier. - :param str action: (optional) Whether or not this prefix filter should - allow or deny prefixes matching this filter's prefix definition. + :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 `PrefixFilterCollection` object + """ + + if not transit_gateway_id: + raise ValueError('transit_gateway_id must be provided') + if not id: + raise ValueError('id must be provided') + headers = {} + sdk_headers = get_sdk_headers( + service_name=self.DEFAULT_SERVICE_NAME, + service_version='V1', + operation_id='list_transit_gateway_connection_prefix_filters', + ) + headers.update(sdk_headers) + + params = { + 'version': self.version, + } + + if 'headers' in kwargs: + headers.update(kwargs.get('headers')) + del kwargs['headers'] + headers['Accept'] = 'application/json' + + path_param_keys = ['transit_gateway_id', 'id'] + path_param_values = self.encode_path_vars(transit_gateway_id, id) + path_param_dict = dict(zip(path_param_keys, path_param_values)) + url = '/transit_gateways/{transit_gateway_id}/connections/{id}/prefix_filters'.format(**path_param_dict) + request = self.prepare_request( + method='GET', + url=url, + headers=headers, + params=params, + ) + + response = self.send(request, **kwargs) + return response + + def create_transit_gateway_connection_prefix_filter( + self, + transit_gateway_id: str, + id: str, + action: str, + prefix: str, + *, + before: str = None, + ge: int = None, + le: int = None, + **kwargs, + ) -> DetailedResponse: + """ + 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', + this filter can apply to multiple routes with different prefix lengths, but + will still only apply to prefixes contained in the address space defined by + 'prefix'. :param 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 @@ -1399,7 +1471,7 @@ 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 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 @@ -1414,7 +1486,6 @@ def update_transit_gateway_connection_prefix_filter( 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. :rtype: DetailedResponse with `dict` result representing a `PrefixFilterCust` object @@ -1424,13 +1495,15 @@ def update_transit_gateway_connection_prefix_filter( raise ValueError('transit_gateway_id must be provided') if not id: raise ValueError('id must be provided') - if not filter_id: - raise ValueError('filter_id must be provided') + if action is None: + raise ValueError('action must be provided') + if prefix is None: + raise ValueError('prefix must be provided') headers = {} sdk_headers = get_sdk_headers( service_name=self.DEFAULT_SERVICE_NAME, service_version='V1', - operation_id='update_transit_gateway_connection_prefix_filter', + operation_id='create_transit_gateway_connection_prefix_filter', ) headers.update(sdk_headers) @@ -1440,10 +1513,10 @@ def update_transit_gateway_connection_prefix_filter( data = { 'action': action, + 'prefix': prefix, 'before': before, 'ge': ge, 'le': le, - 'prefix': prefix, } data = {k: v for (k, v) in data.items() if v is not None} data = json.dumps(data) @@ -1454,12 +1527,12 @@ def update_transit_gateway_connection_prefix_filter( del kwargs['headers'] headers['Accept'] = 'application/json' - path_param_keys = ['transit_gateway_id', 'id', 'filter_id'] - path_param_values = self.encode_path_vars(transit_gateway_id, id, filter_id) + path_param_keys = ['transit_gateway_id', 'id'] + path_param_values = self.encode_path_vars(transit_gateway_id, id) path_param_dict = dict(zip(path_param_keys, path_param_values)) - url = '/transit_gateways/{transit_gateway_id}/connections/{id}/prefix_filters/{filter_id}'.format(**path_param_dict) + url = '/transit_gateways/{transit_gateway_id}/connections/{id}/prefix_filters'.format(**path_param_dict) request = self.prepare_request( - method='PATCH', + method='POST', url=url, headers=headers, params=params, @@ -1469,35 +1542,38 @@ def update_transit_gateway_connection_prefix_filter( response = self.send(request, **kwargs) return response - ######################### - # Transit Gateway Route Reports - ######################### - - def list_transit_gateway_route_reports( + def replace_transit_gateway_connection_prefix_filter( self, transit_gateway_id: str, + id: str, + prefix_filters: List['PrefixFilterPut'], **kwargs, ) -> DetailedResponse: """ - List route reports. + Replaces the prefix filters of the Transit Gateway Connection. - Retrieve all route reports for the specified Transit Gateway. There will normally - be at most one completed report and one pending report. Additionally, completed - route reports are written to IBM Cloud Activity Tracker. + Replaces the prefix filters of the Transit Gateway Connection. :param str transit_gateway_id: The Transit Gateway identifier. + :param str id: The connection identifier. + :param List[PrefixFilterPut] prefix_filters: Array of prefix filters. :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 `RouteReportCollection` object + :rtype: DetailedResponse with `dict` result representing a `PrefixFilterCollection` object """ if not transit_gateway_id: raise ValueError('transit_gateway_id must be provided') + if not id: + raise ValueError('id must be provided') + if prefix_filters is None: + raise ValueError('prefix_filters must be provided') + prefix_filters = [convert_model(x) for x in prefix_filters] headers = {} sdk_headers = get_sdk_headers( service_name=self.DEFAULT_SERVICE_NAME, service_version='V1', - operation_id='list_transit_gateway_route_reports', + operation_id='replace_transit_gateway_connection_prefix_filter', ) headers.update(sdk_headers) @@ -1505,50 +1581,64 @@ def list_transit_gateway_route_reports( 'version': self.version, } + data = { + 'prefix_filters': prefix_filters, + } + data = {k: v for (k, v) in data.items() if v is not None} + data = json.dumps(data) + headers['content-type'] = 'application/json' + if 'headers' in kwargs: headers.update(kwargs.get('headers')) del kwargs['headers'] headers['Accept'] = 'application/json' - path_param_keys = ['transit_gateway_id'] - path_param_values = self.encode_path_vars(transit_gateway_id) + path_param_keys = ['transit_gateway_id', 'id'] + path_param_values = self.encode_path_vars(transit_gateway_id, id) path_param_dict = dict(zip(path_param_keys, path_param_values)) - url = '/transit_gateways/{transit_gateway_id}/route_reports'.format(**path_param_dict) + url = '/transit_gateways/{transit_gateway_id}/connections/{id}/prefix_filters'.format(**path_param_dict) request = self.prepare_request( - method='GET', + method='PUT', url=url, headers=headers, params=params, + data=data, ) response = self.send(request, **kwargs) return response - def create_transit_gateway_route_report( + def delete_transit_gateway_connection_prefix_filter( self, transit_gateway_id: str, + id: str, + filter_id: str, **kwargs, ) -> DetailedResponse: """ - Request a route report. + Remove prefix filter from Transit Gateway Connection. - Request route report generation. While report generation is in progress, - additional requests to generate a report are ignored and return the current - pending report. + Delete a prefix filter. :param str transit_gateway_id: The Transit Gateway identifier. + :param str id: The connection identifier. + :param str filter_id: Prefix filter 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 `RouteReport` object + :rtype: DetailedResponse """ if not transit_gateway_id: raise ValueError('transit_gateway_id must be provided') + if not id: + raise ValueError('id must be provided') + if not filter_id: + raise ValueError('filter_id must be provided') headers = {} sdk_headers = get_sdk_headers( service_name=self.DEFAULT_SERVICE_NAME, service_version='V1', - operation_id='create_transit_gateway_route_report', + operation_id='delete_transit_gateway_connection_prefix_filter', ) headers.update(sdk_headers) @@ -1559,14 +1649,13 @@ def create_transit_gateway_route_report( if 'headers' in kwargs: headers.update(kwargs.get('headers')) del kwargs['headers'] - headers['Accept'] = 'application/json' - path_param_keys = ['transit_gateway_id'] - path_param_values = self.encode_path_vars(transit_gateway_id) + path_param_keys = ['transit_gateway_id', 'id', 'filter_id'] + path_param_values = self.encode_path_vars(transit_gateway_id, id, filter_id) path_param_dict = dict(zip(path_param_keys, path_param_values)) - url = '/transit_gateways/{transit_gateway_id}/route_reports'.format(**path_param_dict) + url = '/transit_gateways/{transit_gateway_id}/connections/{id}/prefix_filters/{filter_id}'.format(**path_param_dict) request = self.prepare_request( - method='POST', + method='DELETE', url=url, headers=headers, params=params, @@ -1575,33 +1664,37 @@ def create_transit_gateway_route_report( response = self.send(request, **kwargs) return response - def delete_transit_gateway_route_report( + def get_transit_gateway_connection_prefix_filter( self, transit_gateway_id: str, id: str, + filter_id: str, **kwargs, ) -> DetailedResponse: """ - Delete route report. + Retrieves specified Transit Gateway connection prefix filter. - Delete a route report. + This request retrieves a prefix filter from the Transit Gateway Connection. :param str transit_gateway_id: The Transit Gateway identifier. - :param str id: Route report identifier. + :param str id: The connection identifier. + :param str filter_id: Prefix filter identifier. :param dict headers: A `dict` containing the request headers :return: A `DetailedResponse` containing the result, headers and HTTP status code. - :rtype: DetailedResponse + :rtype: DetailedResponse with `dict` result representing a `PrefixFilterCust` object """ if not transit_gateway_id: raise ValueError('transit_gateway_id must be provided') if not id: raise ValueError('id must be provided') + if not filter_id: + raise ValueError('filter_id must be provided') headers = {} sdk_headers = get_sdk_headers( service_name=self.DEFAULT_SERVICE_NAME, service_version='V1', - operation_id='delete_transit_gateway_route_report', + operation_id='get_transit_gateway_connection_prefix_filter', ) headers.update(sdk_headers) @@ -1612,13 +1705,14 @@ def delete_transit_gateway_route_report( if 'headers' in kwargs: headers.update(kwargs.get('headers')) del kwargs['headers'] + headers['Accept'] = 'application/json' - path_param_keys = ['transit_gateway_id', 'id'] - path_param_values = self.encode_path_vars(transit_gateway_id, id) + path_param_keys = ['transit_gateway_id', 'id', 'filter_id'] + path_param_values = self.encode_path_vars(transit_gateway_id, id, filter_id) path_param_dict = dict(zip(path_param_keys, path_param_values)) - url = '/transit_gateways/{transit_gateway_id}/route_reports/{id}'.format(**path_param_dict) + url = '/transit_gateways/{transit_gateway_id}/connections/{id}/prefix_filters/{filter_id}'.format(**path_param_dict) request = self.prepare_request( - method='DELETE', + method='GET', url=url, headers=headers, params=params, @@ -1627,33 +1721,70 @@ def delete_transit_gateway_route_report( response = self.send(request, **kwargs) return response - def get_transit_gateway_route_report( + def update_transit_gateway_connection_prefix_filter( self, transit_gateway_id: str, id: str, + filter_id: str, + *, + action: str = None, + before: str = None, + ge: int = None, + le: int = None, + prefix: str = None, **kwargs, ) -> DetailedResponse: """ - Retrieve route report. + Updates specified Transit Gateway connection prefix filter. - Retrieve a route report. + Update prefix filter for a Transit Gateway Connection. :param str transit_gateway_id: The Transit Gateway identifier. - :param str id: Route report identifier. + :param str id: The connection identifier. + :param str filter_id: Prefix filter identifier. + :param str action: (optional) Whether or not this prefix filter should + allow or deny prefixes matching this filter's prefix definition. + :param str before: (optional) A reference to the prefix filter that will be + the next filter applied to the Transit Gateway connection. + If this field is blank, this prefix filter will be the last rule applied + before the connection's default rule. + When a prefix filter is created with the same before field as an existing + prefix filter, the existing filter will be applied before the new filter, + and the existing filter's before field will be updated accordingly. + :param int ge: (optional) Defines the minimum matched prefix precision. If + this field is non-zero then the filter will match all routes within the + 'prefix' that have a prefix length greater or equal to this value. + This value can be zero, or a non-negative number greater than or equal to + the 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. + :param int le: (optional) Defines the maximum matched prefix precision. If + this field is non-zero then the filter will match all routes within the + 'prefix' that have a prefix length less than or equal to this value. + This value can be zero, or a non-negative number greater than or equal to + the 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. + :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. - :rtype: DetailedResponse with `dict` result representing a `RouteReport` object + :rtype: DetailedResponse with `dict` result representing a `PrefixFilterCust` object """ if not transit_gateway_id: raise ValueError('transit_gateway_id must be provided') if not id: raise ValueError('id must be provided') + if not filter_id: + raise ValueError('filter_id must be provided') headers = {} sdk_headers = get_sdk_headers( service_name=self.DEFAULT_SERVICE_NAME, service_version='V1', - operation_id='get_transit_gateway_route_report', + operation_id='update_transit_gateway_connection_prefix_filter', ) headers.update(sdk_headers) @@ -1661,17 +1792,240 @@ def get_transit_gateway_route_report( 'version': self.version, } + data = { + 'action': action, + 'before': before, + 'ge': ge, + 'le': le, + 'prefix': prefix, + } + data = {k: v for (k, v) in data.items() if v is not None} + data = json.dumps(data) + headers['content-type'] = 'application/json' + if 'headers' in kwargs: headers.update(kwargs.get('headers')) del kwargs['headers'] headers['Accept'] = 'application/json' - path_param_keys = ['transit_gateway_id', 'id'] - path_param_values = self.encode_path_vars(transit_gateway_id, id) + path_param_keys = ['transit_gateway_id', 'id', 'filter_id'] + path_param_values = self.encode_path_vars(transit_gateway_id, id, filter_id) path_param_dict = dict(zip(path_param_keys, path_param_values)) - url = '/transit_gateways/{transit_gateway_id}/route_reports/{id}'.format(**path_param_dict) + url = '/transit_gateways/{transit_gateway_id}/connections/{id}/prefix_filters/{filter_id}'.format(**path_param_dict) request = self.prepare_request( - method='GET', + method='PATCH', + url=url, + headers=headers, + params=params, + data=data, + ) + + response = self.send(request, **kwargs) + return response + + ######################### + # Transit Gateway Route Reports + ######################### + + def list_transit_gateway_route_reports( + self, + transit_gateway_id: str, + **kwargs, + ) -> DetailedResponse: + """ + List 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 + route reports are written to IBM Cloud Activity Tracker. + + :param str transit_gateway_id: The Transit Gateway 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 `RouteReportCollection` object + """ + + if not transit_gateway_id: + raise ValueError('transit_gateway_id must be provided') + headers = {} + sdk_headers = get_sdk_headers( + service_name=self.DEFAULT_SERVICE_NAME, + service_version='V1', + operation_id='list_transit_gateway_route_reports', + ) + headers.update(sdk_headers) + + params = { + 'version': self.version, + } + + if 'headers' in kwargs: + headers.update(kwargs.get('headers')) + del kwargs['headers'] + headers['Accept'] = 'application/json' + + path_param_keys = ['transit_gateway_id'] + path_param_values = self.encode_path_vars(transit_gateway_id) + path_param_dict = dict(zip(path_param_keys, path_param_values)) + url = '/transit_gateways/{transit_gateway_id}/route_reports'.format(**path_param_dict) + request = self.prepare_request( + method='GET', + url=url, + headers=headers, + params=params, + ) + + response = self.send(request, **kwargs) + return response + + def create_transit_gateway_route_report( + self, + transit_gateway_id: str, + **kwargs, + ) -> DetailedResponse: + """ + Request 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 + pending report. + + :param str transit_gateway_id: The Transit Gateway 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 `RouteReport` object + """ + + if not transit_gateway_id: + raise ValueError('transit_gateway_id must be provided') + headers = {} + sdk_headers = get_sdk_headers( + service_name=self.DEFAULT_SERVICE_NAME, + service_version='V1', + operation_id='create_transit_gateway_route_report', + ) + headers.update(sdk_headers) + + params = { + 'version': self.version, + } + + if 'headers' in kwargs: + headers.update(kwargs.get('headers')) + del kwargs['headers'] + headers['Accept'] = 'application/json' + + path_param_keys = ['transit_gateway_id'] + path_param_values = self.encode_path_vars(transit_gateway_id) + path_param_dict = dict(zip(path_param_keys, path_param_values)) + url = '/transit_gateways/{transit_gateway_id}/route_reports'.format(**path_param_dict) + request = self.prepare_request( + method='POST', + url=url, + headers=headers, + params=params, + ) + + response = self.send(request, **kwargs) + return response + + def delete_transit_gateway_route_report( + self, + transit_gateway_id: str, + id: str, + **kwargs, + ) -> DetailedResponse: + """ + Delete route report. + + Delete a route report. + + :param str transit_gateway_id: The Transit Gateway identifier. + :param str id: Route report identifier. + :param dict headers: A `dict` containing the request headers + :return: A `DetailedResponse` containing the result, headers and HTTP status code. + :rtype: DetailedResponse + """ + + if not transit_gateway_id: + raise ValueError('transit_gateway_id must be provided') + if not id: + raise ValueError('id must be provided') + headers = {} + sdk_headers = get_sdk_headers( + service_name=self.DEFAULT_SERVICE_NAME, + service_version='V1', + operation_id='delete_transit_gateway_route_report', + ) + headers.update(sdk_headers) + + params = { + 'version': self.version, + } + + if 'headers' in kwargs: + headers.update(kwargs.get('headers')) + del kwargs['headers'] + + path_param_keys = ['transit_gateway_id', 'id'] + path_param_values = self.encode_path_vars(transit_gateway_id, id) + path_param_dict = dict(zip(path_param_keys, path_param_values)) + url = '/transit_gateways/{transit_gateway_id}/route_reports/{id}'.format(**path_param_dict) + request = self.prepare_request( + method='DELETE', + url=url, + headers=headers, + params=params, + ) + + response = self.send(request, **kwargs) + return response + + def get_transit_gateway_route_report( + self, + transit_gateway_id: str, + id: str, + **kwargs, + ) -> DetailedResponse: + """ + Retrieve route report. + + Retrieve a route report. + + :param str transit_gateway_id: The Transit Gateway identifier. + :param str id: Route report 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 `RouteReport` object + """ + + if not transit_gateway_id: + raise ValueError('transit_gateway_id must be provided') + if not id: + raise ValueError('id must be provided') + headers = {} + sdk_headers = get_sdk_headers( + service_name=self.DEFAULT_SERVICE_NAME, + service_version='V1', + operation_id='get_transit_gateway_route_report', + ) + headers.update(sdk_headers) + + params = { + 'version': self.version, + } + + if 'headers' in kwargs: + headers.update(kwargs.get('headers')) + del kwargs['headers'] + headers['Accept'] = 'application/json' + + path_param_keys = ['transit_gateway_id', 'id'] + path_param_values = self.encode_path_vars(transit_gateway_id, id) + path_param_dict = dict(zip(path_param_keys, path_param_values)) + url = '/transit_gateways/{transit_gateway_id}/route_reports/{id}'.format(**path_param_dict) + request = self.prepare_request( + method='GET', url=url, headers=headers, params=params, @@ -1686,44 +2040,45 @@ def get_transit_gateway_route_report( ############################################################################## -class PaginationFirstConnection: +class GreTunnelZoneReference: """ - A reference to the first page of resources. + Location of GRE tunnel. This field only applies to network type 'gre_tunnel' + connections. - :attr str href: url. + :attr str name: Availability zone name. """ def __init__( self, - href: str, + name: str, ) -> None: """ - Initialize a PaginationFirstConnection object. + Initialize a GreTunnelZoneReference object. - :param str href: url. + :param str name: Availability zone name. """ - self.href = href + self.name = name @classmethod - def from_dict(cls, _dict: Dict) -> 'PaginationFirstConnection': - """Initialize a PaginationFirstConnection object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'GreTunnelZoneReference': + """Initialize a GreTunnelZoneReference object from a json dictionary.""" args = {} - if 'href' in _dict: - args['href'] = _dict.get('href') + if 'name' in _dict: + args['name'] = _dict.get('name') else: - raise ValueError('Required property \'href\' not present in PaginationFirstConnection JSON') + raise ValueError('Required property \'name\' not present in GreTunnelZoneReference JSON') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a PaginationFirstConnection object from a json dictionary.""" + """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, 'href') and self.href is not None: - _dict['href'] = self.href + if hasattr(self, 'name') and self.name is not None: + _dict['name'] = self.name return _dict def _to_dict(self): @@ -1731,21 +2086,21 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this PaginationFirstConnection object.""" + """Return a `str` version of this GreTunnelZoneReference object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'PaginationFirstConnection') -> bool: + 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: 'PaginationFirstConnection') -> bool: + def __ne__(self, other: 'GreTunnelZoneReference') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other -class PaginationFirstTG: +class PaginationFirstConnection: """ A reference to the first page of resources. @@ -1757,25 +2112,25 @@ def __init__( href: str, ) -> None: """ - Initialize a PaginationFirstTG object. + Initialize a PaginationFirstConnection object. :param str href: url. """ self.href = href @classmethod - def from_dict(cls, _dict: Dict) -> 'PaginationFirstTG': - """Initialize a PaginationFirstTG object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'PaginationFirstConnection': + """Initialize a PaginationFirstConnection object from a json dictionary.""" args = {} if 'href' in _dict: args['href'] = _dict.get('href') else: - raise ValueError('Required property \'href\' not present in PaginationFirstTG JSON') + raise ValueError('Required property \'href\' not present in PaginationFirstConnection JSON') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a PaginationFirstTG object from a json dictionary.""" + """Initialize a PaginationFirstConnection object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: @@ -1790,16 +2145,75 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this PaginationFirstTG object.""" + """Return a `str` version of this PaginationFirstConnection object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'PaginationFirstTG') -> bool: + def __eq__(self, other: 'PaginationFirstConnection') -> 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: 'PaginationFirstTG') -> bool: + def __ne__(self, other: 'PaginationFirstConnection') -> bool: + """Return `true` when self and other are not equal, false otherwise.""" + return not self == other + + +class PaginationFirstTG: + """ + A reference to the first page of resources. + + :attr str href: url. + """ + + def __init__( + self, + href: str, + ) -> None: + """ + Initialize a PaginationFirstTG object. + + :param str href: url. + """ + self.href = href + + @classmethod + def from_dict(cls, _dict: Dict) -> 'PaginationFirstTG': + """Initialize a PaginationFirstTG object from a json dictionary.""" + args = {} + if 'href' in _dict: + args['href'] = _dict.get('href') + else: + raise ValueError('Required property \'href\' not present in PaginationFirstTG JSON') + return cls(**args) + + @classmethod + def _from_dict(cls, _dict): + """Initialize a PaginationFirstTG 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 + 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 PaginationFirstTG object.""" + return json.dumps(self.to_dict(), indent=2) + + def __eq__(self, other: 'PaginationFirstTG') -> 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: 'PaginationFirstTG') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other @@ -2463,45 +2877,52 @@ class ActionEnum(str, Enum): -class ResourceGroupIdentity: +class RedundantGRETunnelCollection: """ - The resource group to use. If unspecified, the account's [default resource - group](https://console.bluemix.net/apidocs/resource-manager#introduction) is used. + Collection of all tunnels for redundant gre connection. - :attr str id: The unique identifier for this resource group. + :attr List[RedundantGRETunnelReference] tunnels: Collection of all tunnels for + redundant gre connection. """ def __init__( self, - id: str, + tunnels: List['RedundantGRETunnelReference'], ) -> None: """ - Initialize a ResourceGroupIdentity object. + Initialize a RedundantGRETunnelCollection object. - :param str id: The unique identifier for this resource group. + :param List[RedundantGRETunnelReference] tunnels: Collection of all tunnels + for redundant gre connection. """ - self.id = id + self.tunnels = tunnels @classmethod - def from_dict(cls, _dict: Dict) -> 'ResourceGroupIdentity': - """Initialize a ResourceGroupIdentity object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'RedundantGRETunnelCollection': + """Initialize a RedundantGRETunnelCollection object from a json dictionary.""" args = {} - if 'id' in _dict: - args['id'] = _dict.get('id') + if 'tunnels' in _dict: + args['tunnels'] = [RedundantGRETunnelReference.from_dict(v) for v in _dict.get('tunnels')] else: - raise ValueError('Required property \'id\' not present in ResourceGroupIdentity JSON') + raise ValueError('Required property \'tunnels\' not present in RedundantGRETunnelCollection JSON') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a ResourceGroupIdentity object from a json dictionary.""" + """Initialize a RedundantGRETunnelCollection 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 + 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): @@ -2509,69 +2930,242 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this ResourceGroupIdentity object.""" + """Return a `str` version of this RedundantGRETunnelCollection object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'ResourceGroupIdentity') -> bool: + def __eq__(self, other: 'RedundantGRETunnelCollection') -> 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: + def __ne__(self, other: 'RedundantGRETunnelCollection') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other -class ResourceGroupReference: +class RedundantGRETunnelReference: """ - The resource group to use. If unspecified, the account's [default resource - group](https://console.bluemix.net/apidocs/resource-manager#introduction) is used. + Details for a redundant GRE tunnel. - :attr str id: The unique identifier for this resource group. - :attr str href: The URL for this resource group. + :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. """ def __init__( self, + base_network_type: str, + created_at: datetime, id: str, - href: 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 ResourceGroupReference object. + Initialize a RedundantGRETunnelReference object. - :param str id: The unique identifier for this resource group. - :param str href: The URL for this resource group. + :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. """ + self.base_network_type = base_network_type + self.created_at = created_at self.id = id - self.href = href + 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) -> 'ResourceGroupReference': - """Initialize a ResourceGroupReference object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'RedundantGRETunnelReference': + """Initialize a RedundantGRETunnelReference 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')) + else: + raise ValueError('Required property \'created_at\' not present in RedundantGRETunnelReference JSON') if 'id' in _dict: args['id'] = _dict.get('id') else: - raise ValueError('Required property \'id\' not present in ResourceGroupReference JSON') - if 'href' in _dict: - args['href'] = _dict.get('href') + 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 \'href\' not present in ResourceGroupReference JSON') + 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') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a ResourceGroupReference object from a json dictionary.""" + """Initialize a RedundantGRETunnelReference 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, 'href') and self.href is not None: - _dict['href'] = self.href + 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): @@ -2579,53 +3173,269 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this ResourceGroupReference object.""" + """Return a `str` version of this RedundantGRETunnelReference object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'ResourceGroupReference') -> bool: + 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: 'ResourceGroupReference') -> bool: + 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. + """ -class RouteReport: + 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: """ - route report. + 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[RouteReportConnection] connections: Array of connections with their - routes. - :attr datetime created_at: Date and time route report was requested. - :attr str id: Report identifier. - :attr List[RouteReportOverlappingRouteGroup] overlapping_routes: Array of - overlapping routes. - :attr str status: Route report status. The list of enumerated values for this - property may expand in the future. Code and processes using this field must - tolerate unexpected values. - :attr datetime updated_at: (optional) Date and time route report was last - modified. + :attr str id: The unique identifier for this resource group. """ def __init__( self, - connections: List['RouteReportConnection'], - created_at: datetime, id: str, - overlapping_routes: List['RouteReportOverlappingRouteGroup'], - status: str, - *, - updated_at: datetime = None, ) -> None: """ - Initialize a RouteReport object. + Initialize a ResourceGroupIdentity object. - :param List[RouteReportConnection] connections: Array of connections with - their routes. - :param datetime created_at: Date and time route report was requested. + :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, '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 ResourceGroupReference object.""" + return json.dumps(self.to_dict(), indent=2) + + def __eq__(self, other: 'ResourceGroupReference') -> 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: 'ResourceGroupReference') -> bool: + """Return `true` when self and other are not equal, false otherwise.""" + 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. + + :attr List[RouteReportConnection] connections: Array of connections with their + routes. + :attr datetime created_at: Date and time route report was requested. + :attr str id: Report identifier. + :attr List[RouteReportOverlappingRouteGroup] overlapping_routes: Array of + overlapping routes. + :attr str status: Route report status. The list of enumerated values for this + property may expand in the future. Code and processes using this field must + tolerate unexpected values. + :attr datetime updated_at: (optional) Date and time route report was last + modified. + """ + + def __init__( + self, + connections: List['RouteReportConnection'], + created_at: datetime, + id: str, + overlapping_routes: List['RouteReportOverlappingRouteGroup'], + status: str, + *, + updated_at: datetime = None, + ) -> None: + """ + Initialize a RouteReport object. + + :param List[RouteReportConnection] connections: Array of connections with + their routes. + :param datetime created_at: Date and time route report was requested. :param str id: Report identifier. :param List[RouteReportOverlappingRouteGroup] overlapping_routes: Array of overlapping routes. @@ -3362,6 +4172,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. """ def __init__( @@ -3370,6 +4181,7 @@ def __init__( name: str, type: str, local_connection_locations: List['TSLocalLocation'], + zones: List['ZoneReferenceCollection'], ) -> None: """ Initialize a TSLocation object. @@ -3381,11 +4193,14 @@ 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. """ self.billing_location = billing_location self.name = name self.type = type self.local_connection_locations = local_connection_locations + self.zones = zones @classmethod def from_dict(cls, _dict: Dict) -> 'TSLocation': @@ -3407,6 +4222,10 @@ def from_dict(cls, _dict: Dict) -> 'TSLocation': args['local_connection_locations'] = [TSLocalLocation.from_dict(v) for v in _dict.get('local_connection_locations')] else: raise ValueError('Required property \'local_connection_locations\' not present in TSLocation JSON') + if 'zones' in _dict: + args['zones'] = [ZoneReferenceCollection.from_dict(v) for v in _dict.get('zones')] + else: + raise ValueError('Required property \'zones\' not present in TSLocation JSON') return cls(**args) @classmethod @@ -3431,6 +4250,14 @@ def to_dict(self) -> Dict: else: local_connection_locations_list.append(v.to_dict()) _dict['local_connection_locations'] = local_connection_locations_list + 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): @@ -3537,161 +4364,181 @@ def __ne__(self, other: 'TSLocationBasic') -> bool: class TransitConnection: """ - Transit gateway connection. - - :attr str base_connection_id: (optional) 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. + 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 + deleted. This field only applies to and is required for network type + 'gre_tunnel' connections. :attr datetime created_at: The date and time that this connection was created. - :attr str id: The unique identifier for this connection. :attr int local_bgp_asn: (optional) Local network BGP ASN. This field only - applies to network type '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' 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' 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' connections. - :attr str name: The user-defined name for this transit gateway connection. + 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. - :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' and 'directlink'. For network types - 'vpc','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 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. - :attr str prefix_filters_default: Default setting of permit or deny which - applies to any routes that don't match a specified filter. + This field does not apply to the 'redundant_gre' network type. + :attr str prefix_filters_default: (optional) Default setting of permit or deny + which applies to any routes that don't match a specified filter. + This field does not apply to the 'redundant_gre' network type. :attr int remote_bgp_asn: (optional) Remote network BGP ASN. This field only - applies to network type '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' 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' connections. - :attr str request_status: (optional) Only visible for cross account connections, - this field represents the status of a connection request between IBM Cloud - accounts. The list of enumerated values for this property may expand in the - future. Code and processes using this field must tolerate unexpected values. - :attr str status: Connection state. The list of enumerated values for this - property may expand in the future. Code and processes using this field must - tolerate unexpected values. - :attr TransitGatewayReference transit_gateway: Reference to the transit gateway - that contains this connection. - :attr datetime updated_at: (optional) The date and time that this connection was - last updated. - :attr ZoneReference zone: (optional) Location of GRE tunnel. This field only - applies to network type '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 + processes using this field must tolerate unexpected values. + :attr str status: Connection's current configuration state. The list of + enumerated values for this property may expand in the future. Code and processes + using this field must tolerate unexpected values. + :attr TransitGatewayReference transit_gateway: Transit gateway reference. + :attr List[TransitGatewayRedundantGRETunnelReference] tunnels: (optional) + Collection of all tunnels for 'redundant_gre' connection. + :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. """ def __init__( self, - created_at: datetime, - id: str, name: str, network_type: str, - prefix_filters_default: str, + id: str, + created_at: datetime, + request_status: str, status: str, transit_gateway: 'TransitGatewayReference', + updated_at: datetime, *, + base_network_type: str = None, + network_id: str = None, base_connection_id: str = None, local_bgp_asn: int = None, local_gateway_ip: str = None, local_tunnel_ip: str = None, mtu: int = None, network_account_id: str = None, - network_id: str = None, prefix_filters: List['TransitGatewayConnectionPrefixFilterReference'] = None, + prefix_filters_default: str = None, remote_bgp_asn: int = None, remote_gateway_ip: str = None, remote_tunnel_ip: str = None, - request_status: str = None, - updated_at: datetime = None, - zone: 'ZoneReference' = None, + tunnels: List['TransitGatewayRedundantGRETunnelReference'] = None, + zone: 'GreTunnelZoneReference' = None, ) -> None: """ Initialize a TransitConnection object. - :param datetime created_at: The date and time that this connection was - created. - :param str id: The unique identifier for this connection. :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 prefix_filters_default: Default setting of permit or deny which - applies to any routes that don't match a specified filter. - :param str status: Connection state. The list of enumerated values for this - property may expand in the future. Code and processes using this field must - tolerate unexpected values. - :param TransitGatewayReference transit_gateway: Reference to the transit - gateway that contains this connection. - :param str base_connection_id: (optional) network_type 'gre_tunnel' - connections use 'base_connection_id' to specify the id of a network_type - 'classic' connection the tunnel is configured over. The specified - connection must reside in the same transit gateway and be in an active - state. The 'classic' connection cannot be deleted until any 'gre_tunnel' - connections using it are deleted. This field only applies to and is - required for network type 'gre_tunnel' connections. - :param int local_bgp_asn: (optional) Local network BGP ASN. This field - only applies to network type 'gre_tunnel' connections. - :param str local_gateway_ip: (optional) Local gateway IP address. This - field only applies to network type 'gre_tunnel' connections. - :param str local_tunnel_ip: (optional) Local tunnel IP address. This field - only applies to network type 'gre_tunnel' connections. - :param int mtu: (optional) GRE tunnel MTU. This field only applies to - network type '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. - :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' and 'directlink'. For network types - 'vpc','power_virtual_server' and 'directlink' this is the CRN of the VPC / - PowerVS / Direct Link gateway respectively. + :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 + field represents the status of a connection request between IBM Cloud + accounts. The list of enumerated values for this property may expand in the + future. Code and processes using this field must tolerate unexpected + values. + :param str status: Connection's current configuration state. The list of + enumerated values for this property may expand in the future. Code and + processes using this field must tolerate unexpected values. + :param TransitGatewayReference transit_gateway: Transit gateway reference. + :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 + specified connection must reside in the same transit gateway and be in an + active state. The 'classic' connection cannot be deleted until any + 'gre_tunnel' connections using it are deleted. This field only applies to + and is required for network type 'gre_tunnel' connections. + :param int local_bgp_asn: (optional) Local network BGP ASN. This field + only applies to network type 'gre_tunnel' and 'unbound_gre_tunnel' + connections. + :param str local_gateway_ip: (optional) Local gateway IP address. This + field 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' + connections. + :param int mtu: (optional) GRE tunnel MTU. This field only applies to + network type 'gre_tunnel' and 'unbound_gre_tunnel' connections. + :param str network_account_id: (optional) The ID of the account which owns + the connected network. Generally only used if the network is in a different + IBM Cloud account than the gateway. :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. + :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. :param int remote_bgp_asn: (optional) Remote network BGP ASN. This field - only applies to network type 'gre_tunnel' connections. + 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' connections. + 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' connections. - :param str request_status: (optional) Only visible for cross account - connections, this field represents the status of a connection request - between IBM Cloud accounts. The list of enumerated values for this property - may expand in the future. Code and processes using this field must tolerate - unexpected values. - :param datetime updated_at: (optional) The date and time that this - connection was last updated. - :param ZoneReference zone: (optional) Location of GRE tunnel. This field - only applies to network type 'gre_tunnel' connections. + 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. """ + 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.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 @@ -3700,6 +4547,7 @@ def __init__( self.request_status = request_status self.status = status self.transit_gateway = transit_gateway + self.tunnels = tunnels self.updated_at = updated_at self.zone = zone @@ -3707,16 +4555,28 @@ def __init__( def from_dict(cls, _dict: Dict) -> 'TransitConnection': """Initialize a TransitConnection object from a json dictionary.""" args = {} + if 'base_network_type' in _dict: + args['base_network_type'] = _dict.get('base_network_type') + if 'name' in _dict: + args['name'] = _dict.get('name') + else: + raise ValueError('Required property \'name\' not present in TransitConnection JSON') + if 'network_id' in _dict: + args['network_id'] = _dict.get('network_id') + if 'network_type' in _dict: + args['network_type'] = _dict.get('network_type') + else: + raise ValueError('Required property \'network_type\' not present in TransitConnection JSON') + if 'id' in _dict: + args['id'] = _dict.get('id') + else: + raise ValueError('Required property \'id\' not present in TransitConnection JSON') if 'base_connection_id' in _dict: args['base_connection_id'] = _dict.get('base_connection_id') if 'created_at' in _dict: args['created_at'] = string_to_datetime(_dict.get('created_at')) else: raise ValueError('Required property \'created_at\' not present in TransitConnection JSON') - if 'id' in _dict: - args['id'] = _dict.get('id') - else: - raise ValueError('Required property \'id\' not present in TransitConnection JSON') if 'local_bgp_asn' in _dict: args['local_bgp_asn'] = _dict.get('local_bgp_asn') if 'local_gateway_ip' in _dict: @@ -3725,24 +4585,12 @@ def from_dict(cls, _dict: Dict) -> 'TransitConnection': 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') - else: - raise ValueError('Required property \'name\' not present in TransitConnection 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 'network_type' in _dict: - args['network_type'] = _dict.get('network_type') - else: - raise ValueError('Required property \'network_type\' not present in TransitConnection JSON') if 'prefix_filters' in _dict: args['prefix_filters'] = [TransitGatewayConnectionPrefixFilterReference.from_dict(v) for v in _dict.get('prefix_filters')] if 'prefix_filters_default' in _dict: args['prefix_filters_default'] = _dict.get('prefix_filters_default') - else: - raise ValueError('Required property \'prefix_filters_default\' not present in TransitConnection JSON') if 'remote_bgp_asn' in _dict: args['remote_bgp_asn'] = _dict.get('remote_bgp_asn') if 'remote_gateway_ip' in _dict: @@ -3751,6 +4599,8 @@ def from_dict(cls, _dict: Dict) -> 'TransitConnection': args['remote_tunnel_ip'] = _dict.get('remote_tunnel_ip') if 'request_status' in _dict: args['request_status'] = _dict.get('request_status') + else: + raise ValueError('Required property \'request_status\' not present in TransitConnection JSON') if 'status' in _dict: args['status'] = _dict.get('status') else: @@ -3759,10 +4609,14 @@ def from_dict(cls, _dict: Dict) -> 'TransitConnection': args['transit_gateway'] = TransitGatewayReference.from_dict(_dict.get('transit_gateway')) 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')] 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'] = ZoneReference.from_dict(_dict.get('zone')) + args['zone'] = GreTunnelZoneReference.from_dict(_dict.get('zone')) return cls(**args) @classmethod @@ -3773,12 +4627,20 @@ 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, '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: @@ -3787,14 +4649,8 @@ 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: @@ -3820,6 +4676,14 @@ def to_dict(self) -> Dict: _dict['transit_gateway'] = self.transit_gateway else: _dict['transit_gateway'] = self.transit_gateway.to_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, '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: @@ -3847,6 +4711,15 @@ def __ne__(self, other: 'TransitConnection') -> 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 GRE tunnel is targeting. + """ + + CLASSIC = 'classic' + VPC = 'vpc' + + class NetworkTypeEnum(str, Enum): """ Defines what type of network is connected via this connection. The list of @@ -3860,12 +4733,14 @@ class NetworkTypeEnum(str, Enum): UNBOUND_GRE_TUNNEL = 'unbound_gre_tunnel' VPC = 'vpc' POWER_VIRTUAL_SERVER = 'power_virtual_server' + REDUNDANT_GRE = 'redundant_gre' 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. """ PERMIT = 'permit' @@ -3889,8 +4764,9 @@ class RequestStatusEnum(str, Enum): class StatusEnum(str, Enum): """ - Connection state. The list of enumerated values for this property may expand in - the future. Code and processes using this field must tolerate unexpected values. + 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. """ ATTACHED = 'attached' @@ -4289,45 +5165,45 @@ class TransitGatewayConnectionCollection: :attr List[TransitGatewayConnectionCust] connections: Array of transit gateways network Connections. - :attr PaginationFirstTGWConnection first: (optional) A reference to the first - page of resources. + :attr PaginationFirstTGWConnection first: A reference to the first page of + resources. This will be returned when number of connections in response are greater than max page limit. - :attr int limit: (optional) The maximum number of connections returned on one - request. This will be returned when number of connections in response are - greater than max page limit. + :attr int limit: The maximum number of connections returned on one request. This + will be returned when number of connections in response are greater than max + page limit. :attr PaginationNextTGWConnection next: (optional) A reference to the next page of resources; this reference is included for all pages except the last page. - :attr int total_count: (optional) total number of resources across all pages - (considering the supplied query parameter filters). + :attr int total_count: total number of resources across all pages (considering + the supplied query parameter filters). """ def __init__( self, connections: List['TransitGatewayConnectionCust'], + first: 'PaginationFirstTGWConnection', + limit: int, + total_count: int, *, - first: 'PaginationFirstTGWConnection' = None, - limit: int = None, next: 'PaginationNextTGWConnection' = None, - total_count: int = None, ) -> None: """ Initialize a TransitGatewayConnectionCollection object. :param List[TransitGatewayConnectionCust] connections: Array of transit gateways network Connections. - :param PaginationFirstTGWConnection first: (optional) A reference to the - first page of resources. + :param PaginationFirstTGWConnection first: A reference to the first page of + resources. This will be returned when number of connections in response are greater than max page limit. - :param int limit: (optional) The maximum number of connections returned on - one request. This will be returned when number of connections in response - are greater than max page limit. + :param int limit: The maximum number of connections returned on one + request. This will be returned when number of connections in response are + greater than max page limit. + :param int total_count: total number of resources across all pages + (considering the supplied query parameter filters). :param PaginationNextTGWConnection next: (optional) A reference to the next page of resources; this reference is included for all pages except the last page. - :param int total_count: (optional) total number of resources across all - pages (considering the supplied query parameter filters). """ self.connections = connections self.first = first @@ -4345,12 +5221,18 @@ def from_dict(cls, _dict: Dict) -> 'TransitGatewayConnectionCollection': raise ValueError('Required property \'connections\' not present in TransitGatewayConnectionCollection JSON') if 'first' in _dict: args['first'] = PaginationFirstTGWConnection.from_dict(_dict.get('first')) + else: + raise ValueError('Required property \'first\' not present in TransitGatewayConnectionCollection JSON') if 'limit' in _dict: args['limit'] = _dict.get('limit') + else: + raise ValueError('Required property \'limit\' not present in TransitGatewayConnectionCollection JSON') if 'next' in _dict: args['next'] = PaginationNextTGWConnection.from_dict(_dict.get('next')) if 'total_count' in _dict: args['total_count'] = _dict.get('total_count') + else: + raise ValueError('Required property \'total_count\' not present in TransitGatewayConnectionCollection JSON') return cls(**args) @classmethod @@ -4413,9 +5295,9 @@ class TransitGatewayConnectionCust: :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' and 'directlink'. For network types - 'vpc','power_virtual_server' and 'directlink' this is the CRN of the VPC / - PowerVS / Direct Link gateway respectively. + '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. @@ -4442,27 +5324,30 @@ class TransitGatewayConnectionCust: :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. - :attr str prefix_filters_default: Default setting of permit or deny which - applies to any routes that don't match a specified filter. + at the end of the array is applied last, or just before the default. This field + does not apply to the 'redundant_gre' network type. + :attr str prefix_filters_default: (optional) Default setting of permit or deny + which applies to any routes that don't match a specified filter. This field does + not apply to the 'redundant_gre' network type. :attr int remote_bgp_asn: (optional) Remote network BGP ASN. This field only 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. :attr str remote_tunnel_ip: (optional) Remote tunnel IP address. This field only applies to network type 'gre_tunnel' and 'unbound_gre_tunnel' connections. - :attr str request_status: (optional) Only visible for cross account connections, - this field represents the status of a connection request between IBM Cloud - accounts. The list of enumerated values for this property may expand in the - future. Code and processes using this field must tolerate unexpected values. - :attr str status: (optional) Connection's current configuration state. The list - of enumerated values for this property may expand in the future. Code and + :attr str request_status: Only visible for cross account connections, this field + represents the status of a connection request between IBM Cloud accounts. The + list of enumerated values for this property may expand in the future. Code and processes using this field must tolerate unexpected values. - :attr datetime updated_at: (optional) The date and time that this connection was - last updated. - :attr TransitGatewayConnectionCustZone zone: (optional) Location of GRE tunnel. - This field only applies to network type 'gre_tunnel' and 'unbound_gre_tunnel' - connections. + :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 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. """ def __init__( @@ -4471,7 +5356,9 @@ def __init__( network_type: str, id: str, created_at: datetime, - prefix_filters_default: str, + request_status: str, + status: str, + updated_at: datetime, *, base_network_type: str = None, network_id: str = None, @@ -4482,13 +5369,12 @@ def __init__( mtu: int = None, network_account_id: str = None, prefix_filters: List['TransitGatewayConnectionPrefixFilterReference'] = None, + prefix_filters_default: str = None, remote_bgp_asn: int = None, remote_gateway_ip: str = None, remote_tunnel_ip: str = None, - request_status: str = None, - status: str = None, - updated_at: datetime = None, - zone: 'TransitGatewayConnectionCustZone' = None, + tunnels: List['TransitGatewayRedundantGRETunnelReference'] = None, + zone: 'GreTunnelZoneReference' = None, ) -> None: """ Initialize a TransitGatewayConnectionCust object. @@ -4501,15 +5387,23 @@ def __init__( :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 prefix_filters_default: Default setting of permit or deny which - applies to any routes that don't match a specified filter. + :param str request_status: Only visible for cross account connections, this + field represents the status of a connection request between IBM Cloud + accounts. The list of enumerated values for this property may expand in the + future. Code and processes using this field must tolerate unexpected + values. + :param str status: Connection's current configuration state. The list of + enumerated values for this property may expand in the future. Code and + processes using this field must tolerate unexpected values. + :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' and 'directlink'. For network types - 'vpc','power_virtual_server' and 'directlink' this is the CRN of the VPC / - PowerVS / Direct Link gateway respectively. + '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 @@ -4535,7 +5429,10 @@ def __init__( (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. + 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. :param int remote_bgp_asn: (optional) Remote network BGP ASN. This field only applies to network type 'gre_tunnel' and 'unbound_gre_tunnel' connections. @@ -4545,19 +5442,10 @@ def __init__( :param str remote_tunnel_ip: (optional) Remote tunnel IP address. This field only applies to network type 'gre_tunnel' and 'unbound_gre_tunnel' connections. - :param str request_status: (optional) Only visible for cross account - connections, this field represents the status of a connection request - between IBM Cloud accounts. The list of enumerated values for this property - may expand in the future. Code and processes using this field must tolerate - unexpected values. - :param str status: (optional) Connection's current configuration state. The - list of enumerated values for this property may expand in the future. Code - and processes using this field must tolerate unexpected values. - :param datetime updated_at: (optional) The date and time that this - connection was last updated. - :param TransitGatewayConnectionCustZone zone: (optional) Location of GRE - tunnel. This 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. """ self.base_network_type = base_network_type self.name = name @@ -4578,6 +5466,7 @@ def __init__( self.remote_tunnel_ip = remote_tunnel_ip self.request_status = request_status self.status = status + self.tunnels = tunnels self.updated_at = updated_at self.zone = zone @@ -4621,8 +5510,6 @@ def from_dict(cls, _dict: Dict) -> 'TransitGatewayConnectionCust': args['prefix_filters'] = [TransitGatewayConnectionPrefixFilterReference.from_dict(v) for v in _dict.get('prefix_filters')] if 'prefix_filters_default' in _dict: args['prefix_filters_default'] = _dict.get('prefix_filters_default') - else: - raise ValueError('Required property \'prefix_filters_default\' not present in TransitGatewayConnectionCust JSON') if 'remote_bgp_asn' in _dict: args['remote_bgp_asn'] = _dict.get('remote_bgp_asn') if 'remote_gateway_ip' in _dict: @@ -4631,12 +5518,20 @@ def from_dict(cls, _dict: Dict) -> 'TransitGatewayConnectionCust': args['remote_tunnel_ip'] = _dict.get('remote_tunnel_ip') if 'request_status' in _dict: args['request_status'] = _dict.get('request_status') + else: + raise ValueError('Required property \'request_status\' not present in TransitGatewayConnectionCust JSON') if 'status' in _dict: args['status'] = _dict.get('status') + 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')] 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'] = TransitGatewayConnectionCustZone.from_dict(_dict.get('zone')) + args['zone'] = GreTunnelZoneReference.from_dict(_dict.get('zone')) return cls(**args) @classmethod @@ -4691,6 +5586,14 @@ def to_dict(self) -> Dict: _dict['request_status'] = self.request_status if hasattr(self, 'status') and self.status is not None: _dict['status'] = self.status + 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, '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: @@ -4724,6 +5627,7 @@ class BaseNetworkTypeEnum(str, Enum): """ CLASSIC = 'classic' + VPC = 'vpc' class NetworkTypeEnum(str, Enum): @@ -4739,12 +5643,13 @@ class NetworkTypeEnum(str, Enum): UNBOUND_GRE_TUNNEL = 'unbound_gre_tunnel' VPC = 'vpc' POWER_VIRTUAL_SERVER = 'power_virtual_server' + REDUNDANT_GRE = 'redundant_gre' class PrefixFiltersDefaultEnum(str, Enum): """ Default setting of permit or deny which applies to any routes that don't match a - specified filter. + specified filter. This field does not apply to the 'redundant_gre' network type. """ PERMIT = 'permit' @@ -4785,45 +5690,71 @@ class StatusEnum(str, Enum): -class TransitGatewayConnectionCustZone: +class TransitGatewayConnectionPrefixFilter: """ - Location of GRE tunnel. This field only applies to network type 'gre_tunnel' and - 'unbound_gre_tunnel' connections. + A prefix filter for a Transit Gateway connection. - :attr str name: Availability zone name. + :attr str action: Whether to permit or deny prefix filter. + :attr int ge: (optional) IP Prefix GE. + :attr int le: (optional) IP Prefix LE. + :attr str prefix: IP Prefix. """ def __init__( self, - name: str, + action: str, + prefix: str, + *, + ge: int = None, + le: int = None, ) -> None: """ - Initialize a TransitGatewayConnectionCustZone object. + Initialize a TransitGatewayConnectionPrefixFilter object. - :param str name: Availability zone name. + :param str action: Whether to permit or deny prefix filter. + :param str prefix: IP Prefix. + :param int ge: (optional) IP Prefix GE. + :param int le: (optional) IP Prefix LE. """ - self.name = name + self.action = action + self.ge = ge + self.le = le + self.prefix = prefix @classmethod - def from_dict(cls, _dict: Dict) -> 'TransitGatewayConnectionCustZone': - """Initialize a TransitGatewayConnectionCustZone object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'TransitGatewayConnectionPrefixFilter': + """Initialize a TransitGatewayConnectionPrefixFilter object from a json dictionary.""" args = {} - if 'name' in _dict: - args['name'] = _dict.get('name') + if 'action' in _dict: + args['action'] = _dict.get('action') + else: + raise ValueError('Required property \'action\' not present in TransitGatewayConnectionPrefixFilter JSON') + if 'ge' in _dict: + args['ge'] = _dict.get('ge') + if 'le' in _dict: + args['le'] = _dict.get('le') + if 'prefix' in _dict: + args['prefix'] = _dict.get('prefix') else: - raise ValueError('Required property \'name\' not present in TransitGatewayConnectionCustZone JSON') + raise ValueError('Required property \'prefix\' not present in TransitGatewayConnectionPrefixFilter JSON') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a TransitGatewayConnectionCustZone object from a json dictionary.""" + """Initialize a TransitGatewayConnectionPrefixFilter 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 + if hasattr(self, 'action') and self.action is not None: + _dict['action'] = self.action + if hasattr(self, 'ge') and self.ge is not None: + _dict['ge'] = self.ge + if hasattr(self, 'le') and self.le is not None: + _dict['le'] = self.le + if hasattr(self, 'prefix') and self.prefix is not None: + _dict['prefix'] = self.prefix return _dict def _to_dict(self): @@ -4831,72 +5762,147 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this TransitGatewayConnectionCustZone object.""" + """Return a `str` version of this TransitGatewayConnectionPrefixFilter object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'TransitGatewayConnectionCustZone') -> bool: + def __eq__(self, other: 'TransitGatewayConnectionPrefixFilter') -> 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: 'TransitGatewayConnectionCustZone') -> bool: + def __ne__(self, other: 'TransitGatewayConnectionPrefixFilter') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other + class ActionEnum(str, Enum): + """ + Whether to permit or deny prefix filter. + """ + + PERMIT = 'permit' + DENY = 'deny' + -class TransitGatewayConnectionPrefixFilter: + +class TransitGatewayConnectionPrefixFilterReference: """ - A prefix filter for a Transit Gateway connection. + A prefix filter reference object for a Transit Gateway connection. :attr str action: Whether to permit or deny prefix filter. + :attr str before: (optional) Identifier of prefix filter that handles the + ordering and follow semantics: + - When a filter reference another filter in it's before field, then the filter + making the reference is applied before + the referenced filter. For example: if filter A references filter B in its + before field, A is applied before B. + - When a new filter is added that has the same before as an existing filter, + then the older filter will have its before + field updated to point to the new filter. Starting with the above example: if + filter C is added and it references B in its + before field, then A's before field should be modified to point to C, so the + order of application would be A, C and finally B. + - A filter that has an empty before reference will be applied last (though the + date order mentioned above will still apply). + So continuing the above examples, if filter B has an empty before field, then + it will be applied last, but if filter D + is created with an empty before field, then B's before field will be modified + to point to D, so B will be applied before D. + :attr datetime created_at: The date and time that this prefix filter was + created. :attr int ge: (optional) IP Prefix GE. + :attr str id: Prefix Filter identifier. :attr int le: (optional) IP Prefix LE. :attr str prefix: IP Prefix. + :attr datetime updated_at: (optional) The date and time that this prefix filter + was last updated. """ def __init__( self, action: str, + created_at: datetime, + id: str, prefix: str, *, + before: str = None, ge: int = None, le: int = None, + updated_at: datetime = None, ) -> None: """ - Initialize a TransitGatewayConnectionPrefixFilter object. + Initialize a TransitGatewayConnectionPrefixFilterReference object. :param str action: Whether to permit or deny prefix filter. + :param datetime created_at: The date and time that this prefix filter was + created. + :param str id: Prefix Filter identifier. :param str prefix: IP Prefix. + :param str before: (optional) Identifier of prefix filter that handles the + ordering and follow semantics: + - When a filter reference another filter in it's before field, then the + filter making the reference is applied before + the referenced filter. For example: if filter A references filter B in + its before field, A is applied before B. + - When a new filter is added that has the same before as an existing + filter, then the older filter will have its before + field updated to point to the new filter. Starting with the above + example: if filter C is added and it references B in its + before field, then A's before field should be modified to point to C, so + the order of application would be A, C and finally B. + - A filter that has an empty before reference will be applied last (though + the date order mentioned above will still apply). + So continuing the above examples, if filter B has an empty before field, + then it will be applied last, but if filter D + is created with an empty before field, then B's before field will be + modified to point to D, so B will be applied before D. :param int ge: (optional) IP Prefix GE. :param int le: (optional) IP Prefix LE. + :param datetime updated_at: (optional) The date and time that this prefix + filter was last updated. """ self.action = action + self.before = before + self.created_at = created_at self.ge = ge + self.id = id self.le = le self.prefix = prefix + self.updated_at = updated_at @classmethod - def from_dict(cls, _dict: Dict) -> 'TransitGatewayConnectionPrefixFilter': - """Initialize a TransitGatewayConnectionPrefixFilter object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'TransitGatewayConnectionPrefixFilterReference': + """Initialize a TransitGatewayConnectionPrefixFilterReference object from a json dictionary.""" args = {} if 'action' in _dict: args['action'] = _dict.get('action') else: - raise ValueError('Required property \'action\' not present in TransitGatewayConnectionPrefixFilter JSON') + raise ValueError('Required property \'action\' not present in TransitGatewayConnectionPrefixFilterReference JSON') + if 'before' in _dict: + args['before'] = _dict.get('before') + if 'created_at' in _dict: + args['created_at'] = string_to_datetime(_dict.get('created_at')) + else: + raise ValueError('Required property \'created_at\' not present in TransitGatewayConnectionPrefixFilterReference JSON') if 'ge' in _dict: args['ge'] = _dict.get('ge') + if 'id' in _dict: + args['id'] = _dict.get('id') + else: + raise ValueError('Required property \'id\' not present in TransitGatewayConnectionPrefixFilterReference JSON') if 'le' in _dict: args['le'] = _dict.get('le') if 'prefix' in _dict: args['prefix'] = _dict.get('prefix') else: - raise ValueError('Required property \'prefix\' not present in TransitGatewayConnectionPrefixFilter JSON') + raise ValueError('Required property \'prefix\' not present in TransitGatewayConnectionPrefixFilterReference JSON') + if 'updated_at' in _dict: + args['updated_at'] = string_to_datetime(_dict.get('updated_at')) return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a TransitGatewayConnectionPrefixFilter object from a json dictionary.""" + """Initialize a TransitGatewayConnectionPrefixFilterReference object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: @@ -4904,12 +5910,237 @@ def to_dict(self) -> Dict: _dict = {} if hasattr(self, 'action') and self.action is not None: _dict['action'] = self.action + if hasattr(self, 'before') and self.before is not None: + _dict['before'] = self.before + if hasattr(self, 'created_at') and self.created_at is not None: + _dict['created_at'] = datetime_to_string(self.created_at) if hasattr(self, 'ge') and self.ge is not None: _dict['ge'] = self.ge + if hasattr(self, 'id') and self.id is not None: + _dict['id'] = self.id if hasattr(self, 'le') and self.le is not None: _dict['le'] = self.le if hasattr(self, 'prefix') and self.prefix is not None: _dict['prefix'] = self.prefix + if hasattr(self, 'updated_at') and self.updated_at is not None: + _dict['updated_at'] = datetime_to_string(self.updated_at) + return _dict + + def _to_dict(self): + """Return a json dictionary representing this model.""" + return self.to_dict() + + def __str__(self) -> str: + """Return a `str` version of this TransitGatewayConnectionPrefixFilterReference object.""" + return json.dumps(self.to_dict(), indent=2) + + def __eq__(self, other: 'TransitGatewayConnectionPrefixFilterReference') -> 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: 'TransitGatewayConnectionPrefixFilterReference') -> bool: + """Return `true` when self and other are not equal, false otherwise.""" + return not self == other + + class ActionEnum(str, Enum): + """ + Whether to permit or deny prefix filter. + """ + + PERMIT = 'permit' + DENY = 'deny' + + + +class TransitGatewayRedundantGRETunnelReference: + """ + Details for a redundant GRE tunnel. + + :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 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. + """ + + def __init__( + self, + created_at: datetime, + 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', + ) -> None: + """ + Initialize a TransitGatewayRedundantGRETunnelReference object. + + :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. + """ + 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.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) -> 'TransitGatewayRedundantGRETunnelReference': + """Initialize a TransitGatewayRedundantGRETunnelReference object from a json dictionary.""" + args = {} + if 'created_at' in _dict: + args['created_at'] = string_to_datetime(_dict.get('created_at')) + else: + raise ValueError('Required property \'created_at\' not present in TransitGatewayRedundantGRETunnelReference JSON') + if 'id' in _dict: + args['id'] = _dict.get('id') + else: + raise ValueError('Required property \'id\' not present in TransitGatewayRedundantGRETunnelReference 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') + 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') + 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') + if 'mtu' in _dict: + args['mtu'] = _dict.get('mtu') + else: + raise ValueError('Required property \'mtu\' not present in TransitGatewayRedundantGRETunnelReference JSON') + if 'name' in _dict: + args['name'] = _dict.get('name') + else: + raise ValueError('Required property \'name\' not present in TransitGatewayRedundantGRETunnelReference JSON') + 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') + 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') + 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') + if 'status' in _dict: + args['status'] = _dict.get('status') + else: + raise ValueError('Required property \'status\' not present in TransitGatewayRedundantGRETunnelReference 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') + if 'zone' in _dict: + args['zone'] = RgreTunnelZoneReference.from_dict(_dict.get('zone')) + else: + raise ValueError('Required property \'zone\' not present in TransitGatewayRedundantGRETunnelReference JSON') + return cls(**args) + + @classmethod + def _from_dict(cls, _dict): + """Initialize a TransitGatewayRedundantGRETunnelReference object from a json dictionary.""" + return cls.from_dict(_dict) + + def to_dict(self) -> Dict: + """Return a json dictionary representing this model.""" + _dict = {} + if hasattr(self, 'created_at') and self.created_at is not None: + _dict['created_at'] = datetime_to_string(self.created_at) + if hasattr(self, 'id') and self.id is not None: + _dict['id'] = self.id + if hasattr(self, '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, '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): @@ -4917,168 +6148,155 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this TransitGatewayConnectionPrefixFilter object.""" + """Return a `str` version of this TransitGatewayRedundantGRETunnelReference object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'TransitGatewayConnectionPrefixFilter') -> bool: + def __eq__(self, other: 'TransitGatewayRedundantGRETunnelReference') -> 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: 'TransitGatewayConnectionPrefixFilter') -> bool: + def __ne__(self, other: 'TransitGatewayRedundantGRETunnelReference') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other - class ActionEnum(str, Enum): + class StatusEnum(str, Enum): """ - Whether to permit or deny prefix filter. + 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. """ - PERMIT = 'permit' - DENY = 'deny' + ATTACHED = 'attached' + FAILED = 'failed' + PENDING = 'pending' + DELETING = 'deleting' + DETACHING = 'detaching' + DETACHED = 'detached' + SUSPENDING = 'suspending' + SUSPENDED = 'suspended' -class TransitGatewayConnectionPrefixFilterReference: +class TransitGatewayRedundantGRETunnelTemplate: """ - A prefix filter reference object for a Transit Gateway connection. - - :attr str action: Whether to permit or deny prefix filter. - :attr str before: (optional) Identifier of prefix filter that handles the - ordering and follow semantics: - - When a filter reference another filter in it's before field, then the filter - making the reference is applied before - the referenced filter. For example: if filter A references filter B in its - before field, A is applied before B. - - When a new filter is added that has the same before as an existing filter, - then the older filter will have its before - field updated to point to the new filter. Starting with the above example: if - filter C is added and it references B in its - before field, then A's before field should be modified to point to C, so the - order of application would be A, C and finally B. - - A filter that has an empty before reference will be applied last (though the - date order mentioned above will still apply). - So continuing the above examples, if filter B has an empty before field, then - it will be applied last, but if filter D - is created with an empty before field, then B's before field will be modified - to point to D, so B will be applied before D. - :attr datetime created_at: The date and time that this prefix filter was - created. - :attr int ge: (optional) IP Prefix GE. - :attr str id: Prefix Filter identifier. - :attr int le: (optional) IP Prefix LE. - :attr str prefix: IP Prefix. - :attr datetime updated_at: (optional) The date and time that this prefix filter - was last updated. + A create template with information for redundant GRE tunnel. + + :attr str local_gateway_ip: Local gateway IP address. + :attr str local_tunnel_ip: Local tunnel IP address. The local_tunnel_ip and + remote_tunnel_ip addresses must be in the same /30 network. Neither can be the + network nor broadcast addresses. + :attr str name: The user-defined name for this tunnel connection. + :attr int remote_bgp_asn: (optional) Remote network BGP ASN. The following ASN + 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 ZoneIdentity zone: Specify the connection's location. The specified + availability zone must reside in the gateway's region. + Use the IBM Cloud global catalog to list zones within the desired region. """ def __init__( self, - action: str, - created_at: datetime, - id: str, - prefix: str, + local_gateway_ip: str, + local_tunnel_ip: str, + name: str, + remote_gateway_ip: str, + remote_tunnel_ip: str, + zone: 'ZoneIdentity', *, - before: str = None, - ge: int = None, - le: int = None, - updated_at: datetime = None, + remote_bgp_asn: int = None, ) -> None: """ - Initialize a TransitGatewayConnectionPrefixFilterReference object. - - :param str action: Whether to permit or deny prefix filter. - :param datetime created_at: The date and time that this prefix filter was - created. - :param str id: Prefix Filter identifier. - :param str prefix: IP Prefix. - :param str before: (optional) Identifier of prefix filter that handles the - ordering and follow semantics: - - When a filter reference another filter in it's before field, then the - filter making the reference is applied before - the referenced filter. For example: if filter A references filter B in - its before field, A is applied before B. - - When a new filter is added that has the same before as an existing - filter, then the older filter will have its before - field updated to point to the new filter. Starting with the above - example: if filter C is added and it references B in its - before field, then A's before field should be modified to point to C, so - the order of application would be A, C and finally B. - - A filter that has an empty before reference will be applied last (though - the date order mentioned above will still apply). - So continuing the above examples, if filter B has an empty before field, - then it will be applied last, but if filter D - is created with an empty before field, then B's before field will be - modified to point to D, so B will be applied before D. - :param int ge: (optional) IP Prefix GE. - :param int le: (optional) IP Prefix LE. - :param datetime updated_at: (optional) The date and time that this prefix - filter was last updated. + Initialize a TransitGatewayRedundantGRETunnelTemplate object. + + :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 str name: The user-defined name for this tunnel connection. + :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 ZoneIdentity zone: Specify the connection's location. The specified + availability zone must reside in the gateway's region. + Use the IBM Cloud global catalog to list zones within the desired region. + :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. """ - self.action = action - self.before = before - self.created_at = created_at - self.ge = ge - self.id = id - self.le = le - self.prefix = prefix - self.updated_at = updated_at + self.local_gateway_ip = local_gateway_ip + self.local_tunnel_ip = local_tunnel_ip + self.name = name + self.remote_bgp_asn = remote_bgp_asn + self.remote_gateway_ip = remote_gateway_ip + self.remote_tunnel_ip = remote_tunnel_ip + self.zone = zone @classmethod - def from_dict(cls, _dict: Dict) -> 'TransitGatewayConnectionPrefixFilterReference': - """Initialize a TransitGatewayConnectionPrefixFilterReference object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'TransitGatewayRedundantGRETunnelTemplate': + """Initialize a TransitGatewayRedundantGRETunnelTemplate object from a json dictionary.""" args = {} - if 'action' in _dict: - args['action'] = _dict.get('action') + if 'local_gateway_ip' in _dict: + args['local_gateway_ip'] = _dict.get('local_gateway_ip') else: - raise ValueError('Required property \'action\' not present in TransitGatewayConnectionPrefixFilterReference JSON') - if 'before' in _dict: - args['before'] = _dict.get('before') - if 'created_at' in _dict: - args['created_at'] = string_to_datetime(_dict.get('created_at')) + raise ValueError('Required property \'local_gateway_ip\' not present in TransitGatewayRedundantGRETunnelTemplate JSON') + if 'local_tunnel_ip' in _dict: + args['local_tunnel_ip'] = _dict.get('local_tunnel_ip') else: - raise ValueError('Required property \'created_at\' not present in TransitGatewayConnectionPrefixFilterReference JSON') - if 'ge' in _dict: - args['ge'] = _dict.get('ge') - if 'id' in _dict: - args['id'] = _dict.get('id') + raise ValueError('Required property \'local_tunnel_ip\' not present in TransitGatewayRedundantGRETunnelTemplate JSON') + if 'name' in _dict: + args['name'] = _dict.get('name') else: - raise ValueError('Required property \'id\' not present in TransitGatewayConnectionPrefixFilterReference JSON') - if 'le' in _dict: - args['le'] = _dict.get('le') - if 'prefix' in _dict: - args['prefix'] = _dict.get('prefix') + raise ValueError('Required property \'name\' not present in TransitGatewayRedundantGRETunnelTemplate 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 \'prefix\' not present in TransitGatewayConnectionPrefixFilterReference JSON') - if 'updated_at' in _dict: - args['updated_at'] = string_to_datetime(_dict.get('updated_at')) + raise ValueError('Required property \'remote_gateway_ip\' not present in TransitGatewayRedundantGRETunnelTemplate 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') + if 'zone' in _dict: + args['zone'] = _dict.get('zone') + else: + raise ValueError('Required property \'zone\' not present in TransitGatewayRedundantGRETunnelTemplate JSON') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a TransitGatewayConnectionPrefixFilterReference object from a json dictionary.""" + """Initialize a TransitGatewayRedundantGRETunnelTemplate 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, 'action') and self.action is not None: - _dict['action'] = self.action - if hasattr(self, 'before') and self.before is not None: - _dict['before'] = self.before - if hasattr(self, 'created_at') and self.created_at is not None: - _dict['created_at'] = datetime_to_string(self.created_at) - if hasattr(self, 'ge') and self.ge is not None: - _dict['ge'] = self.ge - if hasattr(self, 'id') and self.id is not None: - _dict['id'] = self.id - if hasattr(self, 'le') and self.le is not None: - _dict['le'] = self.le - if hasattr(self, 'prefix') and self.prefix is not None: - _dict['prefix'] = self.prefix - if hasattr(self, 'updated_at') and self.updated_at is not None: - _dict['updated_at'] = datetime_to_string(self.updated_at) + 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, 'name') and self.name is not None: + _dict['name'] = self.name + 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, '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): @@ -5086,28 +6304,19 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this TransitGatewayConnectionPrefixFilterReference object.""" + """Return a `str` version of this TransitGatewayRedundantGRETunnelTemplate object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'TransitGatewayConnectionPrefixFilterReference') -> bool: + 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: 'TransitGatewayConnectionPrefixFilterReference') -> bool: + def __ne__(self, other: 'TransitGatewayRedundantGRETunnelTemplate') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other - class ActionEnum(str, Enum): - """ - Whether to permit or deny prefix filter. - """ - - PERMIT = 'permit' - DENY = 'deny' - - class TransitGatewayReference: """ @@ -5266,6 +6475,71 @@ 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. diff --git a/test/unit/test_transit_gateway_apis_v1.py b/test/unit/test_transit_gateway_apis_v1.py index 8f5b6a8..0fe4446 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. 2023. +# (C) Copyright IBM Corp. 2024. # # 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": {"id": "56969d6043e9465c883cb9f7363e78e8", "href": "https://resource-manager.bluemix.net/v1/resource_groups/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": [{"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"}]}' 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": {"id": "56969d6043e9465c883cb9f7363e78e8", "href": "https://resource-manager.bluemix.net/v1/resource_groups/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": [{"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"}]}' 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": {"id": "56969d6043e9465c883cb9f7363e78e8", "href": "https://resource-manager.bluemix.net/v1/resource_groups/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": [{"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"}]}' 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":{"id":"56969d6043e9465c883cb9f7363e78e8","href":"https://resource-manager.bluemix.net/v1/resource_groups/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":{"id":"56969d6043e9465c883cb9f7363e78e8","href":"https://resource-manager.bluemix.net/v1/resource_groups/56969d6043e9465c883cb9f7363e78e8"},"status":"available","updated_at":"2019-01-01T12:00:00.000Z"}],"total_count":2,"limit":1}' + 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}' 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":{"id":"56969d6043e9465c883cb9f7363e78e8","href":"https://resource-manager.bluemix.net/v1/resource_groups/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":{"id":"56969d6043e9465c883cb9f7363e78e8","href":"https://resource-manager.bluemix.net/v1/resource_groups/56969d6043e9465c883cb9f7363e78e8"},"status":"available","updated_at":"2019-01-01T12:00:00.000Z"}],"total_count":2,"limit":1}' + 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}' 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": {"id": "56969d6043e9465c883cb9f7363e78e8", "href": "https://resource-manager.bluemix.net/v1/resource_groups/56969d6043e9465c883cb9f7363e78e8"}, "status": "available", "updated_at": "2019-01-01T12:00:00.000Z"}' + 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"}' responses.add( responses.POST, url, @@ -370,7 +370,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": {"id": "56969d6043e9465c883cb9f7363e78e8", "href": "https://resource-manager.bluemix.net/v1/resource_groups/56969d6043e9465c883cb9f7363e78e8"}, "status": "available", "updated_at": "2019-01-01T12:00:00.000Z"}' + 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"}' responses.add( responses.POST, url, @@ -496,7 +496,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": {"id": "56969d6043e9465c883cb9f7363e78e8", "href": "https://resource-manager.bluemix.net/v1/resource_groups/56969d6043e9465c883cb9f7363e78e8"}, "status": "available", "updated_at": "2019-01-01T12:00:00.000Z"}' + 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"}' responses.add( responses.GET, url, @@ -534,7 +534,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": {"id": "56969d6043e9465c883cb9f7363e78e8", "href": "https://resource-manager.bluemix.net/v1/resource_groups/56969d6043e9465c883cb9f7363e78e8"}, "status": "available", "updated_at": "2019-01-01T12:00:00.000Z"}' + 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"}' responses.add( responses.GET, url, @@ -577,7 +577,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": {"id": "56969d6043e9465c883cb9f7363e78e8", "href": "https://resource-manager.bluemix.net/v1/resource_groups/56969d6043e9465c883cb9f7363e78e8"}, "status": "available", "updated_at": "2019-01-01T12:00:00.000Z"}' + 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"}' responses.add( responses.PATCH, url, @@ -623,7 +623,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": {"id": "56969d6043e9465c883cb9f7363e78e8", "href": "https://resource-manager.bluemix.net/v1/resource_groups/56969d6043e9465c883cb9f7363e78e8"}, "status": "available", "updated_at": "2019-01-01T12:00:00.000Z"}' + 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"}' responses.add( responses.PATCH, url, @@ -725,7 +725,7 @@ def test_list_connections_all_params(self): """ # Set up mock url = preprocess_url('/connections') - mock_response = '{"connections": [{"base_connection_id": "975f58c1-afe7-469a-9727-7f3d720f2d32", "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_SJ_DL", "network_account_id": "28e4d90ac7504be694471ee66e70d0d5", "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", "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"}, "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": [{"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"}}' responses.add( responses.GET, url, @@ -773,7 +773,7 @@ def test_list_connections_required_params(self): """ # Set up mock url = preprocess_url('/connections') - mock_response = '{"connections": [{"base_connection_id": "975f58c1-afe7-469a-9727-7f3d720f2d32", "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_SJ_DL", "network_account_id": "28e4d90ac7504be694471ee66e70d0d5", "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", "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"}, "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": [{"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"}}' responses.add( responses.GET, url, @@ -805,7 +805,7 @@ def test_list_connections_value_error(self): """ # Set up mock url = preprocess_url('/connections') - mock_response = '{"connections": [{"base_connection_id": "975f58c1-afe7-469a-9727-7f3d720f2d32", "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_SJ_DL", "network_account_id": "28e4d90ac7504be694471ee66e70d0d5", "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", "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"}, "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": [{"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"}}' responses.add( responses.GET, url, @@ -838,8 +838,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_connection_id":"975f58c1-afe7-469a-9727-7f3d720f2d32","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_SJ_DL","network_account_id":"28e4d90ac7504be694471ee66e70d0d5","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","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"},"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","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_SJ_DL","network_account_id":"28e4d90ac7504be694471ee66e70d0d5","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","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"},"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":[{"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"}}]}' responses.add( responses.GET, url, @@ -875,8 +875,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_connection_id":"975f58c1-afe7-469a-9727-7f3d720f2d32","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_SJ_DL","network_account_id":"28e4d90ac7504be694471ee66e70d0d5","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","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"},"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","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_SJ_DL","network_account_id":"28e4d90ac7504be694471ee66e70d0d5","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","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"},"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":[{"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"}}]}' responses.add( responses.GET, url, @@ -972,7 +972,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": "28e4d90ac7504be694471ee66e70d0d5", "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", "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_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}' responses.add( responses.GET, url, @@ -1022,7 +1022,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": "28e4d90ac7504be694471ee66e70d0d5", "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", "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_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}' responses.add( responses.GET, url, @@ -1060,7 +1060,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": "28e4d90ac7504be694471ee66e70d0d5", "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", "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_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}' responses.add( responses.GET, url, @@ -1097,8 +1097,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":"28e4d90ac7504be694471ee66e70d0d5","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","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":"28e4d90ac7504be694471ee66e70d0d5","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","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","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"}}]}' responses.add( responses.GET, url, @@ -1135,8 +1135,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":"28e4d90ac7504be694471ee66e70d0d5","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","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":"28e4d90ac7504be694471ee66e70d0d5","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","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","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"}}]}' responses.add( responses.GET, url, @@ -1176,7 +1176,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": "28e4d90ac7504be694471ee66e70d0d5", "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", "updated_at": "2019-01-01T12:00:00.000Z", "zone": {"name": "us-south-1"}}' + 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"}}' responses.add( responses.POST, url, @@ -1196,6 +1196,16 @@ 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 + # Set up parameter values transit_gateway_id = 'testString' network_type = 'vpc' @@ -1204,13 +1214,14 @@ def test_create_transit_gateway_connection_all_params(self): local_gateway_ip = '192.168.100.1' local_tunnel_ip = '192.168.129.2' name = 'Transit_Service_BWTN_SJ_DL' - network_account_id = '28e4d90ac7504be694471ee66e70d0d5' + network_account_id = 'testString' network_id = 'crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b' prefix_filters = [transit_gateway_connection_prefix_filter_model] prefix_filters_default = 'permit' 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] zone = zone_identity_model # Invoke method @@ -1229,6 +1240,7 @@ def test_create_transit_gateway_connection_all_params(self): remote_bgp_asn=remote_bgp_asn, remote_gateway_ip=remote_gateway_ip, remote_tunnel_ip=remote_tunnel_ip, + tunnels=tunnels, zone=zone, headers={}, ) @@ -1244,13 +1256,14 @@ def test_create_transit_gateway_connection_all_params(self): 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' - assert req_body['network_account_id'] == '28e4d90ac7504be694471ee66e70d0d5' + assert req_body['network_account_id'] == 'testString' assert req_body['network_id'] == 'crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b' assert req_body['prefix_filters'] == [transit_gateway_connection_prefix_filter_model] assert req_body['prefix_filters_default'] == 'permit' 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['zone'] == zone_identity_model def test_create_transit_gateway_connection_all_params_with_retries(self): @@ -1269,7 +1282,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": "28e4d90ac7504be694471ee66e70d0d5", "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", "updated_at": "2019-01-01T12:00:00.000Z", "zone": {"name": "us-south-1"}}' + 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"}}' responses.add( responses.POST, url, @@ -1289,6 +1302,16 @@ 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 + # Set up parameter values transit_gateway_id = 'testString' network_type = 'vpc' @@ -1297,13 +1320,14 @@ def test_create_transit_gateway_connection_value_error(self): local_gateway_ip = '192.168.100.1' local_tunnel_ip = '192.168.129.2' name = 'Transit_Service_BWTN_SJ_DL' - network_account_id = '28e4d90ac7504be694471ee66e70d0d5' + network_account_id = 'testString' network_id = 'crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b' prefix_filters = [transit_gateway_connection_prefix_filter_model] prefix_filters_default = 'permit' 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] zone = zone_identity_model # Pass in all but one required param and check for a ValueError @@ -1417,7 +1441,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": "28e4d90ac7504be694471ee66e70d0d5", "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", "updated_at": "2019-01-01T12:00:00.000Z", "zone": {"name": "us-south-1"}}' + 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"}}' responses.add( responses.GET, url, @@ -1457,7 +1481,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": "28e4d90ac7504be694471ee66e70d0d5", "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", "updated_at": "2019-01-01T12:00:00.000Z", "zone": {"name": "us-south-1"}}' + 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"}}' responses.add( responses.GET, url, @@ -1502,7 +1526,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": "28e4d90ac7504be694471ee66e70d0d5", "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", "updated_at": "2019-01-01T12:00:00.000Z", "zone": {"name": "us-south-1"}}' + 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"}}' responses.add( responses.PATCH, url, @@ -1550,7 +1574,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": "28e4d90ac7504be694471ee66e70d0d5", "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", "updated_at": "2019-01-01T12:00:00.000Z", "zone": {"name": "us-south-1"}}' + 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"}}' responses.add( responses.PATCH, url, @@ -1671,6 +1695,487 @@ def test_create_transit_gateway_connection_actions_value_error_with_retries(self self.test_create_transit_gateway_connection_actions_value_error() +class TestGetTransitGatewayGreTunnel: + """ + Test Class for get_transit_gateway_gre_tunnel + """ + + @responses.activate + def test_get_transit_gateway_gre_tunnel_all_params(self): + """ + get_transit_gateway_gre_tunnel() + """ + # Set up mock + url = preprocess_url('/transit_gateways/testString/connections/testString/tunnels') + mock_response = '{"tunnels": [{"base_network_type": "classic", "created_at": "2019-01-01T12:00:00.000Z", "id": "1a15dca5-7e33-45e1-b7c5-bc690e569531", "local_bgp_asn": 13, "local_gateway_ip": "10.242.63.12", "local_tunnel_ip": "192.168.100.20", "mtu": 9000, "name": "gre1", "network_account_id": "network_account_id", "network_id": "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b", "remote_bgp_asn": 65010, "remote_gateway_ip": "10.242.33.22", "remote_tunnel_ip": "192.168.129.1", "status": "attached", "updated_at": "2019-01-01T12:00:00.000Z", "zone": {"name": "us-south-1"}}]}' + responses.add( + responses.GET, + url, + body=mock_response, + content_type='application/json', + status=200, + ) + + # Set up parameter values + transit_gateway_id = 'testString' + id = 'testString' + + # Invoke method + response = _service.get_transit_gateway_gre_tunnel( + transit_gateway_id, + id, + headers={}, + ) + + # Check for correct operation + 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. + _service.enable_retries() + self.test_get_transit_gateway_gre_tunnel_all_params() + + # Disable retries and run test_get_transit_gateway_gre_tunnel_all_params. + _service.disable_retries() + self.test_get_transit_gateway_gre_tunnel_all_params() + + @responses.activate + def test_get_transit_gateway_gre_tunnel_value_error(self): + """ + test_get_transit_gateway_gre_tunnel_value_error() + """ + # Set up mock + url = preprocess_url('/transit_gateways/testString/connections/testString/tunnels') + mock_response = '{"tunnels": [{"base_network_type": "classic", "created_at": "2019-01-01T12:00:00.000Z", "id": "1a15dca5-7e33-45e1-b7c5-bc690e569531", "local_bgp_asn": 13, "local_gateway_ip": "10.242.63.12", "local_tunnel_ip": "192.168.100.20", "mtu": 9000, "name": "gre1", "network_account_id": "network_account_id", "network_id": "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b", "remote_bgp_asn": 65010, "remote_gateway_ip": "10.242.33.22", "remote_tunnel_ip": "192.168.129.1", "status": "attached", "updated_at": "2019-01-01T12:00:00.000Z", "zone": {"name": "us-south-1"}}]}' + responses.add( + responses.GET, + url, + body=mock_response, + content_type='application/json', + status=200, + ) + + # Set up parameter values + transit_gateway_id = 'testString' + id = 'testString' + + # Pass in all but one required param and check for a ValueError + req_param_dict = { + "transit_gateway_id": transit_gateway_id, + "id": id, + } + for param in req_param_dict.keys(): + req_copy = {key: val if key is not param else None for (key, val) in req_param_dict.items()} + with pytest.raises(ValueError): + _service.get_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. + _service.enable_retries() + self.test_get_transit_gateway_gre_tunnel_value_error() + + # Disable retries and run test_get_transit_gateway_gre_tunnel_value_error. + _service.disable_retries() + self.test_get_transit_gateway_gre_tunnel_value_error() + + +class TestCreateTransitGatewayGreTunnel: + """ + Test Class for create_transit_gateway_gre_tunnel + """ + + @responses.activate + def test_create_transit_gateway_gre_tunnel_all_params(self): + """ + create_transit_gateway_gre_tunnel() + """ + # Set up mock + url = preprocess_url('/transit_gateways/testString/connections/testString/tunnels') + mock_response = '{"base_network_type": "classic", "created_at": "2019-01-01T12:00:00.000Z", "id": "1a15dca5-7e33-45e1-b7c5-bc690e569531", "local_bgp_asn": 13, "local_gateway_ip": "10.242.63.12", "local_tunnel_ip": "192.168.100.20", "mtu": 9000, "name": "gre1", "network_account_id": "network_account_id", "network_id": "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b", "remote_bgp_asn": 65010, "remote_gateway_ip": "10.242.33.22", "remote_tunnel_ip": "192.168.129.1", "status": "attached", "updated_at": "2019-01-01T12:00:00.000Z", "zone": {"name": "us-south-1"}}' + responses.add( + responses.POST, + url, + body=mock_response, + content_type='application/json', + status=201, + ) + + # Construct a dict representation of a ZoneIdentityByName model + zone_identity_model = {} + zone_identity_model['name'] = 'us-south-1' + + # Set up parameter values + transit_gateway_id = 'testString' + id = 'testString' + local_gateway_ip = '10.242.63.12' + local_tunnel_ip = '192.168.100.20' + name = 'gre1' + remote_gateway_ip = '10.242.33.22' + remote_tunnel_ip = '192.168.129.1' + zone = zone_identity_model + remote_bgp_asn = 65010 + + # Invoke method + response = _service.create_transit_gateway_gre_tunnel( + transit_gateway_id, + id, + local_gateway_ip, + local_tunnel_ip, + name, + remote_gateway_ip, + remote_tunnel_ip, + zone, + remote_bgp_asn=remote_bgp_asn, + headers={}, + ) + + # Check for correct operation + assert len(responses.calls) == 1 + assert response.status_code == 201 + # Validate body params + req_body = json.loads(str(responses.calls[0].request.body, 'utf-8')) + assert req_body['local_gateway_ip'] == '10.242.63.12' + assert req_body['local_tunnel_ip'] == '192.168.100.20' + assert req_body['name'] == 'gre1' + assert req_body['remote_gateway_ip'] == '10.242.33.22' + assert req_body['remote_tunnel_ip'] == '192.168.129.1' + assert req_body['zone'] == zone_identity_model + assert req_body['remote_bgp_asn'] == 65010 + + def test_create_transit_gateway_gre_tunnel_all_params_with_retries(self): + # Enable retries and run test_create_transit_gateway_gre_tunnel_all_params. + _service.enable_retries() + self.test_create_transit_gateway_gre_tunnel_all_params() + + # Disable retries and run test_create_transit_gateway_gre_tunnel_all_params. + _service.disable_retries() + self.test_create_transit_gateway_gre_tunnel_all_params() + + @responses.activate + def test_create_transit_gateway_gre_tunnel_value_error(self): + """ + test_create_transit_gateway_gre_tunnel_value_error() + """ + # Set up mock + url = preprocess_url('/transit_gateways/testString/connections/testString/tunnels') + mock_response = '{"base_network_type": "classic", "created_at": "2019-01-01T12:00:00.000Z", "id": "1a15dca5-7e33-45e1-b7c5-bc690e569531", "local_bgp_asn": 13, "local_gateway_ip": "10.242.63.12", "local_tunnel_ip": "192.168.100.20", "mtu": 9000, "name": "gre1", "network_account_id": "network_account_id", "network_id": "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b", "remote_bgp_asn": 65010, "remote_gateway_ip": "10.242.33.22", "remote_tunnel_ip": "192.168.129.1", "status": "attached", "updated_at": "2019-01-01T12:00:00.000Z", "zone": {"name": "us-south-1"}}' + responses.add( + responses.POST, + url, + body=mock_response, + content_type='application/json', + status=201, + ) + + # Construct a dict representation of a ZoneIdentityByName model + zone_identity_model = {} + zone_identity_model['name'] = 'us-south-1' + + # Set up parameter values + transit_gateway_id = 'testString' + id = 'testString' + local_gateway_ip = '10.242.63.12' + local_tunnel_ip = '192.168.100.20' + name = 'gre1' + remote_gateway_ip = '10.242.33.22' + remote_tunnel_ip = '192.168.129.1' + zone = zone_identity_model + remote_bgp_asn = 65010 + + # Pass in all but one required param and check for a ValueError + req_param_dict = { + "transit_gateway_id": transit_gateway_id, + "id": id, + "local_gateway_ip": local_gateway_ip, + "local_tunnel_ip": local_tunnel_ip, + "name": name, + "remote_gateway_ip": remote_gateway_ip, + "remote_tunnel_ip": remote_tunnel_ip, + "zone": zone, + } + 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.create_transit_gateway_gre_tunnel(**req_copy) + + def test_create_transit_gateway_gre_tunnel_value_error_with_retries(self): + # Enable retries and run test_create_transit_gateway_gre_tunnel_value_error. + _service.enable_retries() + self.test_create_transit_gateway_gre_tunnel_value_error() + + # Disable retries and run test_create_transit_gateway_gre_tunnel_value_error. + _service.disable_retries() + self.test_create_transit_gateway_gre_tunnel_value_error() + + +class TestDeleteTransitGatewayConnectionTunnels: + """ + Test Class for delete_transit_gateway_connection_tunnels + """ + + @responses.activate + def test_delete_transit_gateway_connection_tunnels_all_params(self): + """ + delete_transit_gateway_connection_tunnels() + """ + # Set up mock + url = preprocess_url('/transit_gateways/testString/connections/testString/tunnels/testString') + responses.add( + responses.DELETE, + url, + status=204, + ) + + # Set up parameter values + transit_gateway_id = 'testString' + id = 'testString' + gre_tunnel_id = 'testString' + + # Invoke method + response = _service.delete_transit_gateway_connection_tunnels( + transit_gateway_id, + id, + gre_tunnel_id, + headers={}, + ) + + # Check for correct operation + assert len(responses.calls) == 1 + assert response.status_code == 204 + + def test_delete_transit_gateway_connection_tunnels_all_params_with_retries(self): + # Enable retries and run test_delete_transit_gateway_connection_tunnels_all_params. + _service.enable_retries() + self.test_delete_transit_gateway_connection_tunnels_all_params() + + # Disable retries and run test_delete_transit_gateway_connection_tunnels_all_params. + _service.disable_retries() + self.test_delete_transit_gateway_connection_tunnels_all_params() + + @responses.activate + def test_delete_transit_gateway_connection_tunnels_value_error(self): + """ + test_delete_transit_gateway_connection_tunnels_value_error() + """ + # Set up mock + url = preprocess_url('/transit_gateways/testString/connections/testString/tunnels/testString') + responses.add( + responses.DELETE, + url, + status=204, + ) + + # Set up parameter values + transit_gateway_id = 'testString' + id = 'testString' + gre_tunnel_id = 'testString' + + # 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, + } + 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.delete_transit_gateway_connection_tunnels(**req_copy) + + def test_delete_transit_gateway_connection_tunnels_value_error_with_retries(self): + # Enable retries and run test_delete_transit_gateway_connection_tunnels_value_error. + _service.enable_retries() + self.test_delete_transit_gateway_connection_tunnels_value_error() + + # Disable retries and run test_delete_transit_gateway_connection_tunnels_value_error. + _service.disable_retries() + self.test_delete_transit_gateway_connection_tunnels_value_error() + + +class TestGetTransitGatewayConnectionTunnels: + """ + Test Class for get_transit_gateway_connection_tunnels + """ + + @responses.activate + def test_get_transit_gateway_connection_tunnels_all_params(self): + """ + get_transit_gateway_connection_tunnels() + """ + # Set up mock + url = preprocess_url('/transit_gateways/testString/connections/testString/tunnels/testString') + mock_response = '{"base_network_type": "classic", "created_at": "2019-01-01T12:00:00.000Z", "id": "1a15dca5-7e33-45e1-b7c5-bc690e569531", "local_bgp_asn": 13, "local_gateway_ip": "10.242.63.12", "local_tunnel_ip": "192.168.100.20", "mtu": 9000, "name": "gre1", "network_account_id": "network_account_id", "network_id": "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b", "remote_bgp_asn": 65010, "remote_gateway_ip": "10.242.33.22", "remote_tunnel_ip": "192.168.129.1", "status": "attached", "updated_at": "2019-01-01T12:00:00.000Z", "zone": {"name": "us-south-1"}}' + responses.add( + responses.GET, + url, + body=mock_response, + content_type='application/json', + status=200, + ) + + # Set up parameter values + transit_gateway_id = 'testString' + id = 'testString' + gre_tunnel_id = 'testString' + + # Invoke method + response = _service.get_transit_gateway_connection_tunnels( + transit_gateway_id, + id, + gre_tunnel_id, + headers={}, + ) + + # Check for correct operation + assert len(responses.calls) == 1 + assert response.status_code == 200 + + def test_get_transit_gateway_connection_tunnels_all_params_with_retries(self): + # Enable retries and run test_get_transit_gateway_connection_tunnels_all_params. + _service.enable_retries() + self.test_get_transit_gateway_connection_tunnels_all_params() + + # Disable retries and run test_get_transit_gateway_connection_tunnels_all_params. + _service.disable_retries() + self.test_get_transit_gateway_connection_tunnels_all_params() + + @responses.activate + def test_get_transit_gateway_connection_tunnels_value_error(self): + """ + test_get_transit_gateway_connection_tunnels_value_error() + """ + # Set up mock + url = preprocess_url('/transit_gateways/testString/connections/testString/tunnels/testString') + mock_response = '{"base_network_type": "classic", "created_at": "2019-01-01T12:00:00.000Z", "id": "1a15dca5-7e33-45e1-b7c5-bc690e569531", "local_bgp_asn": 13, "local_gateway_ip": "10.242.63.12", "local_tunnel_ip": "192.168.100.20", "mtu": 9000, "name": "gre1", "network_account_id": "network_account_id", "network_id": "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b", "remote_bgp_asn": 65010, "remote_gateway_ip": "10.242.33.22", "remote_tunnel_ip": "192.168.129.1", "status": "attached", "updated_at": "2019-01-01T12:00:00.000Z", "zone": {"name": "us-south-1"}}' + responses.add( + responses.GET, + url, + body=mock_response, + content_type='application/json', + status=200, + ) + + # Set up parameter values + transit_gateway_id = 'testString' + id = 'testString' + gre_tunnel_id = 'testString' + + # 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, + } + 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_connection_tunnels(**req_copy) + + def test_get_transit_gateway_connection_tunnels_value_error_with_retries(self): + # Enable retries and run test_get_transit_gateway_connection_tunnels_value_error. + _service.enable_retries() + self.test_get_transit_gateway_connection_tunnels_value_error() + + # Disable retries and run test_get_transit_gateway_connection_tunnels_value_error. + _service.disable_retries() + self.test_get_transit_gateway_connection_tunnels_value_error() + + +class TestUpdateTransitGatewayConnectionTunnels: + """ + Test Class for update_transit_gateway_connection_tunnels + """ + + @responses.activate + def test_update_transit_gateway_connection_tunnels_all_params(self): + """ + update_transit_gateway_connection_tunnels() + """ + # Set up mock + url = preprocess_url('/transit_gateways/testString/connections/testString/tunnels/testString') + mock_response = '{"base_network_type": "classic", "created_at": "2019-01-01T12:00:00.000Z", "id": "1a15dca5-7e33-45e1-b7c5-bc690e569531", "local_bgp_asn": 13, "local_gateway_ip": "10.242.63.12", "local_tunnel_ip": "192.168.100.20", "mtu": 9000, "name": "gre1", "network_account_id": "network_account_id", "network_id": "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b", "remote_bgp_asn": 65010, "remote_gateway_ip": "10.242.33.22", "remote_tunnel_ip": "192.168.129.1", "status": "attached", "updated_at": "2019-01-01T12:00:00.000Z", "zone": {"name": "us-south-1"}}' + responses.add( + responses.PATCH, + url, + body=mock_response, + content_type='application/json', + status=200, + ) + + # Set up parameter values + transit_gateway_id = 'testString' + id = 'testString' + gre_tunnel_id = 'testString' + name = 'gre2' + + # Invoke method + response = _service.update_transit_gateway_connection_tunnels( + transit_gateway_id, + id, + gre_tunnel_id, + name=name, + headers={}, + ) + + # Check for correct operation + assert len(responses.calls) == 1 + assert response.status_code == 200 + # Validate body params + req_body = json.loads(str(responses.calls[0].request.body, 'utf-8')) + assert req_body['name'] == 'gre2' + + def test_update_transit_gateway_connection_tunnels_all_params_with_retries(self): + # Enable retries and run test_update_transit_gateway_connection_tunnels_all_params. + _service.enable_retries() + self.test_update_transit_gateway_connection_tunnels_all_params() + + # Disable retries and run test_update_transit_gateway_connection_tunnels_all_params. + _service.disable_retries() + self.test_update_transit_gateway_connection_tunnels_all_params() + + @responses.activate + def test_update_transit_gateway_connection_tunnels_value_error(self): + """ + test_update_transit_gateway_connection_tunnels_value_error() + """ + # Set up mock + url = preprocess_url('/transit_gateways/testString/connections/testString/tunnels/testString') + mock_response = '{"base_network_type": "classic", "created_at": "2019-01-01T12:00:00.000Z", "id": "1a15dca5-7e33-45e1-b7c5-bc690e569531", "local_bgp_asn": 13, "local_gateway_ip": "10.242.63.12", "local_tunnel_ip": "192.168.100.20", "mtu": 9000, "name": "gre1", "network_account_id": "network_account_id", "network_id": "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b", "remote_bgp_asn": 65010, "remote_gateway_ip": "10.242.33.22", "remote_tunnel_ip": "192.168.129.1", "status": "attached", "updated_at": "2019-01-01T12:00:00.000Z", "zone": {"name": "us-south-1"}}' + responses.add( + responses.PATCH, + url, + body=mock_response, + content_type='application/json', + status=200, + ) + + # Set up parameter values + transit_gateway_id = 'testString' + id = 'testString' + gre_tunnel_id = 'testString' + name = 'gre2' + + # 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, + } + for param in req_param_dict.keys(): + req_copy = {key: val if key is not param else None for (key, val) in req_param_dict.items()} + with pytest.raises(ValueError): + _service.update_transit_gateway_connection_tunnels(**req_copy) + + def test_update_transit_gateway_connection_tunnels_value_error_with_retries(self): + # Enable retries and run test_update_transit_gateway_connection_tunnels_value_error. + _service.enable_retries() + self.test_update_transit_gateway_connection_tunnels_value_error() + + # Disable retries and run test_update_transit_gateway_connection_tunnels_value_error. + _service.disable_retries() + self.test_update_transit_gateway_connection_tunnels_value_error() + + # endregion ############################################################################## # End of Service: TransitGatewaysNetworkConnections @@ -1811,7 +2316,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"}]}' + 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"}]}]}' responses.add( responses.GET, url, @@ -1849,7 +2354,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"}]}' + 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"}]}]}' responses.add( responses.GET, url, @@ -2915,6 +3420,36 @@ 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 @@ -3210,6 +3745,109 @@ 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 @@ -3252,8 +3890,8 @@ def test_resource_group_reference_serialization(self): # Construct a json representation of a ResourceGroupReference model resource_group_reference_model_json = {} - resource_group_reference_model_json['id'] = '56969d6043e9465c883cb9f7363e78e8' resource_group_reference_model_json['href'] = 'https://resource-manager.bluemix.net/v1/resource_groups/56969d6043e9465c883cb9f7363e78e8' + resource_group_reference_model_json['id'] = '56969d6043e9465c883cb9f7363e78e8' # Construct a model instance of ResourceGroupReference by calling from_dict on the json representation resource_group_reference_model = ResourceGroupReference.from_dict(resource_group_reference_model_json) @@ -3271,6 +3909,36 @@ 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 @@ -3657,12 +4325,19 @@ def test_ts_location_serialization(self): ts_local_location_model['supported_connection_types'] = ['classic', 'vpc', 'directlink', 'gre_tunnel', 'power_virtual_server', 'unbound_gre_tunnel'] ts_local_location_model['type'] = 'region' + 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] # Construct a model instance of TSLocation by calling from_dict on the json representation ts_location_model = TSLocation.from_dict(ts_location_model_json) @@ -3739,22 +4414,41 @@ def test_transit_connection_serialization(self): transit_gateway_reference_model['id'] = '456f58c1-afe7-123a-0a0a-7f3d720f1a44' transit_gateway_reference_model['name'] = 'my-transit-gw100' - zone_reference_model = {} # ZoneReference - zone_reference_model['name'] = 'us-south-1' + 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' # Construct a json representation of a TransitConnection model transit_connection_model_json = {} + transit_connection_model_json['base_network_type'] = 'classic' + transit_connection_model_json['name'] = 'Transit_Service_BWTN_SJ_DL' + transit_connection_model_json['network_id'] = 'crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b' + transit_connection_model_json['network_type'] = 'vpc' + transit_connection_model_json['id'] = '1a15dca5-7e33-45e1-b7c5-bc690e569531' transit_connection_model_json['base_connection_id'] = '975f58c1-afe7-469a-9727-7f3d720f2d32' transit_connection_model_json['created_at'] = '2019-01-01T12:00:00Z' - transit_connection_model_json['id'] = '1a15dca5-7e33-45e1-b7c5-bc690e569531' transit_connection_model_json['local_bgp_asn'] = 64490 transit_connection_model_json['local_gateway_ip'] = '192.168.100.1' transit_connection_model_json['local_tunnel_ip'] = '192.168.129.2' transit_connection_model_json['mtu'] = 9000 - transit_connection_model_json['name'] = 'Transit_Service_SJ_DL' - transit_connection_model_json['network_account_id'] = '28e4d90ac7504be694471ee66e70d0d5' - transit_connection_model_json['network_id'] = 'crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b' - transit_connection_model_json['network_type'] = 'vpc' + transit_connection_model_json['network_account_id'] = 'testString' transit_connection_model_json['prefix_filters'] = [transit_gateway_connection_prefix_filter_reference_model] transit_connection_model_json['prefix_filters_default'] = 'permit' transit_connection_model_json['remote_bgp_asn'] = 65010 @@ -3763,8 +4457,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['updated_at'] = '2019-01-01T12:00:00Z' - transit_connection_model_json['zone'] = zone_reference_model + transit_connection_model_json['zone'] = gre_tunnel_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) @@ -3809,21 +4504,40 @@ 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' - zone_reference_model = {} # ZoneReference - zone_reference_model['name'] = 'us-south-1' + 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' transit_connection_model = {} # TransitConnection + transit_connection_model['base_network_type'] = 'classic' + transit_connection_model['name'] = 'Transit_Service_BWTN_SJ_DL' + transit_connection_model['network_id'] = 'crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b' + transit_connection_model['network_type'] = 'vpc' + transit_connection_model['id'] = '1a15dca5-7e33-45e1-b7c5-bc690e569531' transit_connection_model['base_connection_id'] = '975f58c1-afe7-469a-9727-7f3d720f2d32' transit_connection_model['created_at'] = '2019-01-01T12:00:00Z' - transit_connection_model['id'] = '1a15dca5-7e33-45e1-b7c5-bc690e569531' transit_connection_model['local_bgp_asn'] = 64490 transit_connection_model['local_gateway_ip'] = '192.168.100.1' transit_connection_model['local_tunnel_ip'] = '192.168.129.2' transit_connection_model['mtu'] = 9000 - transit_connection_model['name'] = 'Transit_Service_SJ_DL' - transit_connection_model['network_account_id'] = '28e4d90ac7504be694471ee66e70d0d5' - transit_connection_model['network_id'] = 'crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b' - transit_connection_model['network_type'] = 'vpc' + transit_connection_model['network_account_id'] = 'testString' transit_connection_model['prefix_filters'] = [transit_gateway_connection_prefix_filter_reference_model] transit_connection_model['prefix_filters_default'] = 'permit' transit_connection_model['remote_bgp_asn'] = 65010 @@ -3832,8 +4546,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['updated_at'] = '2019-01-01T12:00:00Z' - transit_connection_model['zone'] = zone_reference_model + transit_connection_model['zone'] = gre_tunnel_zone_reference_model pagination_first_connection_model = {} # PaginationFirstConnection pagination_first_connection_model['href'] = 'https://transit.cloud.ibm.com/v1/connections?limit=50' @@ -3878,8 +4593,8 @@ def test_transit_gateway_serialization(self): # Construct dict forms of any model objects needed in order to build this model. resource_group_reference_model = {} # ResourceGroupReference - resource_group_reference_model['id'] = '56969d6043e9465c883cb9f7363e78e8' resource_group_reference_model['href'] = 'https://resource-manager.bluemix.net/v1/resource_groups/56969d6043e9465c883cb9f7363e78e8' + resource_group_reference_model['id'] = '56969d6043e9465c883cb9f7363e78e8' # Construct a json representation of a TransitGateway model transit_gateway_model_json = {} @@ -3929,8 +4644,8 @@ def test_transit_gateway_collection_serialization(self): pagination_next_tg_model['start'] = 'MjAyMC0wNS0wOFQxNDoxNzowMy45NzQ5NzNa' resource_group_reference_model = {} # ResourceGroupReference - resource_group_reference_model['id'] = '56969d6043e9465c883cb9f7363e78e8' resource_group_reference_model['href'] = 'https://resource-manager.bluemix.net/v1/resource_groups/56969d6043e9465c883cb9f7363e78e8' + resource_group_reference_model['id'] = '56969d6043e9465c883cb9f7363e78e8' transit_gateway_model = {} # TransitGateway transit_gateway_model['id'] = 'ef4dcb1a-fee4-41c7-9e11-9cd99e65c1f4' @@ -3988,8 +4703,26 @@ 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' - transit_gateway_connection_cust_zone_model = {} # TransitGatewayConnectionCustZone - transit_gateway_connection_cust_zone_model['name'] = 'us-south-1' + 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' transit_gateway_connection_cust_model = {} # TransitGatewayConnectionCust transit_gateway_connection_cust_model['base_network_type'] = 'classic' @@ -4003,7 +4736,7 @@ def test_transit_gateway_connection_collection_serialization(self): 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['network_account_id'] = '28e4d90ac7504be694471ee66e70d0d5' + transit_gateway_connection_cust_model['network_account_id'] = 'testString' 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 @@ -4011,8 +4744,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['updated_at'] = '2019-01-01T12:00:00Z' - transit_gateway_connection_cust_model['zone'] = transit_gateway_connection_cust_zone_model + transit_gateway_connection_cust_model['zone'] = gre_tunnel_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' @@ -4067,8 +4801,26 @@ 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' - transit_gateway_connection_cust_zone_model = {} # TransitGatewayConnectionCustZone - transit_gateway_connection_cust_zone_model['name'] = 'us-south-1' + 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' # Construct a json representation of a TransitGatewayConnectionCust model transit_gateway_connection_cust_model_json = {} @@ -4083,7 +4835,7 @@ def test_transit_gateway_connection_cust_serialization(self): 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['network_account_id'] = '28e4d90ac7504be694471ee66e70d0d5' + transit_gateway_connection_cust_model_json['network_account_id'] = 'testString' 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 @@ -4091,8 +4843,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['updated_at'] = '2019-01-01T12:00:00Z' - transit_gateway_connection_cust_model_json['zone'] = transit_gateway_connection_cust_zone_model + transit_gateway_connection_cust_model_json['zone'] = gre_tunnel_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) @@ -4110,36 +4863,6 @@ def test_transit_gateway_connection_cust_serialization(self): assert transit_gateway_connection_cust_model_json2 == transit_gateway_connection_cust_model_json -class TestModel_TransitGatewayConnectionCustZone: - """ - Test Class for TransitGatewayConnectionCustZone - """ - - def test_transit_gateway_connection_cust_zone_serialization(self): - """ - Test serialization/deserialization for TransitGatewayConnectionCustZone - """ - - # Construct a json representation of a TransitGatewayConnectionCustZone model - transit_gateway_connection_cust_zone_model_json = {} - transit_gateway_connection_cust_zone_model_json['name'] = 'us-south-1' - - # Construct a model instance of TransitGatewayConnectionCustZone by calling from_dict on the json representation - transit_gateway_connection_cust_zone_model = TransitGatewayConnectionCustZone.from_dict(transit_gateway_connection_cust_zone_model_json) - assert transit_gateway_connection_cust_zone_model != False - - # Construct a model instance of TransitGatewayConnectionCustZone by calling from_dict on the json representation - transit_gateway_connection_cust_zone_model_dict = TransitGatewayConnectionCustZone.from_dict(transit_gateway_connection_cust_zone_model_json).__dict__ - transit_gateway_connection_cust_zone_model2 = TransitGatewayConnectionCustZone(**transit_gateway_connection_cust_zone_model_dict) - - # Verify the model instances are equivalent - assert transit_gateway_connection_cust_zone_model == transit_gateway_connection_cust_zone_model2 - - # Convert model instance back to dict and verify no loss of data - transit_gateway_connection_cust_zone_model_json2 = transit_gateway_connection_cust_zone_model.to_dict() - assert transit_gateway_connection_cust_zone_model_json2 == transit_gateway_connection_cust_zone_model_json - - class TestModel_TransitGatewayConnectionPrefixFilter: """ Test Class for TransitGatewayConnectionPrefixFilter @@ -4210,6 +4933,94 @@ 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: + """ + Test Class for TransitGatewayRedundantGRETunnelReference + """ + + def test_transit_gateway_redundant_gre_tunnel_reference_serialization(self): + """ + Test serialization/deserialization for TransitGatewayRedundantGRETunnelReference + """ + + # 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) + + # Verify the model instances are equivalent + assert transit_gateway_redundant_gre_tunnel_reference_model == transit_gateway_redundant_gre_tunnel_reference_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 + + +class TestModel_TransitGatewayRedundantGRETunnelTemplate: + """ + Test Class for TransitGatewayRedundantGRETunnelTemplate + """ + + def test_transit_gateway_redundant_gre_tunnel_template_serialization(self): + """ + Test serialization/deserialization for TransitGatewayRedundantGRETunnelTemplate + """ + + # 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' + + # 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 + + # 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 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) + + # Verify the model instances are equivalent + assert transit_gateway_redundant_gre_tunnel_template_model == transit_gateway_redundant_gre_tunnel_template_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 + + class TestModel_TransitGatewayReference: """ Test Class for TransitGatewayReference @@ -4272,6 +5083,41 @@ 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